arnaucube
arnaucube/circomlibPublic Self-hosted repository
Allow full poseidnon fix handle enable in the sigposeidon
Jordi Baylina jordi@baylina.cat
Sat, 07 Sep 2019 20:22:44 +0200
commit

29e162383df709c2902a7454ef074fc8844ea13d

parent

f9e048466356cbdcfdf1d30eb192cae2eb1c3cd0

4 files changed, 6 insertions(+), 3 deletions(-)

jump to
M circuits/eddsaposeidon.circom → circuits/eddsaposeidon.circom

@@ -47,7 +47,7 @@ for (i=0; i<253; i++) {

snum2bits.out[i] ==> compConstant.in[i]; } compConstant.in[253] <== 0; - compConstant.out === 0; + compConstant.out*enabled === 0; // Calculate the h = H(R,A, msg)

@@ -79,7 +79,7 @@

// We check that A is not zero. component isZero = IsZero(); isZero.in <== dbl3.x; - isZero.out === 0; + isZero.out*enabled === 0; component mulAny = EscalarMulAny(254); for (i=0; i<254; i++) {
M index.js → index.js

@@ -4,3 +4,5 @@ exports.mimc7 = require("./src/mimc7");

exports.mimcsponge = require("./src/mimcsponge"); exports.babyJub = require("./src/babyjub"); exports.pedersenHash = require("./src/pedersenHash"); +exports.SMT = require("./src/smt"); +exports.poseidon = require("./src/poseidon");
M src/poseidon.js → src/poseidon.js

@@ -95,7 +95,7 @@ const C = exports.getConstants(t, seed, nRoundsF + nRoundsP);

const M = exports.getMatrix(t, seed, nRoundsF + nRoundsP); return function(inputs) { let state = []; - assert(inputs.length < t); + assert(inputs.length <= t); assert(inputs.length > 0); for (let i=0; i<inputs.length; i++) state[i] = bigInt(inputs[i]); for (let i=inputs.length; i<t; i++) state[i] = F.zero;
M src/smt.js → src/smt.js

@@ -309,3 +309,4 @@ }

module.exports.loadFromFile = loadFromFile; module.exports.newMemEmptyTrie = newMemEmptyTrie; +module.exports.SMT = SMT;