Browse Source

update safe circuit (circuit2) code

fix safe circuit
pull/4/head
mmagician 4 months ago
parent
commit
44eae794cb
No known key found for this signature in database GPG Key ID: BDEF1AAE14CCE516
4 changed files with 153 additions and 3 deletions
  1. +4
    -2
      test-vectors/circuit2.circom
  2. BIN
      test-vectors/circuit2.wasm
  3. +134
    -1
      test-vectors/safe-circuit-witness.json
  4. +15
    -0
      test-vectors/safe-circuit.sh

+ 4
- 2
test-vectors/circuit2.circom

@ -1,3 +1,5 @@
pragma circom 2.0.0;
template CheckBits(n) { template CheckBits(n) {
signal input in; signal input in;
signal bits[n]; signal bits[n];
@ -15,8 +17,8 @@ template CheckBits(n) {
} }
template Multiplier(n) { template Multiplier(n) {
signal private input a;
signal private input b;
signal input a;
signal input b;
signal output c; signal output c;
signal inva; signal inva;
signal invb; signal invb;

BIN
test-vectors/circuit2.wasm


+ 134
- 1
test-vectors/safe-circuit-witness.json

@ -1 +1,134 @@
["1","33","3","11","10944121435919637611123202872628637544274182200208017171849102093287904247809","15321770010287492655572484021680092561983855080291224040588742930603065946932","1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","1","0","1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]
[
"1",
"33",
"3",
"11",
"10944121435919637611123202872628637544274182200208017171849102093287904247809",
"15321770010287492655572484021680092561983855080291224040588742930603065946932",
"1",
"1",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"1",
"1",
"0",
"1",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]

+ 15
- 0
test-vectors/safe-circuit.sh

@ -0,0 +1,15 @@
# run from within test-vectors dir
DIR="test-vectors"
if [ ! -d "$DIR" ]; then
echo "Directory $DIR does not exist. Please ensure you are running this script from the correct location."
exit 1
fi
cd "$DIR"
echo "compiling"
circom circuit2.circom --wasm
node circuit2_js/generate_witness.js circuit2_js/circuit2.wasm mycircuit-input1.json circuit2_js/witness.wtns
snarkjs wej circuit2_js/witness.wtns safe-circuit-witness.json

Loading…
Cancel
Save