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

     1  package permutation
     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  	// permutation data
    13  	conf.Package = "permutation"
    14  	entries := []bavard.Entry{
    15  		{File: filepath.Join(baseDir, "doc.go"), Templates: []string{"doc.go.tmpl"}},
    16  		{File: filepath.Join(baseDir, "permutation.go"), Templates: []string{"permutation.go.tmpl"}},
    17  		{File: filepath.Join(baseDir, "permutation_test.go"), Templates: []string{"permutation.test.go.tmpl"}},
    18  	}
    19  	return bgen.Generate(conf, conf.Package, "./permutation/template/", entries...)
    20  
    21  }