diff --git a/tests/ed25519.rs b/tests/ed25519.rs index 403090f..71c747f 100644 --- a/tests/ed25519.rs +++ b/tests/ed25519.rs @@ -9,7 +9,7 @@ pub const SECRET_KEY_LENGTH: usize = 32; pub const PUBLIC_KEY_LENGTH: usize = 32; pub const SIGNATURE_LENGTH: usize = 64; -use crypto::signatures::ed25519::{PublicKey, SecretKey, Signature}; +use crypto::signatures::ed25519::{PublicKey, PublicKeyBytes, SecretKey, Signature}; #[test] fn test_zip215() -> crypto::Result<()> { @@ -24,13 +24,13 @@ fn test_zip215() -> crypto::Result<()> { for tv in tvs.iter() { let mut pkb = [0; PUBLIC_KEY_LENGTH]; hex::decode_to_slice(tv.public_key, &mut pkb as &mut [u8]).unwrap(); - let pk = PublicKey::try_from_bytes(pkb)?; + let pk = PublicKeyBytes::from_bytes(pkb); let mut sigb = [0; SIGNATURE_LENGTH]; hex::decode_to_slice(tv.signature, &mut sigb as &mut [u8]).unwrap(); let sig = Signature::from_bytes(sigb); - assert!(PublicKey::verify(&pk, &sig, ms)); + assert!(pk.verify(&sig, ms)?); } Ok(()) @@ -55,9 +55,9 @@ fn test_malleability() -> crypto::Result<()> { 0x7d, 0x4d, 0x0e, 0x7f, 0x61, 0x53, 0xa6, 0x9b, 0x62, 0x42, 0xb5, 0x22, 0xab, 0xbe, 0xe6, 0x85, 0xfd, 0xa4, 0x42, 0x0f, 0x88, 0x34, 0xb1, 0x08, 0xc3, 0xbd, 0xae, 0x36, 0x9e, 0xf5, 0x49, 0xfa, ]; - let pk = PublicKey::try_from_bytes(pkb)?; + let pk = PublicKeyBytes::from_bytes(pkb); - assert!(!PublicKey::verify(&pk, &sig, &ms)); + assert!(!pk.verify(&sig, &ms)?); Ok(()) }