Skip to content

Commit d434ade

Browse files
committed
fix: use log.Printf
fix: typo
1 parent ab166e8 commit d434ade

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

crates/batcher/verifiers_ffi/verifier.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,24 @@ func VerifyCircomGroth16ProofBN128(proofBytesRef C.ListRef, pubInputBytesRef C.L
125125
proofBytes := listRefToBytes(proofBytesRef)
126126
pubInputBytes := listRefToBytes(pubInputBytesRef)
127127
verificationKeyBytes := listRefToBytes(verificationKeyBytesRef)
128-
print("FFI proofBytes: ", unsafe.Pointer(proofBytesRef.ptr), " len: ", len(proofBytes))
129-
print("FFI pubInputBytes: ", unsafe.Pointer(pubInputBytesRef.ptr), " len: ", len(pubInputBytes))
130-
print("FFI verificationKeyBytes: ", unsafe.Pointer(verificationKeyBytesRef.ptr), " len: ", len(verificationKeyBytes))
131128

132129
proof, err := parsers.ParseProof(proofBytes)
133130
if err != nil {
134-
print("FFI ParseProof error: ", err)
131+
log.Printf("Could not parse proof: %v", err)
135132
return false
136133
}
134+
137135
public, err := parsers.ParsePublicSignals(pubInputBytes)
138136
if err != nil {
139-
print("FFI ParsePublicSignals error: ", err)
137+
log.Printf("Could not parse public signals: %v", err)
140138
return false
141139
}
140+
142141
vk, err := parsers.ParseVk(verificationKeyBytes)
143142
if err != nil {
144-
print("FFI ParseVk error: ", err)
143+
log.Printf("Could not parse verification key: %v", err)
145144
return false
146145
}
147146

148-
is_valid := verifier.Verify(vk, proof, public)
149-
print("FFI is_valid: ", is_valid)
150-
return is_valid
147+
return verifier.Verify(vk, proof, public)
151148
}

scripts/test_files/circom_groth16_bn128_script/generate_proof.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
circom --r1cs --wasm --c --sym --inspect circuit.circom
77
# 11. View information about the circuit
88
snarkjs r1cs info circuit.r1cs
9-
# 12. Print the constraints [ommitted]
9+
# 12. Print the constraints [omitted]
1010
# 13. Export r1cs to json
1111
snarkjs r1cs export json circuit.r1cs circuit.r1cs.json
1212
# 14. Calculate the witness

0 commit comments

Comments
 (0)