-
Hi sir @gbotrel @yelhousni , recently I want to add support for secp256r1 curve for gnark-crypto. I'm fully understanding how the following value comes, could you please explain it, appreciate it:
And is there any other parts should I take care? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @SherLzp !
You shouldn't care about these as they are auto-generated. You just need to put the curve moduli in the config file (e.g. for secp256k1) and the |
Beta Was this translation helpful? Give feedback.
Hi @SherLzp !
q
is the modulus115792089237316195423570985008687907853269984665640564039457584007908834671663
andr
is2^64
. So-1/q % 2^64
is15580212934572586289
.(q-1)/2
in decimal. e.g. write(q-1)/2
in binary and take the first 64 bits. This is1111111111111111111111111111111111111111111111111111111111111111
in binary and18446744073709551615
in decimal.You shouldn't care about these as they are auto-generated. You just need to put the curve moduli in the config file (e.g. for secp256k1) and the
fp/
andfr/
packages are auto-generated.