mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-04 06:13:10 +00:00
add test_calculate_shared_secret_with_identity_point
This commit is contained in:
parent
7d0ff2df30
commit
31762ed4eb
@ -151,6 +151,20 @@ mod tests {
|
|||||||
assert!(address_key_holder.address.as_slice().len() > 0); // Assume TreeHashType has non-zero length for a valid address
|
assert!(address_key_holder.address.as_slice().len() > 0); // Assume TreeHashType has non-zero length for a valid address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_calculate_shared_secret_with_identity_point() {
|
||||||
|
let address_key_holder = AddressKeyHolder::new_os_random();
|
||||||
|
|
||||||
|
// Use identity point as ephemeral public key
|
||||||
|
let identity_point = AffinePoint::identity();
|
||||||
|
|
||||||
|
// Calculate shared secret
|
||||||
|
let shared_secret = address_key_holder.calculate_shared_secret_receiver(identity_point);
|
||||||
|
|
||||||
|
// The shared secret with the identity point should also result in the identity point
|
||||||
|
assert!(Into::<bool>::into(shared_secret.is_identity()));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn key_generation_test() {
|
fn key_generation_test() {
|
||||||
let seed_holder = SeedHolder::new_os_random();
|
let seed_holder = SeedHolder::new_os_random();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user