mirror of
https://github.com/arnaucube/circomlib.git
synced 2026-02-06 18:56:43 +01:00
Poseidon for t=3
This commit is contained in:
@@ -36,6 +36,8 @@ exports.getMatrix = (t, seed, nRounds) => {
|
||||
if (typeof seed === "undefined") seed = SEED;
|
||||
if (typeof nRounds === "undefined") nRounds = NROUNDSF + NROUNDSP;
|
||||
if (typeof t === "undefined") t = T;
|
||||
assert(t<=6); // Force the same matrix for all.
|
||||
t=6;
|
||||
let nonce = "0000";
|
||||
let cmatrix = getPseudoRandom(seed+"_matrix_"+nonce, t*2);
|
||||
while (!allDifferent(cmatrix)) {
|
||||
|
||||
@@ -121,7 +121,7 @@ function createCode(t, nRoundsF, nRoundsP, seed) {
|
||||
// We ignore the pointer and the length and just load 6 values to the state
|
||||
// (Stack positions 0-5) If the array is shorter, we just set zeros.
|
||||
for (let i=0; i<t; i++) {
|
||||
C.push(0x44+(0x20*(5-i)));
|
||||
C.push(0x44+(0x20*(t-1-i)));
|
||||
C.calldataload();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user