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

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