Skip to content

Commit

Permalink
fix: incorrect upper bound for s in sign
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Oct 29, 2023
1 parent 2d44699 commit 4b65d35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starknet-crypto/src/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub fn sign(
let s = mul_mod_floor(&r, private_key, &EC_ORDER);
let s = add_unbounded(&s, message);
let s = bigint_mul_mod_floor(s, &k_inv, &EC_ORDER);
if s == FieldElement::ZERO || s >= EC_ORDER {
if s == FieldElement::ZERO || s >= ELEMENT_UPPER_BOUND {
return Err(SignError::InvalidK);
}

Expand Down

0 comments on commit 4b65d35

Please sign in to comment.