Skip to content

Commit

Permalink
sign choice rather than gov id => protocol fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas089 committed May 25, 2024
1 parent 04c67e9 commit d69ec5d
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ pub fn run(cli: Cli) {
)
.expect("");
let public_identity = Signature::from_slice(&verified_user.public_identity).expect("");

#[cfg(feature = "groth16")]
let SUBMIT_TO_LAYER_ONE = "CALL_TO_GROTH_16";
// todo: generate an optimized groth16 wrapper proof and submit it to ETH
5 changes: 1 addition & 4 deletions client/src/prover.rs
Original file line number Diff line number Diff line change
@@ -24,10 +24,7 @@ pub fn prove(
.to_bytes()
.to_vec();
let unique_session_signature: Signature = user_secret_key.sign(
&government_public_key
.to_encoded_point(true)
.to_bytes()
.to_vec(),
&choice.as_bytes().to_vec()
);
let circuit_inputs: CircuitInputs = CircuitInputs {
choice: choice.to_string(),
2 changes: 1 addition & 1 deletion methods/guest/src/main.rs
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ fn main() {

user_public_key
.verify(
&circuit_inputs.government_public_key,
&choice.as_bytes().to_vec(),
&circuit_inputs.session_signature,
)
.expect("Failed to verify session signature");

0 comments on commit d69ec5d

Please sign in to comment.