Skip to content

Commit

Permalink
fix test_generate_pubkey_dalek
Browse files Browse the repository at this point in the history
  • Loading branch information
max-zengo committed May 19, 2024
1 parent 977ca9b commit 19228a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ mod tests {
for _ in 0..4096 {
rng.fill_bytes(&mut privkey);
let zengo_keypair = KeyPair::create_from_private_key(privkey);
let dalek_secret = ed25519_dalek::SecretKey::try_from(privkey)
let dalek_secret: [u8; 32] = ed25519_dalek::SecretKey::try_into(privkey)
.expect("Can only fail if bytes.len()<32");
let dalek_pub = ed25519_dalek::VerifyingKey::from_bytes(&privkey).unwrap();
assert_eq!(zengo_keypair.pubkey(), dalek_pub.to_bytes());
let dalek_pub = ed25519_dalek::SigningKey::from_bytes(&dalek_secret);

assert_eq!(zengo_keypair.pubkey(), dalek_pub.verifying_key().to_bytes());
}
}

Expand Down

0 comments on commit 19228a2

Please sign in to comment.