structs and challenges

This commit is contained in:
jtguibas
2022-10-10 17:22:02 -07:00
parent 34cecba095
commit 7367106b04
3 changed files with 212 additions and 87 deletions

View File

@@ -1,9 +1,11 @@
package utils
import (
. "gnark-ed25519/goldilocks"
"math/big"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/std/math/emulated"
)
func StrArrayToBigIntArray(input []string) []big.Int {
@@ -23,3 +25,11 @@ func StrArrayToFrontendVariableArray(input []string) []frontend.Variable {
}
return output
}
func Uint64ArrayToGoldilocksElementArray(input []uint64) []GoldilocksElement {
var output []GoldilocksElement
for i := 0; i < len(input); i++ {
output = append(output, emulated.NewElement[emulated.Goldilocks](input[i]))
}
return output
}