Closed vincenzoiovino closed 8 months ago
the bn254's parameter p=21888242871839275222246405745257275088696311157297823662689037894645226208583.
The parameter is for SNARK, so would you mind using mcl.BN_SNARK1
instead of BN254
?
Dear herumi, thanks. Indeed, I had already catched that last night. It is a bit odd since other libraries call "bn254" what you call BN_SNARK1 but you also keep the name bn254 for other parameters. Thanks for all.
It is a bit odd since other libraries call "bn254" what you call BN_SNARK1 but you also keep the name bn254 for other parameters.
The predecessor of mcl, ate-pairing, was developed in 2010, and zk-SNARK was proposed later. I have not changed the name for backward compatibility of my library.
Hello, I have some code like the following for the bn254 curve:
var X=new mcl.Fp(); X.setStr(value,16);
where value is (for example): 2da8ca028125cebef6bc48526cd30b4d617dac593d0cbfa37703b6795d0db846
These strings are computed by other libraries (the noble crypto library so they are valid x points for which there exists a y that satisfies the bn254 equation) so they should be correct. And indeed that number in decimal is 20652302713412539842691404244404811285268574088401948238856379421925240059974 and I verified that is less than the bn254's parameter p=21888242871839275222246405745257275088696311157297823662689037894645226208583. However, I get the following error: err _wrapInput
I do not get this error when the hex strings start with 1. Did I miss something?