Last active
April 19, 2023 19:05
-
-
Save TanjinAlam/4b5c05b6e2eabb4235dee2d3df6766ad to your computer and use it in GitHub Desktop.
zkp-factor of 9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma circom 2.0.0; | |
include "/usr/local/lib/node_modules/circomlib/circuits/comparators.circom"; | |
template FactorCircuit() { | |
signal input a; | |
signal output isFactor; | |
// Constraint to ensure that a are factors of 9 | |
signal temp; | |
temp <-- 9 % a; | |
// Output true if a factors of 9, false otherwise | |
isFactor <== IsZero()(temp); | |
} | |
component main = FactorCircuit(); | |
// Result of the output where a is the user input | |
const res = await snarkjs.groth16.verify(vkey, [a], proof); | |
res always return false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment