Skip to content

Commit 539fd96

Browse files
authored
fix: normalize signature s value (#10180)
1 parent f747494 commit 539fd96

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/cheatcodes/src/crypto.rs

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ fn sign_with_wallet(
276276
fn sign_p256(private_key: &U256, digest: &B256) -> Result {
277277
let signing_key = parse_private_key_p256(private_key)?;
278278
let signature: P256Signature = signing_key.sign_prehash(digest.as_slice())?;
279+
let signature = signature.normalize_s().unwrap_or(signature);
279280
let r_bytes: [u8; 32] = signature.r().to_bytes().into();
280281
let s_bytes: [u8; 32] = signature.s().to_bytes().into();
281282

0 commit comments

Comments
 (0)