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 696dd28 commit a83c663
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 a83c663

Please sign in to comment.