update safe circuit (circuit2) code

fix safe circuit
This commit is contained in:
mmagician
2024-07-13 17:42:11 +02:00
parent 021c269051
commit 44eae794cb
4 changed files with 153 additions and 3 deletions

View File

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

Binary file not shown.

View File

@@ -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
test-vectors/safe-circuit.sh Executable file
View File

@@ -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