Update mix to match reference implementation ver

Reference implementation: https://extgit.iaik.tugraz.at/krypto/hadeshash

Tested with `sage code/poseidonperm_x5_254_3.sage` for inputs:
`[1,2,0]`, equivalent to using `circomlib/poseidon.js` with inputs
`[1,2]`, both return as result
`11309872961022349216464221841186646423561022368884850929991258903497301047946`

Tested with `sage code/poseidonperm_x5_254_5.sage` for inputs:
`[1,2,3,4,0]`, equivalent to using `circomlib/poseidon.js` with inputs
`[1,2,3,4]`, both return as result
`18181515143627462196415302348515936346022476168236332098176009127325427112991`
This commit is contained in:
arnaucube
2020-12-25 13:48:09 +01:00
parent 5935ac69df
commit 58639462ea
5 changed files with 9 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ template Mix(t, M) {
for (var i=0; i<t; i++) {
lc = 0;
for (var j=0; j<t; j++) {
lc += M[j][i]*in[j];
lc += M[i][j]*in[j];
}
out[i] <== lc;
}