Skip to content

Instantly share code, notes, and snippets.

@TanjinAlam
Last active April 19, 2023 19:05
Show Gist options
  • Save TanjinAlam/4b5c05b6e2eabb4235dee2d3df6766ad to your computer and use it in GitHub Desktop.
Save TanjinAlam/4b5c05b6e2eabb4235dee2d3df6766ad to your computer and use it in GitHub Desktop.
zkp-factor of 9
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