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

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