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

Implement reveal for upgraded contexts only #1206

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

andyleiserson
Copy link
Collaborator

Another piece of #1112. This modifies the reveal implementations so that reveal is implemented only for upgraded contexts, and not for any C: Context. The danger of impl Reveal<C: Context> for /* semi honest */ AdditiveShare<F> is that it could accidentally be invoked by a protocol intending to have DZKP malicious security.

This changes the check_zero protocol used for MAC-based malicious security to use a malicious reveal, however, there is still a problem with the zero check, see #1204 (comment).

The reveals in PRF evaluation are changed to call malicious_reveal directly because the PRF doesn't yet take a context of an appropriate type. I've added a TODO, which can be cleaned up with the changes for malicious security in the PRF.

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 97.36842% with 6 lines in your changes missing coverage. Please review.

Project coverage is 92.23%. Comparing base (2da9b09) to head (9ad30d9).

Files Patch % Lines
ipa-core/src/protocol/basics/reveal.rs 98.39% 3 Missing ⚠️
ipa-core/src/test_fixture/world.rs 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1206      +/-   ##
==========================================
- Coverage   92.25%   92.23%   -0.03%     
==========================================
  Files         197      197              
  Lines       29825    29951     +126     
==========================================
+ Hits        27514    27624     +110     
- Misses       2311     2327      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

&rv_share
.reveal(ctx.narrow(&Step::RevealR), record_id)
.await?,
&malicious_reveal(ctx.narrow(&Step::RevealR), record_id, None, &rv_share)
Copy link
Collaborator

Choose a reason for hiding this comment

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

it is maybe worth renaming this protocol to check_zero_malicious because it is no longer "default" implementation (can be made cheaper by using semi-honest reveal). We only use it in MAC-based validation, so it should be just a rename imo

let mut rng = thread_rng();
let mut config = TestWorldConfig::default();
config.stream_interceptor =
MaliciousHelper::new(Role::H3, config.role_assignment(), interceptor::<Boolean>);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice! it works for DZKP too

@andyleiserson andyleiserson merged commit 92eea6e into private-attribution:main Aug 1, 2024
12 checks passed
@andyleiserson andyleiserson deleted the reveal-redux branch August 1, 2024 20:30
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