-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mpz-garble): pre-commit inputs #149
Conversation
OTS: OTSendEncoding<Ctx> + Send, | ||
OTR: OTReceiveEncoding<Ctx> + Send, | ||
{ | ||
let assigned = self.state().memory.drain_assigned(inputs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea to check here and return an error if the inputs
were not assigned prior to calling commit
and also for the 2 methods below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on our DMs, let's use the "commit if possible" approach. Then the check is not required. Let's add a clarifying comment here and in the 2 methods below like e.g.
///
/// If some of the values in `inputs` were committed earlier, this method will ignore them.
Ok(()) | ||
} | ||
|
||
/// Commits the provided values for verifying. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the comment may seem confusing since the verifier is not actually committing to anything, instead maybe
/// Commits the provided values for verifying. | |
/// Enables the prover to commit the provided values for verifying. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think of it more like a "database commit" instead of cryptographic commitment. The two parties have a shared virtual machine and are jointly committing values to its memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we should avoid leaking the VM impl details into the DEAP protocol API, if possible.
The person who follows the DEAP spec doc will be confused by the sudden overload of the term "commit", imo. To avoid the confusion, we need to explain the term "commit" from the cryptographic commitment pov.
0d39556
to
2a60cec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Feel free to address my comment suggestion as you deem best.
This PR exposes the ability to commit assigned values in memory.