From b40dfa63b7b1248527d7ab417d0d9cf538cad93a Mon Sep 17 00:00:00 2001 From: Magamedrasul Ibragimov Date: Thu, 25 May 2023 18:46:36 +0400 Subject: [PATCH] refactor: update rangecheck template --- circuits/rln.circom | 3 +-- circuits/utils.circom | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/circuits/rln.circom b/circuits/rln.circom index 2d521c5..7d1939b 100644 --- a/circuits/rln.circom +++ b/circuits/rln.circom @@ -27,8 +27,7 @@ template RLN(DEPTH, LIMIT_BIT_SIZE) { root <== MerkleTreeInclusionProof(DEPTH)(rateCommitment, identityPathIndex, pathElements); // messageId range check - signal rangeCheck <== RangeCheck(LIMIT_BIT_SIZE)(messageId, userMessageLimit); - rangeCheck === 1; + RangeCheck(LIMIT_BIT_SIZE)(messageId, userMessageLimit); // SSS share calculations signal a1 <== Poseidon(3)([identitySecret, externalNullifier, messageId]); diff --git a/circuits/utils.circom b/circuits/utils.circom index 4bb99d2..f9c76de 100644 --- a/circuits/utils.circom +++ b/circuits/utils.circom @@ -39,8 +39,7 @@ template RangeCheck(LIMIT_BIT_SIZE) { signal input messageId; signal input limit; - signal output rangeCheck; - signal bitCheck[LIMIT_BIT_SIZE] <== Num2Bits(LIMIT_BIT_SIZE)(messageId); - rangeCheck <== LessThan(LIMIT_BIT_SIZE)([messageId, limit]); + signal rangeCheck <== LessThan(LIMIT_BIT_SIZE)([messageId, limit]); + rangeCheck === 1; } \ No newline at end of file