Skip to content

Commit

Permalink
Merge pull request #1346 from eriktaubeneck/small_cap_error
Browse files Browse the repository at this point in the history
add test to show that IPA fails for cap 1, 2, 3, and 4
  • Loading branch information
richajaindce authored Oct 16, 2024
2 parents 08cc86d + 6283343 commit 57fa8a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ipa-core/src/query/runner/oprf_ipa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,15 @@ where
#[cfg(not(feature = "relaxed-dp"))]
let padding_params = PaddingParameters::default();
match config.per_user_credit_cap {
1 => oprf_ipa::<_, BA8, BA3, HV, BA20, 1, 256>(ctx, input, aws, dp_params, padding_params).await,
2 | 4 => oprf_ipa::<_, BA8, BA3, HV, BA20, 2, 256>(ctx, input, aws, dp_params, padding_params).await,
8 => oprf_ipa::<_, BA8, BA3, HV, BA20, 3, 256>(ctx, input, aws, dp_params, padding_params).await,
16 => oprf_ipa::<_, BA8, BA3, HV, BA20, 4, 256>(ctx, input, aws, dp_params, padding_params).await,
32 => oprf_ipa::<_, BA8, BA3, HV, BA20, 5, 256>(ctx, input, aws, dp_params, padding_params).await,
64 => oprf_ipa::<_, BA8, BA3, HV, BA20, 6, 256>(ctx, input, aws, dp_params, padding_params).await,
128 => oprf_ipa::<_, BA8, BA3, HV, BA20, 7, 256>(ctx, input, aws, dp_params, padding_params).await,
_ => panic!(
"Invalid value specified for per-user cap: {:?}. Must be one of 8, 16, 32, 64, or 128.",
"Invalid value specified for per-user cap: {:?}. Must be one of 1, 2, 4, 8, 16, 32, 64, or 128.",
config.per_user_credit_cap
),
}
Expand Down
15 changes: 15 additions & 0 deletions ipa-core/tests/compact_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ fn compact_gate_cap_8_no_window_semi_honest_encryped_input() {
test_compact_gate(IpaSecurityModel::SemiHonest, 8, 0, true);
}

#[test]
fn compact_gate_cap_1_no_window_semi_honest_encryped_input() {
test_compact_gate(IpaSecurityModel::SemiHonest, 1, 0, true);
}

#[test]
fn compact_gate_cap_2_no_window_semi_honest_encryped_input() {
test_compact_gate(IpaSecurityModel::SemiHonest, 2, 0, true);
}

#[test]
fn compact_gate_cap_4_no_window_semi_honest_encryped_input() {
test_compact_gate(IpaSecurityModel::SemiHonest, 4, 0, true);
}

#[test]
fn compact_gate_cap_8_no_window_semi_honest_plaintext_input() {
test_compact_gate(IpaSecurityModel::SemiHonest, 8, 0, false);
Expand Down

0 comments on commit 57fa8a5

Please sign in to comment.