From da072fa5b2a140bf87baf4fe4ce02d9e652f0b89 Mon Sep 17 00:00:00 2001 From: Oleksandr Brezhniev Date: Fri, 12 Apr 2024 01:01:22 +0100 Subject: [PATCH] Small fixes --- circuits/lib/utils/claimUtils.circom | 2 +- circuits/lib/utils/idUtils.circom | 3 +++ circuits/onchain/credentialAtomicQueryV3OnChain.circom | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/circuits/lib/utils/claimUtils.circom b/circuits/lib/utils/claimUtils.circom index 8ec4166..8349210 100644 --- a/circuits/lib/utils/claimUtils.circom +++ b/circuits/lib/utils/claimUtils.circom @@ -286,7 +286,7 @@ template getValueByIndex(){ value <== mux.out; } -// verify that the claim has expiration time and it is less then timestamp +// verify that provided timestamp is less than claim expiration time template verifyExpirationTime() { signal input {binary} expirationFlag; // claimFlags[3] (expiration flag) is set signal input claim[8]; diff --git a/circuits/lib/utils/idUtils.circom b/circuits/lib/utils/idUtils.circom index 51e1d0c..81e9abe 100644 --- a/circuits/lib/utils/idUtils.circom +++ b/circuits/lib/utils/idUtils.circom @@ -102,6 +102,9 @@ template GatherID() { template TakeNBits(n) { signal input in; signal output out; + + assert(n <= 254); + // We take only n least significant bits from 254 bit number. component bits = Num2Bits_strict(); bits.in <== in; diff --git a/circuits/onchain/credentialAtomicQueryV3OnChain.circom b/circuits/onchain/credentialAtomicQueryV3OnChain.circom index 92548df..a008d56 100644 --- a/circuits/onchain/credentialAtomicQueryV3OnChain.circom +++ b/circuits/onchain/credentialAtomicQueryV3OnChain.circom @@ -29,7 +29,6 @@ issuerLevels - Merkle tree depth level for claims issued by the issuer claimLevels - Merkle tree depth level for claim JSON-LD document maxValueArraySize - Number of elements in comparison array for in/notin operation if level = 3 number of values for comparison ["1", "2", "3"] -idOwnershipLevels - Merkle tree depth level for personal claims onChainLevels - Merkle tree depth level for Auth claim on-chain */ template credentialAtomicQueryV3OnChain(issuerLevels, claimLevels, maxValueArraySize, idOwnershipLevels, onChainLevels) {