Skip to content

Commit

Permalink
Add one more test vector for TestHashWithState
Browse files Browse the repository at this point in the history
  • Loading branch information
OBrezhniev committed Feb 16, 2024
1 parent 36c5a14 commit fb1d252
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions poseidon/poseidon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ func TestHashWithState(t *testing.T) {
b4 := big.NewInt(4)
b5 := big.NewInt(5)
b6 := big.NewInt(6)
b7 := big.NewInt(7)
b8 := big.NewInt(8)
b9 := big.NewInt(9)
b10 := big.NewInt(10)
b11 := big.NewInt(11)
b12 := big.NewInt(12)
b13 := big.NewInt(13)
b14 := big.NewInt(14)
b15 := big.NewInt(15)
b16 := big.NewInt(16)
b17 := big.NewInt(17)

h, err := HashWithState([]*big.Int{b1, b2, b3, b4, b5, b6}, initState0)
assert.Nil(t, err)
Expand All @@ -150,6 +161,12 @@ func TestHashWithState(t *testing.T) {
assert.Equal(t,
"1569211601569591254857354699102545060324851338714426496554851741114291465006",
h.String())

h, err = HashWithState([]*big.Int{b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16}, b17)
assert.Nil(t, err)
assert.Equal(t,
"7865037705064445207187340054656830232157001572238023180016026650118519857086",
h.String())
}

func TestInitStateNotInField(t *testing.T) {
Expand Down

0 comments on commit fb1d252

Please sign in to comment.