Skip to content

Conversation

@oleganza
Copy link
Collaborator

This adds RandomOracle class that uses Keccak sponge construction to efficiently switch between sending messages (commit()) and receiving responses (challenge()).

/// Sends a message to a random oracle.
/// Each message must be less than 256 bytes long.
pub fn commit(&mut self, message: &[u8]) {
match self.state {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be cleaner if it were factored out into a change_state function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done! added set_state(newstate) helper.

Copy link
Contributor

@hdevalence hdevalence left a comment

Choose a reason for hiding this comment

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

LGTM

@hdevalence hdevalence merged commit 8e4aa76 into master Feb 12, 2018
@oleganza oleganza deleted the feature/randomoracle branch February 13, 2018 21:21
hansieodendaal pushed a commit to hansieodendaal/bulletproofs that referenced this pull request Mar 4, 2021
ryankurte pushed a commit to ryankurte/bulletproofs that referenced this pull request Jan 4, 2023
Update digest, hex, sha3 and curve25519-dalek dependencies
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.

3 participants