Skip to content

Commit

Permalink
Fix invalid proofs for > 2^15
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfelder committed Apr 28, 2024
1 parent 5b8506f commit 89c49e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/groth16/bn254/icicle/icicle.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (pk *ProvingKey) setupDevicePointers() error {
copy(pk.CosetGenerator[:], limbs[:fr.Limbs*2])
var rouIcicle icicle_bn254.ScalarField
rouIcicle.FromLimbs(limbs)
e := icicle_ntt.InitDomain(rouIcicle, ctx, false)
e := icicle_ntt.InitDomain(rouIcicle, ctx, true)
if e.IcicleErrorCode != icicle_core.IcicleSuccess {
panic("Couldn't initialize domain") // TODO
}
Expand Down Expand Up @@ -520,6 +520,7 @@ func computeH(a, b, c []fr.Element, pk *ProvingKey, log zerolog.Logger) icicle_c
var scalarsDevice icicle_core.DeviceSlice
scalarsHost.CopyToDeviceAsync(&scalarsDevice, scalarsStream, true)
start := time.Now()
cfg.NttAlgorithm = icicle_core.Radix2
icicle_ntt.Ntt(scalarsDevice, icicle_core.KInverse, &cfg, scalarsDevice)
cfg.Ordering = icicle_core.KMN
cfg.CosetGen = pk.CosetGenerator
Expand Down Expand Up @@ -550,6 +551,7 @@ func computeH(a, b, c []fr.Element, pk *ProvingKey, log zerolog.Logger) icicle_c
cfg := icicle_ntt.GetDefaultNttConfig()
cfg.CosetGen = pk.CosetGenerator
cfg.Ordering = icicle_core.KNM
cfg.NttAlgorithm = icicle_core.Radix2
start = time.Now()
icicle_ntt.Ntt(aDevice, icicle_core.KInverse, &cfg, aDevice)
log.Debug().Dur("took", time.Since(start)).Msg("computeH: INTT final")
Expand Down

0 comments on commit 89c49e4

Please sign in to comment.