From 7c16ea34c73a36a951df39b8b405c32bff674413 Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Wed, 6 Oct 2021 14:52:16 +0200 Subject: [PATCH] Fix limit in poseidon --- src/poseidon.js | 2 +- src/poseidon_slow.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/poseidon.js b/src/poseidon.js index d1f1c3f..a5617ca 100644 --- a/src/poseidon.js +++ b/src/poseidon.js @@ -20,7 +20,7 @@ const pow5 = a => F.mul(a, F.square(F.square(a, a))); function poseidon(inputs) { assert(inputs.length > 0); - assert(inputs.length < N_ROUNDS_P.length - 1); + assert(inputs.length <= N_ROUNDS_P.length); const t = inputs.length + 1; const nRoundsF = N_ROUNDS_F; diff --git a/src/poseidon_slow.js b/src/poseidon_slow.js index c4f78fa..89a21ce 100644 --- a/src/poseidon_slow.js +++ b/src/poseidon_slow.js @@ -20,7 +20,7 @@ const pow5 = a => F.mul(a, F.square(F.square(a, a))); function poseidon(inputs) { assert(inputs.length > 0); - assert(inputs.length < N_ROUNDS_P.length - 1); + assert(inputs.length <= N_ROUNDS_P.length); const t = inputs.length + 1; const nRoundsF = N_ROUNDS_F;