MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / test_dh_agree

Function test_dh_agree

dstack-util/src/crypto.rs:49–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48 #[test]
49 fn test_dh_agree() {
50 use rand::Rng;
51 let secret = rand::thread_rng().gen::<[u8; 32]>();
52 let pubkey = rand::thread_rng().gen::<[u8; 32]>();
53 let shared = dh_agree(secret, pubkey);
54 assert_eq!(shared.len(), 32);
55 println!("secret: {:?}", hex::encode(secret));
56 println!("pubkey: {:?}", hex::encode(pubkey));
57 println!("shared: {:?}", hex::encode(shared));
58 }
59
60 #[test]
61 fn test_dh_decrypt_invalid_input() {

Callers

nothing calls this directly

Calls 1

dh_agreeFunction · 0.85

Tested by

no test coverage detected