You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I apologize for disturbing you. I am a beginner using gnark. I wrote a test function for the Eddsa proof.
func Prove() {
// compiles our circuit into a R1CS
var circuit eddsaCircuit
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
fmt.Println("failed to Compile. error:", err)
return
}
// groth16 zkSNARK: Setup
pk, vk, err := groth16.Setup(ccs)
if err != nil {
fmt.Println("failed to Setup. error:", err)
return
}
witness, err := frontend.NewWitness(GetEddsaCircuit(), ecc.BN254.ScalarField())
if err != nil {
fmt.Println("failed to NewWitness. error:", err)
return
}
publicWitness, err := witness.Public()
if err != nil {
fmt.Println("failed to witness.Public. error:", err)
return
}
// groth16: Prove & Verify
proof, err := groth16.Prove(ccs, pk, witness)
if err != nil {
fmt.Println("failed to Prove. error:", err)
return
}
err = groth16.Verify(proof, vk, publicWitness)
if err != nil {
fmt.Println("Prove get invalid signature")
} else {
fmt.Println("Prove get valid signature")
}
}
Test results obtained:
But I am not very clear about the meanings of symbols in the DEBUG log and would like to obtain an official accurate answer.
I have the following questions:
1.Does constraint system solver done refers to groth16.Setup?
2.Does prover done refers to groth16.Prove?
3.Does verifier done refers to groth16.Verify?
4.Does took refers to the execution time of the function? Is the unit in ms?
The text was updated successfully, but these errors were encountered:
Thank you for your response. My further understanding is that if I want to obtain the execution time of the frontend.Compile function and the groth16.Setup function, I can only measure it by myself.
Hello, I apologize for disturbing you. I am a beginner using gnark. I wrote a test function for the Eddsa proof.
Test results obtained:
![Image](https://private-user-images.githubusercontent.com/171801951/410803154-1ab18aef-7b27-48e8-9571-559f5d908853.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTUwNzIsIm5iZiI6MTczOTE1NDc3MiwicGF0aCI6Ii8xNzE4MDE5NTEvNDEwODAzMTU0LTFhYjE4YWVmLTdiMjctNDhlOC05NTcxLTU1OWY1ZDkwODg1My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQwMjMyNTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03YjE0ODIxNmY0OGQ3Mjg5ZWI4NDA0Mjg1ZTI3N2I4M2FmZmE3Mzc1Njc3ZThiNzQ2NzlhN2E0YzIzM2I4ZmZjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.TbN_7zbZ_bvn_LE0CEHjoYwtkph1Bpjq0alIar5cvq4)
But I am not very clear about the meanings of symbols in the DEBUG log and would like to obtain an official accurate answer.
I have the following questions:
1.Does
constraint system solver done
refers togroth16.Setup
?2.Does
prover done
refers togroth16.Prove
?3.Does
verifier done
refers togroth16.Verify
?4.Does
took
refers to the execution time of the function? Is the unit inms
?The text was updated successfully, but these errors were encountered: