Allow full poseidnon fix handle enable in the sigposeidon
This commit is contained in:
parent
f9e0484663
commit
29e162383d
@ -47,7 +47,7 @@ template EdDSAPoseidonVerifier() {
|
||||
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 @@ template EdDSAPoseidonVerifier() {
|
||||
// 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++) {
|
||||
|
2
index.js
2
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");
|
||||
|
@ -95,7 +95,7 @@ exports.createHash = (t, nRoundsF, nRoundsP, seed) => {
|
||||
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;
|
||||
|
@ -309,3 +309,4 @@ async function newMemEmptyTrie() {
|
||||
|
||||
module.exports.loadFromFile = loadFromFile;
|
||||
module.exports.newMemEmptyTrie = newMemEmptyTrie;
|
||||
module.exports.SMT = SMT;
|
||||
|
Loading…
Reference in New Issue
Block a user