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

Refactor Prio3 dispatch logic, remove unneeded variants #749

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

cjpatton
Copy link
Contributor

@cjpatton cjpatton commented Dec 19, 2024

Partially addresses #698.
Alternative to #748.

Move sharding, preparation, and unsharding dispatchers to Prio3Config.
Not all variants are supported by all DAP versions, so pass the version
to each dispatcher in order to resolve DAP and Prio3 version
compatibility. (Note Prio3 is not API-compatible across versions.)

The following variants are supported in DAP-13:

  • Prio3Count
  • Prio3Sum
  • Prio3SumVec
  • Prio3Histogram

The following variants are supported in DAP-09:

  • Prio3SumVecField64MultiproofHmacSha256Aes128

Modify the taskprov provisioning logic accordingly, by removing support
for the following VDAFs in DAP-13:

  • Prio3SumVecField64MultiproofHmacSha256Aes128
  • Pine32HmacSha256Aes128
  • Pine64HmacSha256Aes128

These VDAFs need to be upgraded for VDAF-13 compatibility.

@@ -208,113 +198,6 @@ mod test {

test_versions! { roundtrip_report }

#[test]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAICT the only difference between this test and the previous is that the prio_draft09 crate is used instead of prio. This was necessary because we needed the right version of Prio3Sum. We avoid this by using a VDAF for testing that is supported by both versions (Prio2).

Comment on lines -714 to -716
#[test]
fn finish_agg_job_vdaf_draft09() {
let version = DapVersion::Draft09;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

let t =
AggregationJobTest::new(TEST_VDAF, HpkeKemId::X25519HkdfSha256, DapVersion::Draft09);
let mut reports = t.produce_reports(vec![DapMeasurement::U64(1), DapMeasurement::U64(1)]);
fn agg_job_init_req_skip_vdaf_prep_error(version: DapVersion) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test isn't specific to a DAP version.

Self::Prio3Draft09(Prio3Config::SumVecField64MultiproofHmacSha256Aes128 { .. })
| Self::Prio2 { .. }
| Self::Prio3(..) => VdafVerifyKey::L32([0; 32]),
Self::Prio3Draft09(..) => VdafVerifyKey::L16([0; 16]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we dropped the old variants of Prio3, the seed size is 32 bytes for every Prio3 variant we support :)

@cjpatton cjpatton force-pushed the cjpatton/698-vdaf-dispatch branch from 83fde97 to adcf494 Compare December 19, 2024 22:27
Comment on lines +136 to +137
/// max_measurement]`.
Sum { max_measurement: u64 },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that parameter change from VDAF-08 to VDAF-13.

@cjpatton cjpatton force-pushed the cjpatton/698-vdaf-dispatch branch 3 times, most recently from f36a7b6 to d290a79 Compare December 19, 2024 23:02
@cjpatton cjpatton marked this pull request as ready for review December 19, 2024 23:10
Copy link
Collaborator

@mendess mendess left a comment

Choose a reason for hiding this comment

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

This makes sense to me, in conjunction with the stacked PRs. Closing mine

@cjpatton cjpatton requested a review from jhoyla December 20, 2024 15:17
Move sharding, preparation, and unsharding dispatchers to `Prio3Config`.
Not all variants are supported by all DAP versions, so pass the version
to each dispatcher in order to resolve DAP and Prio3 version
compatibility. (Note Prio3 is not API-compatible across versions.)

The following variants are supported in DAP-13:

* Prio3Count
* Prio3Sum
* Prio3SumVec
* Prio3Histogram

The following variants are supported in DAP-09:

* Prio3SumVecField64MultiproofHmacSha256Aes128

Modify the taskprov provisioning logic accordingly, by removing support
for the following VDAFs in DAP-13:

* Prio3SumVecField64MultiproofHmacSha256Aes128
* Pine32HmacSha256Aes128
* Pine64HmacSha256Aes128

These VDAFs need to be upgraded for VDAF-13 compatibility.
@cjpatton
Copy link
Contributor Author

@cjpatton cjpatton force-pushed the cjpatton/698-vdaf-dispatch branch from d290a79 to 4d3dd54 Compare December 20, 2024 15:21
@cjpatton cjpatton merged commit 4ee168f into main Dec 20, 2024
3 checks passed
@cjpatton cjpatton deleted the cjpatton/698-vdaf-dispatch branch December 20, 2024 15:49
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