Update Poseidon last changes of the reference impl

Update Poseidon to last changes of the reference implementation from
26ddaa91db

Compatible with update at circomlib
(cf853c1cc9)
This commit is contained in:
arnaucube
2021-03-08 14:57:57 +01:00
parent 58e589b6eb
commit 590573a0af
3 changed files with 14 additions and 16 deletions

View File

@@ -25,24 +25,24 @@ func TestPoseidonHash(t *testing.T) {
h, err := Hash([]*big.Int{b1})
assert.Nil(t, err)
assert.Equal(t,
"11043376183861534927536506085090418075369306574649619885724436265926427398571",
"18586133768512220936620570745912940619677854269274689475585506675881198879027",
h.String())
h, err = Hash([]*big.Int{b1, b2})
assert.Nil(t, err)
assert.Equal(t,
"17117985411748610629288516079940078114952304104811071254131751175361957805920",
"7853200120776062878684798364095072458815029376092732009249414926327459813530",
h.String())
h, err = Hash([]*big.Int{b1, b2, b0, b0, b0})
assert.Nil(t, err)
assert.Equal(t,
"3975478831357328722254985704342968745327876719981393787143845259590563829094",
"1018317224307729531995786483840663576608797660851238720571059489595066344487",
h.String())
h, err = Hash([]*big.Int{b1, b2, b0, b0, b0, b0})
assert.Nil(t, err)
assert.Equal(t,
"19772360636270345724087386688434825760738403416279047262510528378903625000110",
"15336558801450556532856248569924170992202208561737609669134139141992924267169",
h.String())
b3 := big.NewInt(3)
@@ -50,12 +50,12 @@ func TestPoseidonHash(t *testing.T) {
h, err = Hash([]*big.Int{b3, b4, b0, b0, b0})
assert.Nil(t, err)
assert.Equal(t,
"3181200837746671699652342497997860344148947482942465819251904554707352676086",
"5811595552068139067952687508729883632420015185677766880877743348592482390548",
h.String())
h, err = Hash([]*big.Int{b3, b4, b0, b0, b0, b0})
assert.Nil(t, err)
assert.Equal(t,
"8386348873272147968934270337233829407378789978142456170950021426339096575008",
"12263118664590987767234828103155242843640892839966517009184493198782366909018",
h.String())
b5 := big.NewInt(5)
@@ -63,7 +63,7 @@ func TestPoseidonHash(t *testing.T) {
h, err = Hash([]*big.Int{b1, b2, b3, b4, b5, b6})
assert.Nil(t, err)
assert.Equal(t,
"5202465217520500374834597824465244016759843635092906214933648999760272616044",
"20400040500897583745843009878988256314335038853985262692600694741116813247201",
h.String())
}