Follow-up to #1205.
This splits the secp256k1_fe_set_b32
function into two variants:
secp256k1_fe_set_b32_mod
, which returnsvoid
, reduces modulo the curve order, and only promises weakly normalized output.secp256k1_fe_set_b32_limit
, which returnsint
indicating success/failure, and only promises valid output in case the input is in range (but guarantees it’s strongly normalized in this case).
This removes one of the few cases in the codebase where normalization status depends on runtime values, making it fixed at compile-time instead.