github.com/consensys/gnark-crypto@v0.14.0/internal/generator/edwards/generate.go (about)

     1  package edwards
     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.TwistedEdwardsCurve, baseDir string, bgen *bavard.BatchGenerator) error {
    11  	entries := []bavard.Entry{
    12  		{File: filepath.Join(baseDir, "point.go"), Templates: []string{"point.go.tmpl"}},
    13  		{File: filepath.Join(baseDir, "point_test.go"), Templates: []string{"tests/point.go.tmpl"}},
    14  		{File: filepath.Join(baseDir, "doc.go"), Templates: []string{"doc.go.tmpl"}},
    15  		{File: filepath.Join(baseDir, "curve.go"), Templates: []string{"curve.go.tmpl"}},
    16  	}
    17  
    18  	return bgen.Generate(conf, conf.Package, "./edwards/template", entries...)
    19  }