Hello! I am in the process of writing some ZK circuits using the Circom language.
I am having some trouble with finding the modulus of a signal.
Circom will not let you directly find a modulus such as:
signal try1 <== inSignal % modulo
because this is a non-quadratic constraint.
I have also tried the algabraic method:
var quotient = in \ modulo; var remainder = in - (quotient * modulo); signal try2 <== remainder;
but every time i try this, i can generate a proof, but the proof is somehow invalid. Every time i try to verify a proof using the algabraic method, the proof fails verification.
As a last-ditch effort, i have tried combining the methods such as
signal out <-- try1; out === try2;
but I still get the same error as in the second code-snippet attempt
ANY insight here would be greatly appreciated
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments