-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fp.fromBytes does not mod-reduce by default #111
Comments
However, I can bypass the issue adding x=fp.create(x) |
bn254 is just an ordinary weierstrass curve - just like with any other, use |
Hi, Paul
Consider the array derived set to
Uint8Array(32) [
239, 58, 3, 206, 5, 236, 79, 101,
215, 253, 95, 44, 114, 216, 108, 195,
191, 131, 86, 158, 222, 211, 233, 216,
103, 133, 230, 212, 191, 1, 173, 98
]
I have the following code that uses derived:
I get the result:
x:108205274200769640731677027225433911640053818717593242889612531000506144894306 order:21888242871839275222246405745257275088696311157297823662689037894645226208583 x<order:false
The code is just doing some modular computations with fp, where p is initialized to the prime p=21888242871839275222246405745257275088696311157297823662689037894645226208583
of the bn254 curve.
The issue is that each output of fp.mul/add/sqrt should be than p, Instead I get values larger than p.
Isn't that incorrect?
(Btw, this should be the code for a hash to point function for bn254 that uses the basic hash and pray approach.)
The text was updated successfully, but these errors were encountered: