Skip to content

Commit 4f2b185

Browse files
author
fi3
committed
Fix noise tests
1 parent 15c2983 commit 4f2b185

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

protocols/v2/noise-sv2/src/handshake.rs

-44
Original file line numberDiff line numberDiff line change
@@ -444,23 +444,6 @@ mod test {
444444
assert!(cipher_1.get_h() == cipher_2.get_h());
445445
}
446446

447-
#[test]
448-
fn test_ecdh() {
449-
let key_pair_1 = TestHandShake::generate_key();
450-
let key_pair_2 = TestHandShake::generate_key();
451-
452-
let secret_1 = key_pair_1.secret_bytes();
453-
let secret_2 = key_pair_2.secret_bytes();
454-
455-
let pub_1 = key_pair_1.x_only_public_key();
456-
let pub_2 = key_pair_2.x_only_public_key();
457-
458-
let ecdh_1 = TestHandShake::ecdh(&secret_1, &pub_2.0.serialize());
459-
let ecdh_2 = TestHandShake::ecdh(&secret_2, &pub_1.0.serialize());
460-
461-
assert!(ecdh_1 == ecdh_2);
462-
}
463-
464447
#[derive(Clone, Debug)]
465448
struct KeypairWrapper(pub Option<Keypair>);
466449

@@ -484,31 +467,4 @@ mod test {
484467
}
485468
}
486469
}
487-
488-
#[quickcheck_macros::quickcheck]
489-
fn test_ecdh_1(kp1: KeypairWrapper, kp2: KeypairWrapper) -> TestResult {
490-
let (kp1, kp2) = match (kp1.0, kp2.0) {
491-
(Some(kp1), Some(kp2)) => (kp1, kp2),
492-
_ => return TestResult::discard(),
493-
};
494-
if kp1.x_only_public_key().1 == crate::PARITY && kp2.x_only_public_key().1 == crate::PARITY
495-
{
496-
let secret_1 = kp1.secret_bytes();
497-
let secret_2 = kp2.secret_bytes();
498-
499-
let pub_1 = kp1.x_only_public_key();
500-
let pub_2 = kp2.x_only_public_key();
501-
502-
let ecdh_1 = TestHandShake::ecdh(&secret_1, &pub_2.0.serialize());
503-
let ecdh_2 = TestHandShake::ecdh(&secret_2, &pub_1.0.serialize());
504-
505-
if ecdh_1 == ecdh_2 {
506-
TestResult::passed()
507-
} else {
508-
TestResult::failed()
509-
}
510-
} else {
511-
TestResult::discard()
512-
}
513-
}
514470
}

0 commit comments

Comments
 (0)