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

     1  package pairing
     2  
     3  import (
     4  	"path/filepath"
     5  	"strings"
     6  
     7  	"github.com/consensys/bavard"
     8  	"github.com/consensys/gnark-crypto/internal/generator/config"
     9  )
    10  
    11  func Generate(conf config.Curve, baseDir string, bgen *bavard.BatchGenerator) error {
    12  
    13  	packageName := strings.ReplaceAll(conf.Name, "-", "")
    14  	return bgen.Generate(conf, packageName, "./pairing/template", bavard.Entry{
    15  		File: filepath.Join(baseDir, "pairing_test.go"), Templates: []string{"tests/pairing.go.tmpl"},
    16  	})
    17  
    18  }