You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The provided IcicleCommit function does not seem to have the same output as the original Commit function. For example, adding the following test in ingonyama/gnark-crypto, in ecc/bn254/kzg/kzg_test.go:
funcTestVerifyIcicleCommit(t*testing.T) {
// create a polynomialf:=randomPolynomial(60)
varkzgIcicle iciclecore.DeviceSlice
(iciclecore.HostSlice[bn254.G1Affine])(testSrs.Pk.G1).CopyToDevice(&kzgIcicle, true)
// commit the polynomialdigest, err:=Commit(f, testSrs.Pk)
iferr!=nil {
t.Fatal(err)
}
icicle_digest:=IcicleCommit(f, kzgIcicle)
ifdigest!=icicle_digest {
t.Fatal("commits not equal")
}
}
And it fails with:
winston@winston-gpu-l4-x1:~/gnark-crypto$ go test -timeout 30s -run ^TestVerifyIcicleCommit$ github.com/consensys/gnark-crypto/ecc/bn254/kzg
--- FAIL: TestVerifyIcicleCommit (0.24s)
kzg_test.go:248: commits not equal
FAIL
FAIL github.com/consensys/gnark-crypto/ecc/bn254/kzg 0.319s
FAIL
Expected Behavior
Test should pass.
Actual Behavior
Test fails.
Possible Fix
Steps to Reproduce
Copy the given code to ingonyama/gnark-crypto, in ecc/bn254/kzg/kzg_test.go
Run the TestVerifyIcicleCommit test.
Context
We are trying to integrate the Icicle GPU backend for gnark, but ran into this issue.
Your Environment
gnark-crypto version used: HEAD@integrate-icicle
go version (e.g. 1.20.6): go1.22.3 linux/amd64
Operating System and version: Ubuntu 22.04.4 LTS
The text was updated successfully, but these errors were encountered:
I was able to reproduce the problem in the version I am working with
github.com/ingonyama-zk/icicle/v2 v2.0.0-20240624112314-26dbd224b43f
in icicle commit() there is a flag cfg.ArePointsMontgomeryForm which should be true. Since gnark uses Montgomery form for everything
when I added the flag explicitly inicicle commit() the flag cfg.ArePointsMontgomeryForm = true it passes the test.
@LeonHibnik , @jeremyfelder these commits iciclev2 used in both gnark and gnarl-crypto look very old, perhaps one should bump them to the latest version, also gnark and gnark crypto of ours is so many commits behind the original.
Our changes in gnark-crypto there were for a specific integration we did with plonk over bn254 where we convert the points from Montgomery during the setup in gnark here. We did this because the same points are reused throughout multiple MSMs and converting them on each MSM adds additional latency.
The ideal would be to add a cfg iciclemsm.MSMConfig parameter to the IcicleCommit signature in gnark-crypto allowing the caller to define how the MSM should interpret the data.
I hope this helps. If you have any other questions let us know, we are always happy to help!
Description
The provided
IcicleCommit
function does not seem to have the same output as the originalCommit
function. For example, adding the following test iningonyama/gnark-crypto
, inecc/bn254/kzg/kzg_test.go
:And it fails with:
Expected Behavior
Test should pass.
Actual Behavior
Test fails.
Possible Fix
Steps to Reproduce
ingonyama/gnark-crypto
, inecc/bn254/kzg/kzg_test.go
TestVerifyIcicleCommit
test.Context
We are trying to integrate the Icicle GPU backend for
gnark
, but ran into this issue.Your Environment
HEAD@integrate-icicle
The text was updated successfully, but these errors were encountered: