Skip to content

Commit

Permalink
autogenerate tinyfield arithmetic (#424)
Browse files Browse the repository at this point in the history
* feat: auto generate tiny field

* fix: update toBigInt interface for conversion element - big int

* fix: revert previous commit
  • Loading branch information
gbotrel authored Dec 20, 2022
1 parent 908eb80 commit b3778b3
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 256 deletions.
11 changes: 11 additions & 0 deletions internal/generator/backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"sync"

"github.com/consensys/bavard"
"github.com/consensys/gnark-crypto/field/generator"
"github.com/consensys/gnark-crypto/field/generator/config"
)

const copyrightHolder = "ConsenSys Software Inc."
Expand Down Expand Up @@ -66,6 +68,15 @@ func main() {
noBackend: true,
}

// autogenerate tinyfield
tinyfieldConf, err := config.NewFieldConfig("tinyfield", "Element", "0x2f", false)
if err != nil {
panic(err)
}
if err := generator.GenerateFF(tinyfieldConf, tiny_field.RootPath); err != nil {
panic(err)
}

datas := []templateData{
bls12_377,
bls12_381,
Expand Down
30 changes: 30 additions & 0 deletions internal/tinyfield/arith.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3778b3

Please sign in to comment.