Skip to content

Commit

Permalink
curve_order fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Nov 14, 2024
1 parent 6afbb61 commit 73c82b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion chia/_tests/clvm/test_member_puzzles.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,13 @@ async def test_secp256k1_member(cost_logger: CostLogger) -> None:
# The type stubs are weird here, `deterministic_signing` is assuredly an argument
ec.ECDSA(hashes.SHA256(), deterministic_signing=True), # type: ignore[call-arg]
)
r, s = decode_dss_signature(der_sig)
r, _s = decode_dss_signature(der_sig)
curve_order = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
if _s > curve_order // 2:
s = -_s % curve_order
else:
s = _s
sig = r.to_bytes(32, byteorder='big') + s.to_bytes(32, byteorder='big')
sig = r.to_bytes(32, byteorder="big") + s.to_bytes(32, byteorder="big")
sb = WalletSpendBundle(
[
Expand Down

0 comments on commit 73c82b2

Please sign in to comment.