Skip to content

Commit

Permalink
poseidon_native: introduce package from tree_test.go
Browse files Browse the repository at this point in the history
Turn tree_test.go into a separate package called poseidon_native. This
package holds an implementation of the out-of-circuit poseidon tree.
To distinguish it from the in-circuit implementation in the poseidon
package, the _native suffix is added.

Signed-off-by: Wojciech Zmuda <[email protected]>
  • Loading branch information
wzmuda committed Jun 20, 2024
1 parent 95aa6a3 commit 087d2e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import (
"math/big"
"os"
"os/signal"

"worldcoin/gnark-mbu/logging"
poseidon "worldcoin/gnark-mbu/poseidon_native"
"worldcoin/gnark-mbu/prover"
"worldcoin/gnark-mbu/server"

Expand Down Expand Up @@ -226,7 +228,7 @@ func main() {

if mode == server.InsertionMode {
params := prover.InsertionParameters{}
tree := NewTree(treeDepth)
tree := poseidon.NewTree(treeDepth)

params.StartIndex = 0
params.PreRoot = tree.Root()
Expand All @@ -241,7 +243,7 @@ func main() {
r, err = json.Marshal(&params)
} else if mode == server.DeletionMode {
params := prover.DeletionParameters{}
tree := NewTree(treeDepth)
tree := poseidon.NewTree(treeDepth)

params.DeletionIndices = make([]uint32, batchSize)
params.IdComms = make([]big.Int, batchSize)
Expand Down
5 changes: 3 additions & 2 deletions test_tree.go → poseidon_native/poseidon_native.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main
package poseidon_native

import (
"github.com/iden3/go-iden3-crypto/poseidon"
"math/big"

"github.com/iden3/go-iden3-crypto/poseidon"
)

type PoseidonNode interface {
Expand Down

0 comments on commit 087d2e9

Please sign in to comment.