FINALLY WORKS (yay), integration test
This commit is contained in:
parent
eebad9991a
commit
2c7a005d7c
4 changed files with 164 additions and 57 deletions
17
tests/random.rs
Normal file
17
tests/random.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#![cfg(feature = "rand")]
|
||||
|
||||
use diffie_hellman::{Public, Secret};
|
||||
|
||||
#[test]
|
||||
fn random_dh_key_exchange() {
|
||||
let a = Secret::random();
|
||||
let b = Secret::random();
|
||||
|
||||
let pa = Public::from(&a);
|
||||
let pb = Public::from(&b);
|
||||
|
||||
let sa = a.diffie_hellman(&pb);
|
||||
let sb = b.diffie_hellman(&pa);
|
||||
|
||||
println!("{} == {}", sa, sb)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue