Skip to content
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

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

sinui0
Copy link
Collaborator

@sinui0 sinui0 commented Jun 6, 2024

This PR exposes the ability to commit assigned values in memory.

@sinui0 sinui0 requested review from themighty1 and th4s June 6, 2024 15:14
OTS: OTSendEncoding<Ctx> + Send,
OTR: OTReceiveEncoding<Ctx> + Send,
{
let assigned = self.state().memory.drain_assigned(inputs);
Copy link
Collaborator

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

Copy link
Collaborator

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.
Copy link
Collaborator

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

Suggested change
/// Commits the provided values for verifying.
/// Enables the prover to commit the provided values for verifying.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

crates/mpz-garble/src/protocol/deap/mod.rs Show resolved Hide resolved
crates/mpz-garble/src/protocol/deap/mod.rs Show resolved Hide resolved
@themighty1 themighty1 self-requested a review June 12, 2024 07:20
Copy link
Collaborator

@themighty1 themighty1 left a 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.

@sinui0 sinui0 merged commit 33b8087 into threading-refactor Jun 12, 2024
@sinui0 sinui0 deleted the feat/mpz-garble-commit branch June 12, 2024 17:08
sinui0 added a commit that referenced this pull request Jun 25, 2024
* feat(mpz-garble): pre-commit inputs

* fix(mpz-garble): benchmark (#151)

* handle commit errors

* Revert "handle commit errors"

This reverts commit 983f968.

* add comment
sinui0 added a commit that referenced this pull request Jun 25, 2024
* feat(mpz-garble): pre-commit inputs

* fix(mpz-garble): benchmark (#151)

* handle commit errors

* Revert "handle commit errors"

This reverts commit 983f968.

* add comment
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