Skip to content

Commit

Permalink
Clean up couple of cfg(test) gates
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Mar 8, 2024
1 parent 5e6e677 commit b1ebd5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wycheproofs/wycheproof-ed25519-dalek/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#[cfg(test)]
use ed25519_dalek::{VerifyingKey, Verifier, Signature};

// hex strings (due to generated source files being ascii
#[cfg(test)]
fn ed25519_dalek_wycheproof(public_key: &str, sig: &str, msg: &str) {

let pk_bytes = hex::decode(public_key).unwrap();
Expand All @@ -12,7 +14,7 @@ fn ed25519_dalek_wycheproof(public_key: &str, sig: &str, msg: &str) {
// panic if size wrong
let sig: &[u8; 64] = sig_bytes.as_slice().try_into().expect("input sig incorrect length");

let typed_sig = ed25519_dalek::Signature::from_bytes(sig);
let typed_sig = Signature::from_bytes(sig);
let verifying_key = VerifyingKey::from_bytes(pk).unwrap();

assert!(verifying_key.verify(hex::decode(msg).unwrap().as_slice(), &typed_sig).is_ok())
Expand Down

0 comments on commit b1ebd5c

Please sign in to comment.