-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
tests/fuzzers: crypto/bn256 and crypto/bls12381 tests against gnark-crypto #22755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The renaming of bls_fuzzer.go
should be fine but the new fuzzer(s) need a corresponding update on https://github.com/ethereum/go-ethereum/blob/master/oss-fuzz.sh
Although, that doesn't really block this PR, could be done in a follow-up
github.com/Azure/azure-storage-blob-go v0.7.0 | ||
github.com/Azure/go-autorest/autorest/adal v0.8.0 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how these wound up here (and a few more similar).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the same, though, when I do a go mod tidy
, so it seems fine to me
kps := make([]*bls12381.PointG1, n) | ||
cps := make([]gnark.G1Affine, n) | ||
for i := 0; i < int(n); i++ { | ||
kps[i] = new(bls12381.PointG1).Set(kp1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer setting the G1 points to different points, not only to a single point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed that now -- it reads as many as it can (max 17), and uses those, and does not use the n
I pushed the changes to the oss-fuzz script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @gbotrel ! |
…rypto (ethereum#22755) Add more cross-fuzzers to fuzz bls with gnark versus geth's own bls12-381 library
This PR is a follow up to #21812 .
gurvy/bn256
package name changed tognark-crypto/ecc/bn254
in
FuzzPair
test:replaces
PairingCheck
comparaisons across libraries with the actual output of the pairing function (Pair
).PairingCheck
of random points will almost always outputfalse
.adds similar tests for
crypto/bls12381
, againstgnark-crypto/ecc/bls12381
Notes about
crypto/bls12381
/MultiExp
function:defined here
MultiExp(r *PointG1, points []*PointG1, powers []*big.Int)
powers
slice and sets all its element to zero after a callpowers
slice elements arebig.Int
, but providing larger than 32bytes inputs make this function return an incorrect result. It is only referenced here ingeth
, which can't provide inputs larger than 32bytes. However, ascrypto/bls12381
is a public package, I think this issue deserves some attention.