|
1 | | -import { Field, Provable, Gadgets, ZkProgram } from 'o1js'; |
| 1 | +import { Field, Gadgets, Provable, ZkProgram } from 'o1js'; |
2 | 2 | import { Performance } from '../../lib/testing/perf-regression.js'; |
3 | 3 |
|
4 | 4 | let cs = await Provable.constraintSystem(() => { |
@@ -69,14 +69,26 @@ console.log('\nproving..'); |
69 | 69 | perfBitwise.start('prove', 'rot'); |
70 | 70 | let { proof: rotProof } = await BitwiseProver.rot(); |
71 | 71 | perfBitwise.end(); |
72 | | -if (!(await BitwiseProver.verify(rotProof))) throw Error('rot: Invalid proof'); |
| 72 | + |
| 73 | +perfBitwise.start('verify', 'rot'); |
| 74 | +const isValidRot = await BitwiseProver.verify(rotProof); |
| 75 | +perfBitwise.end(); |
| 76 | +if (!isValidRot) throw Error('rot: Invalid proof'); |
73 | 77 |
|
74 | 78 | perfBitwise.start('prove', 'xor'); |
75 | 79 | let { proof: xorProof } = await BitwiseProver.xor(); |
76 | 80 | perfBitwise.end(); |
77 | | -if (!(await BitwiseProver.verify(xorProof))) throw Error('xor: Invalid proof'); |
| 81 | + |
| 82 | +perfBitwise.start('verify', 'xor'); |
| 83 | +const isValidXor = await BitwiseProver.verify(xorProof); |
| 84 | +perfBitwise.end(); |
| 85 | +if (!isValidXor) throw Error('xor: Invalid proof'); |
78 | 86 |
|
79 | 87 | perfBitwise.start('prove', 'and'); |
80 | 88 | let { proof: andProof } = await BitwiseProver.and(); |
81 | 89 | perfBitwise.end(); |
82 | | -if (!(await BitwiseProver.verify(andProof))) throw Error('and: Invalid proof'); |
| 90 | + |
| 91 | +perfBitwise.start('verify', 'and'); |
| 92 | +const isValidAnd = await BitwiseProver.verify(andProof); |
| 93 | +perfBitwise.end(); |
| 94 | +if (!isValidAnd) throw Error('and: Invalid proof'); |
0 commit comments