You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let grind_r_sig = s.sign_ecdsa_grind_r(&msg,&sk,1);
@@ -927,6 +930,23 @@ mod tests {
927
930
assert!(from_hex("ag",&mut[0u8;4]).is_err());
928
931
}
929
932
933
+
#[test]
934
+
#[cfg(not(fuzzing))]// fuzz-sigs have fixed size/format
935
+
#[cfg(any(feature = "alloc", feature = "std"))]
936
+
fntest_noncedata(){
937
+
let secp = Secp256k1::new();
938
+
let msg = hex!("887d04bb1cf1b1554f1b268dfe62d13064ca67ae45348d50d1392ce2d13418ac");
939
+
let msg = Message::from_slice(&msg).unwrap();
940
+
let noncedata = [42u8;32];
941
+
let sk = SecretKey::from_str("57f0148f94d13095cfda539d0da0d1541304b678d8b36e243980aab4e1b7cead").unwrap();
942
+
let expected_sig = hex!("24861b3edd4e7da43319c635091405feced6efa4ec99c3c3c35f6c3ba0ed8816116772e84994084db85a6c20589f6a85af569d42275c2a5dd900da5776b99d5d");
943
+
let expected_sig = ecdsa::Signature::from_compact(&expected_sig).unwrap();
944
+
945
+
let sig = secp.sign_ecdsa_with_noncedata(&msg,&sk,&noncedata);
946
+
947
+
assert_eq!(expected_sig, sig);
948
+
}
949
+
930
950
#[test]
931
951
#[cfg(not(fuzzing))]// fixed sig vectors can't work with fuzz-sigs
0 commit comments