test DH as well
This commit is contained in:
+1
-1
@@ -33,4 +33,4 @@ hex = "0.4.2"
|
|||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
proptest = "0.10.0"
|
proptest = "0.10.0"
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
|||||||
@@ -237,5 +237,15 @@ mod tests {
|
|||||||
prop_assert_eq!(&X25519KeyPair::public_from_private(sk), pk);
|
prop_assert_eq!(&X25519KeyPair::public_from_private(sk), pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_x25519_dh(kp1 in X25519KeyPair::uniform_keypair_strategy(),
|
||||||
|
kp2 in X25519KeyPair::uniform_keypair_strategy()) {
|
||||||
|
|
||||||
|
let dh1 = X25519KeyPair::diffie_hellman(kp1.public().clone(), kp2.private().clone());
|
||||||
|
let dh2 = X25519KeyPair::diffie_hellman(kp2.public().clone(), kp1.private().clone());
|
||||||
|
|
||||||
|
prop_assert_eq!(dh1,dh2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user