Skip to content

When use secp256k1_fe_normalize(_weak) ? #1375

Discussion options

You must be logged in to vote

Objects of type secp256k1_fe implicitly carry a magnitude (an integer in [0, 32]), and whether they are normalized (a boolean). If a secp256k1_fe is normalized, it is implied that its magnitude <= 1. These two values are not explicitly present materialized as fields of the secp256k1_fe struct, but they need to be tracked implicitly (unless in the tests when the VERIFY macro is defined).

The functions that operate on field elements also operate on these two values. See the docs in src/field.h, e.g., for secp256k1_fe_sqr:

secp256k1/src/field.h

Lines 270 to 277 in cc55757

/** Square a field element.
*
* On input, a must be a valid field element; r does not need to be …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@PeterMacGonagan
Comment options

Answer selected by PeterMacGonagan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants