Skip to content

Implement circuit#2

Open
simonbc wants to merge 1 commit intoZKCamp:mainfrom
simonbc:solution
Open

Implement circuit#2
simonbc wants to merge 1 commit intoZKCamp:mainfrom
simonbc:solution

Conversation

@simonbc
Copy link

@simonbc simonbc commented Aug 19, 2023

No description provided.

Copy link
Contributor

@shubham-kanodia shubham-kanodia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assignment looks good, left a feedback comment

pub_key_y[i] = pub_key[i+32];
}

let address: Field = ecrecover::ecrecover(pub_key_x, pub_key_y, signature, hashed_message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use from_unified for key conversion like this:

let key = ecrecover::secp256k1::PubKey::from_unified(pub_key);
let address = ecrecover::ecrecover(key.pub_x, key.pub_y, signature, hashed_message);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants