Replies: 1 comment 9 replies
-
I don't see how it's "equivalent". The spec says nothing about "bigger than half of curve order". Do you have any specifications with test vectors that validate this behavior? The goal is to conform to vectors, and we have plenty of those. And |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://datatracker.ietf.org/doc/html/rfc8032#section-3.1 says that
which is equivalent of saying that x is negative if
x > (p - 1) / 2 (mod p)
.However, the negative mask
0x80
is included whenx & 1n === 1n
, which seems wrong.https://github.com/paulmillr/noble-curves/blob/main/src/abstract/edwards.ts#L398C1-L403C6
Example:
The Baby JubJub curve can be defined with
twistedEdwards
with these parameters:The base point of Baby Jubjub is
base.ex
is positive, becauseSo it's encoding should be
8b7d2d877a253c4b7733e1b91f05e0fcedf96bd11c2e572549b2a0f703727925
(positive x), instead ofThe encoding as
...7925
is consistent with other libraries (e.g. gnark-crypto)Beta Was this translation helpful? Give feedback.
All reactions