github.com/consensys/gnark-crypto@v0.14.0/internal/generator/pedersen/generate.go (about) 1 package pedersen 2 3 import ( 4 "path/filepath" 5 6 "github.com/consensys/bavard" 7 "github.com/consensys/gnark-crypto/internal/generator/config" 8 ) 9 10 func Generate(conf config.Curve, baseDir string, bgen *bavard.BatchGenerator) error { 11 12 // pedersen commitment scheme 13 conf.Package = "pedersen" 14 entries := []bavard.Entry{ 15 {File: filepath.Join(baseDir, "doc.go"), Templates: []string{"doc.go.tmpl"}}, 16 {File: filepath.Join(baseDir, "pedersen.go"), Templates: []string{"pedersen.go.tmpl"}}, 17 {File: filepath.Join(baseDir, "pedersen_test.go"), Templates: []string{"pedersen.test.go.tmpl"}}, 18 {File: filepath.Join(baseDir, "example_test.go"), Templates: []string{"example_test.go.tmpl"}}, 19 } 20 return bgen.Generate(conf, conf.Package, "./pedersen/template/", entries...) 21 22 }