github.com/consensys/gnark-crypto@v0.14.0/internal/generator/ecdsa/generate.go (about) 1 package ecdsa 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 // ecdsa 12 conf.Package = "ecdsa" 13 baseDir = filepath.Join(baseDir, conf.Package) 14 15 entries := []bavard.Entry{ 16 {File: filepath.Join(baseDir, "doc.go"), Templates: []string{"doc.go.tmpl"}}, 17 {File: filepath.Join(baseDir, "ecdsa.go"), Templates: []string{"ecdsa.go.tmpl"}}, 18 {File: filepath.Join(baseDir, "ecdsa_test.go"), Templates: []string{"ecdsa.test.go.tmpl"}}, 19 {File: filepath.Join(baseDir, "marshal.go"), Templates: []string{"marshal.go.tmpl"}}, 20 {File: filepath.Join(baseDir, "marshal_test.go"), Templates: []string{"marshal.test.go.tmpl"}}, 21 } 22 return bgen.Generate(conf, conf.Package, "./ecdsa/template", entries...) 23 24 }