mirror of
https://github.com/arnaucube/circomlib.git
synced 2026-02-07 03:06:44 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user