diff --git a/Cargo.toml b/Cargo.toml index d520bdcdc..ac06241cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,8 +60,8 @@ mappable-rc = "0.1.1" matchit = "0.7.3" p256 = { version = "0.13.2", features = ["ecdsa-core", "ecdsa", "pem"] } paste = "1.0.15" -prio_09 = { package = "prio", version = "0.16.7" } -prio_latest = { package = "prio", git = "https://github.com/divviup/libprio-rs.git", branch = "main" } +prio_draft09 = { package = "prio", version = "0.16.7" } +prio = { git = "https://github.com/divviup/libprio-rs.git", branch = "main" } prometheus = "0.13.4" rand = "0.8.5" rayon = "1.10.0" diff --git a/crates/dapf/Cargo.toml b/crates/dapf/Cargo.toml index 08de74663..afbf7bf13 100644 --- a/crates/dapf/Cargo.toml +++ b/crates/dapf/Cargo.toml @@ -19,7 +19,7 @@ daphne = { path = "../daphne", features = ["report-generator", "prometheus"] } daphne-service-utils = { path = "../daphne-service-utils", features = ["test-utils"] } futures.workspace = true hex.workspace = true -prio_latest.workspace = true +prio.workspace = true prometheus.workspace = true rand.workspace = true reqwest = { workspace = true, features = ["json"] } diff --git a/crates/dapf/src/functions/helper.rs b/crates/dapf/src/functions/helper.rs index d55737d32..1d69c2a67 100644 --- a/crates/dapf/src/functions/helper.rs +++ b/crates/dapf/src/functions/helper.rs @@ -12,7 +12,7 @@ use daphne::{ DapVersion, }; use daphne_service_utils::{bearer_token::BearerToken, http_headers}; -use prio_latest::codec::{ParameterizedDecode as _, ParameterizedEncode as _}; +use prio::codec::{ParameterizedDecode as _, ParameterizedEncode as _}; use reqwest::header; use url::Url; diff --git a/crates/dapf/src/functions/hpke.rs b/crates/dapf/src/functions/hpke.rs index da385ca5e..5520faa8c 100644 --- a/crates/dapf/src/functions/hpke.rs +++ b/crates/dapf/src/functions/hpke.rs @@ -6,7 +6,7 @@ use std::{io::Cursor, path::Path}; use anyhow::{anyhow, Context as _}; use daphne::messages::{decode_base64url_vec, HpkeConfigList}; use daphne_service_utils::http_headers; -use prio_latest::codec::Decode as _; +use prio::codec::Decode as _; use url::Url; use webpki::{EndEntityCert, ECDSA_P256_SHA256}; use x509_parser::pem::Pem; diff --git a/crates/dapf/src/functions/leader.rs b/crates/dapf/src/functions/leader.rs index 0c8e85576..eaebdc9c5 100644 --- a/crates/dapf/src/functions/leader.rs +++ b/crates/dapf/src/functions/leader.rs @@ -9,7 +9,7 @@ use daphne::{ DapVersion, }; use daphne_service_utils::{bearer_token::BearerToken, http_headers}; -use prio_latest::codec::{ParameterizedDecode as _, ParameterizedEncode as _}; +use prio::codec::{ParameterizedDecode as _, ParameterizedEncode as _}; use rand::{thread_rng, Rng}; use reqwest::StatusCode; use url::Url; diff --git a/crates/dapf/src/main.rs b/crates/dapf/src/main.rs index 0616f1f1b..9775d9b36 100644 --- a/crates/dapf/src/main.rs +++ b/crates/dapf/src/main.rs @@ -25,7 +25,7 @@ use daphne_service_utils::{ bearer_token::BearerToken, test_route_types::{InternalTestAddTask, InternalTestVdaf}, }; -use prio_latest::codec::{ParameterizedDecode, ParameterizedEncode}; +use prio::codec::{ParameterizedDecode, ParameterizedEncode}; use rand::{thread_rng, Rng}; use serde::Serialize; use std::{ diff --git a/crates/daphne-server/Cargo.toml b/crates/daphne-server/Cargo.toml index d13960f1c..b1e9150fc 100644 --- a/crates/daphne-server/Cargo.toml +++ b/crates/daphne-server/Cargo.toml @@ -24,7 +24,7 @@ hex.workspace = true http.workspace = true mappable-rc.workspace = true p256.workspace = true -prio_latest.workspace = true +prio.workspace = true prometheus = { workspace = true, optional = true } serde.workspace = true serde_json.workspace = true diff --git a/crates/daphne-server/src/roles/leader.rs b/crates/daphne-server/src/roles/leader.rs index 9ac4a5b91..dde6f629c 100644 --- a/crates/daphne-server/src/roles/leader.rs +++ b/crates/daphne-server/src/roles/leader.rs @@ -14,7 +14,7 @@ use daphne::{ }; use daphne_service_utils::http_headers; use http::StatusCode; -use prio_latest::codec::ParameterizedEncode; +use prio::codec::ParameterizedEncode; use tracing::{error, info}; use url::Url; diff --git a/crates/daphne-server/src/roles/mod.rs b/crates/daphne-server/src/roles/mod.rs index abb39686f..62a5de962 100644 --- a/crates/daphne-server/src/roles/mod.rs +++ b/crates/daphne-server/src/roles/mod.rs @@ -119,7 +119,7 @@ mod test_utils { bearer_token::BearerToken, test_route_types::{InternalTestAddTask, InternalTestEndpointForTask}, }; - use prio_latest::codec::Decode; + use prio::codec::Decode; use std::num::NonZeroUsize; use crate::storage_proxy_connection::kv; diff --git a/crates/daphne-server/src/router/extractor.rs b/crates/daphne-server/src/router/extractor.rs index c278c5975..e9230d1b2 100644 --- a/crates/daphne-server/src/router/extractor.rs +++ b/crates/daphne-server/src/router/extractor.rs @@ -21,7 +21,7 @@ use daphne::{ }; use daphne_service_utils::{bearer_token::BearerToken, http_headers}; use http::{header::CONTENT_TYPE, HeaderMap}; -use prio_latest::codec::ParameterizedDecode; +use prio::codec::ParameterizedDecode; use serde::Deserialize; use crate::metrics; @@ -370,7 +370,7 @@ mod test { use super::{dap_sender::FROM_LEADER, resource_parsers, DecodeFromDapHttpBody}; use http::{header, StatusCode}; - use prio_latest::codec::ParameterizedEncode; + use prio::codec::ParameterizedEncode; const BEARER_TOKEN: &str = "test-token"; diff --git a/crates/daphne-server/src/router/leader.rs b/crates/daphne-server/src/router/leader.rs index 514399550..06584e996 100644 --- a/crates/daphne-server/src/router/leader.rs +++ b/crates/daphne-server/src/router/leader.rs @@ -17,7 +17,7 @@ use daphne::{ roles::leader::{self, DapLeader}, DapError, DapVersion, }; -use prio_latest::codec::ParameterizedEncode; +use prio::codec::ParameterizedEncode; use super::{ extractor::dap_sender::FROM_COLLECTOR, AxumDapResponse, DapRequestExtractor, DaphneService, diff --git a/crates/daphne-server/tests/e2e/e2e.rs b/crates/daphne-server/tests/e2e/e2e.rs index ac679bdcc..93a4ca009 100644 --- a/crates/daphne-server/tests/e2e/e2e.rs +++ b/crates/daphne-server/tests/e2e/e2e.rs @@ -15,7 +15,7 @@ use daphne::{ }; use daphne_service_utils::http_headers; use http::Method; -use prio_latest::codec::{Encode, ParameterizedDecode, ParameterizedEncode}; +use prio::codec::{Encode, ParameterizedDecode, ParameterizedEncode}; use rand::prelude::*; use serde::Deserialize; use serde_json::json; diff --git a/crates/daphne-server/tests/e2e/test_runner.rs b/crates/daphne-server/tests/e2e/test_runner.rs index b6051a82a..be798032d 100644 --- a/crates/daphne-server/tests/e2e/test_runner.rs +++ b/crates/daphne-server/tests/e2e/test_runner.rs @@ -16,7 +16,7 @@ use daphne::{ use daphne_service_utils::http_headers; use futures::StreamExt; use hpke_rs::{HpkePrivateKey, HpkePublicKey}; -use prio_latest::codec::{Decode, Encode}; +use prio::codec::{Decode, Encode}; use rand::prelude::*; use serde::{Deserialize, Serialize}; use serde_json::json; diff --git a/crates/daphne-service-utils/Cargo.toml b/crates/daphne-service-utils/Cargo.toml index 3bfa72864..2c9d50b00 100644 --- a/crates/daphne-service-utils/Cargo.toml +++ b/crates/daphne-service-utils/Cargo.toml @@ -14,8 +14,8 @@ repository.workspace = true [dependencies] capnp = { workspace = true, optional = true } daphne = { path = "../daphne", default-features = false } -prio_09 = { workspace = true, optional = true } -prio_latest = { workspace = true, optional = true } +prio_draft09 = { workspace = true, optional = true } +prio = { workspace = true, optional = true } serde.workspace = true url = { workspace = true, optional = true } @@ -28,7 +28,7 @@ capnpc = { workspace = true, optional = true } [features] test-utils = ["dep:url", "daphne/prometheus", "daphne/test-utils"] -durable_requests = ["dep:capnp", "dep:capnpc", "dep:prio_09", "dep:prio_latest"] +durable_requests = ["dep:capnp", "dep:capnpc", "dep:prio_draft09", "dep:prio"] experimental = ["daphne/experimental"] [lints] diff --git a/crates/daphne-service-utils/src/durable_requests/bindings/aggregate_store.rs b/crates/daphne-service-utils/src/durable_requests/bindings/aggregate_store.rs index 3cd00dc87..9b521325c 100644 --- a/crates/daphne-service-utils/src/durable_requests/bindings/aggregate_store.rs +++ b/crates/daphne-service-utils/src/durable_requests/bindings/aggregate_store.rs @@ -16,14 +16,14 @@ use crate::{ }; use super::DurableRequestPayload; -use prio_09::{ - field::{FieldElement as FieldElementDraft09, FieldError as FieldErrorDraft09}, - vdaf::AggregateShare as AggregateShareDraft09, -}; -use prio_latest::{ +use prio::{ field::{FieldElement, FieldError}, vdaf::AggregateShare, }; +use prio_draft09::{ + field::{FieldElement as FieldElementDraft09, FieldError as FieldErrorDraft09}, + vdaf::AggregateShare as AggregateShareDraft09, +}; super::define_do_binding! { const BINDING = "DAP_AGGREGATE_STORE"; @@ -284,7 +284,12 @@ pub enum AggregateStoreMergeResp { #[cfg(test)] mod test { - use prio_09::{ + use prio::{ + codec::Decode, + field::{Field128, Field64, FieldElement, FieldPrio2}, + vdaf::AggregateShare, + }; + use prio_draft09::{ codec::Decode as DecodeDraft09, field::{ Field128 as Field128Draft09, Field64 as Field64Draft09, @@ -292,11 +297,6 @@ mod test { }, vdaf::AggregateShare as AggregateShareDraft09, }; - use prio_latest::{ - codec::Decode, - field::{Field128, Field64, FieldElement, FieldPrio2}, - vdaf::AggregateShare, - }; use rand::{thread_rng, Rng}; use crate::durable_requests::bindings::DurableRequestPayloadExt; diff --git a/crates/daphne-worker/Cargo.toml b/crates/daphne-worker/Cargo.toml index 1e9c43984..d1b197398 100644 --- a/crates/daphne-worker/Cargo.toml +++ b/crates/daphne-worker/Cargo.toml @@ -29,8 +29,8 @@ getrandom = { workspace = true, features = ["js"] } headers.workspace = true hex.workspace = true http.workspace = true -prio_09.workspace = true -prio_latest.workspace = true +prio_draft09.workspace = true +prio.workspace = true prometheus.workspace = true rand.workspace = true serde-wasm-bindgen.workspace = true diff --git a/crates/daphne-worker/src/durable/aggregate_store.rs b/crates/daphne-worker/src/durable/aggregate_store.rs index 97719eae9..6f6172052 100644 --- a/crates/daphne-worker/src/durable/aggregate_store.rs +++ b/crates/daphne-worker/src/durable/aggregate_store.rs @@ -36,14 +36,14 @@ use daphne_service_utils::durable_requests::bindings::{ DurableMethod, }; -use prio_09::{ - field::FieldElement as FieldElementDraft09, vdaf::AggregateShare as AggregateShareDraft09, -}; -use prio_latest::{ +use prio::{ codec::{Decode, Encode}, field::FieldElement, vdaf::AggregateShare, }; +use prio_draft09::{ + field::FieldElement as FieldElementDraft09, vdaf::AggregateShare as AggregateShareDraft09, +}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use worker::{ js_sys, wasm_bindgen::JsValue, Env, Error, Request, Response, Result, ScheduledTime, State, diff --git a/crates/daphne/Cargo.toml b/crates/daphne/Cargo.toml index 0158860f2..7e5da96ea 100644 --- a/crates/daphne/Cargo.toml +++ b/crates/daphne/Cargo.toml @@ -24,8 +24,8 @@ hex.workspace = true hpke-rs = { workspace = true, features = ["hazmat", "serialization"] } hpke-rs-crypto.workspace = true hpke-rs-rust-crypto.workspace = true -prio_09 = { workspace = true, features = ["experimental"] } -prio_latest = { workspace = true, features = ["experimental"] } +prio_draft09 = { workspace = true, features = ["experimental"] } +prio = { workspace = true, features = ["experimental"] } prometheus = { workspace = true, optional = true } rand.workspace = true ring.workspace = true @@ -43,8 +43,8 @@ criterion.workspace = true deepsize.workspace = true matchit.workspace = true paste.workspace = true -prio_09 = { workspace = true, features = ["test-util"] } -prio_latest = { workspace = true, features = ["test-util"] } +prio_draft09 = { workspace = true, features = ["test-util"] } +prio = { workspace = true, features = ["test-util"] } prometheus.workspace = true rayon.workspace = true regex.workspace = true diff --git a/crates/daphne/benches/pine.rs b/crates/daphne/benches/pine.rs index ffcf956fc..f18d42293 100644 --- a/crates/daphne/benches/pine.rs +++ b/crates/daphne/benches/pine.rs @@ -3,7 +3,7 @@ use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; use daphne::pine::Pine; -use prio_09::{ +use prio_draft09::{ field::random_vector, flp::Type, vdaf::{ diff --git a/crates/daphne/benches/vdaf.rs b/crates/daphne/benches/vdaf.rs index 23a007bc3..69bed694a 100644 --- a/crates/daphne/benches/vdaf.rs +++ b/crates/daphne/benches/vdaf.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BSD-3-Clause use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; -use prio_09::{ +use prio_draft09::{ field::Field64, flp::{ gadgets::{Mul, ParallelSum}, diff --git a/crates/daphne/src/error/aborts.rs b/crates/daphne/src/error/aborts.rs index 78cf2941f..f0bcf81b0 100644 --- a/crates/daphne/src/error/aborts.rs +++ b/crates/daphne/src/error/aborts.rs @@ -9,7 +9,7 @@ use crate::{ messages::{AggregationJobId, ReportId, TaskId, TransitionFailure}, DapError, DapRequestMeta, DapVersion, }; -use prio_latest::codec::CodecError; +use prio::codec::CodecError; use serde::{Deserialize, Serialize}; use super::FatalDapError; diff --git a/crates/daphne/src/error/mod.rs b/crates/daphne/src/error/mod.rs index f19cd4417..7a63ca308 100644 --- a/crates/daphne/src/error/mod.rs +++ b/crates/daphne/src/error/mod.rs @@ -7,7 +7,7 @@ use std::fmt::{Debug, Display}; use crate::{messages::TransitionFailure, vdaf::VdafError}; pub use aborts::DapAbort; -use prio_latest::codec::CodecError; +use prio::codec::CodecError; use self::aborts::ProblemDetails; diff --git a/crates/daphne/src/hpke.rs b/crates/daphne/src/hpke.rs index ee7b0c32e..3c067a9ad 100644 --- a/crates/daphne/src/hpke.rs +++ b/crates/daphne/src/hpke.rs @@ -444,7 +444,7 @@ pub mod info_and_aad { messages::{encode_u32_bytes, encode_u32_prefixed, BatchSelector, ReportMetadata, TaskId}, DapAggregationParam, DapVersion, }; - use prio_latest::codec::{CodecError, Encode, ParameterizedEncode}; + use prio::codec::{CodecError, Encode, ParameterizedEncode}; const CTX_INPUT_SHARE_DRAFT09: &[u8] = b"dap-09 input share"; const CTX_INPUT_SHARE_DRAFT13: &[u8] = b"dap-13 input share"; @@ -600,7 +600,7 @@ mod test { use hpke_rs::{Hpke, HpkePrivateKey, HpkePublicKey, Mode}; use hpke_rs_crypto::types::{AeadAlgorithm, KdfAlgorithm, KemAlgorithm}; use hpke_rs_rust_crypto::HpkeRustCrypto as ImplHpkeCrypto; - use prio_latest::codec::{Encode, ParameterizedEncode}; + use prio::codec::{Encode, ParameterizedEncode}; use rand::seq::IteratorRandom; fn encrypt_roundtrip_x25519_hkdf_sha256(version: DapVersion) { diff --git a/crates/daphne/src/lib.rs b/crates/daphne/src/lib.rs index 96e2a906c..ba9cdf6cf 100644 --- a/crates/daphne/src/lib.rs +++ b/crates/daphne/src/lib.rs @@ -69,19 +69,19 @@ pub use error::DapError; use error::FatalDapError; use hpke::{HpkeConfig, HpkeKemId}; use messages::taskprov::TaskprovAdvertisement; +use prio::{ + codec::{CodecError, Encode, ParameterizedDecode}, + vdaf::Aggregatable as AggregatableTrait, +}; #[cfg(feature = "experimental")] -use prio_09::{codec::Decode, vdaf::poplar1::Poplar1AggregationParam}; -use prio_09::{ +use prio_draft09::{codec::Decode, vdaf::poplar1::Poplar1AggregationParam}; +use prio_draft09::{ codec::{ CodecError as CodecErrorDraft09, Encode as EncodeDraft09, ParameterizedDecode as ParameterizedDecodeDraft09, }, vdaf::Aggregatable as AggregatableTraitDraft09, }; -use prio_latest::{ - codec::{CodecError, Encode, ParameterizedDecode}, - vdaf::Aggregatable as AggregatableTrait, -}; pub use protocol::aggregator::ReplayProtection; use serde::{Deserialize, Serialize}; use std::{ diff --git a/crates/daphne/src/messages/mod.rs b/crates/daphne/src/messages/mod.rs index 123dcfe84..14b07f19a 100644 --- a/crates/daphne/src/messages/mod.rs +++ b/crates/daphne/src/messages/mod.rs @@ -12,7 +12,7 @@ use crate::{ }; use base64::engine::{general_purpose::URL_SAFE_NO_PAD, Engine}; use hpke_rs::HpkePublicKey; -use prio_latest::codec::{ +use prio::codec::{ decode_u16_items, decode_u32_items, encode_u16_items, encode_u32_items, CodecError, Decode, Encode, ParameterizedDecode, ParameterizedEncode, }; @@ -1569,7 +1569,7 @@ mod test { use crate::test_versions; use hpke_rs::HpkePublicKey; - use prio_latest::codec::{Decode, ParameterizedDecode, ParameterizedEncode}; + use prio::codec::{Decode, ParameterizedDecode, ParameterizedEncode}; use rand::prelude::*; fn read_report(version: DapVersion) { diff --git a/crates/daphne/src/messages/taskprov.rs b/crates/daphne/src/messages/taskprov.rs index 437fd1dbb..9b60307d8 100644 --- a/crates/daphne/src/messages/taskprov.rs +++ b/crates/daphne/src/messages/taskprov.rs @@ -9,7 +9,7 @@ use crate::messages::{ }; use crate::pine::PineParam; use crate::{DapError, DapVersion}; -use prio_latest::codec::{ +use prio::codec::{ decode_u8_items, encode_u8_items, CodecError, Decode, Encode, ParameterizedDecode, ParameterizedEncode, }; diff --git a/crates/daphne/src/pine/flp.rs b/crates/daphne/src/pine/flp.rs index 990aaecbe..b74e688d9 100644 --- a/crates/daphne/src/pine/flp.rs +++ b/crates/daphne/src/pine/flp.rs @@ -33,7 +33,7 @@ use std::marker::PhantomData; -use prio_09::{ +use prio_draft09::{ field::FftFriendlyFieldElement, flp::{ gadgets::{Mul, ParallelSum, ParallelSumGadget, PolyEval}, @@ -617,7 +617,7 @@ fn range_checked(x: F, lower_bound: F, upper_bound: #[cfg(test)] mod tests { - use prio_09::{ + use prio_draft09::{ field::{Field128, FieldElement, FieldElementWithInteger}, flp::{test_utils::FlpTest, Type}, vdaf::xof::XofTurboShake128, diff --git a/crates/daphne/src/pine/mod.rs b/crates/daphne/src/pine/mod.rs index 1d605c85b..bd416403b 100644 --- a/crates/daphne/src/pine/mod.rs +++ b/crates/daphne/src/pine/mod.rs @@ -15,7 +15,7 @@ use std::marker::PhantomData; -use prio_09::{ +use prio_draft09::{ field::{FftFriendlyFieldElement, Field128, Field64}, vdaf::{xof::XofTurboShake128, VdafError}, }; @@ -389,7 +389,7 @@ pub mod vdaf; #[cfg(test)] mod tests { - use prio_09::field::Field128; + use prio_draft09::field::Field128; use super::*; diff --git a/crates/daphne/src/pine/msg.rs b/crates/daphne/src/pine/msg.rs index 4efb71394..443a374c5 100644 --- a/crates/daphne/src/pine/msg.rs +++ b/crates/daphne/src/pine/msg.rs @@ -5,7 +5,7 @@ use std::iter; -use prio_09::{ +use prio_draft09::{ codec::{CodecError, Decode, Encode, ParameterizedDecode}, field::FftFriendlyFieldElement, flp::Type, diff --git a/crates/daphne/src/pine/test_vec/mod.rs b/crates/daphne/src/pine/test_vec/mod.rs index 1cc56c0e0..585ee934e 100644 --- a/crates/daphne/src/pine/test_vec/mod.rs +++ b/crates/daphne/src/pine/test_vec/mod.rs @@ -6,7 +6,7 @@ use crate::messages::taskprov::{ VDAF_TYPE_PINE_FIELD32_HMAC_SHA256_AES128, VDAF_TYPE_PINE_FIELD64_HMAC_SHA256_AES128, }; use crate::pine::{Pine, PineParam, ALPHA}; -use prio_09::{ +use prio_draft09::{ codec::Encode, field::{FftFriendlyFieldElement, Field128, Field64}, vdaf::{ @@ -14,7 +14,7 @@ use prio_09::{ Aggregator, Collector, PrepareTransition, }, }; -use prio_09::{field::FieldPrio2, vdaf::xof::XofHmacSha256Aes128}; +use prio_draft09::{field::FieldPrio2, vdaf::xof::XofHmacSha256Aes128}; use serde::Deserialize; #[derive(Deserialize)] diff --git a/crates/daphne/src/pine/vdaf.rs b/crates/daphne/src/pine/vdaf.rs index 410c06309..aed3d6fc9 100644 --- a/crates/daphne/src/pine/vdaf.rs +++ b/crates/daphne/src/pine/vdaf.rs @@ -6,7 +6,7 @@ use std::{borrow::Cow, iter}; use crate::pine::{dst, USAGE_QUERY_RAND}; -use prio_09::{ +use prio_draft09::{ codec::{CodecError, Decode, Encode, ParameterizedDecode}, field::FftFriendlyFieldElement, flp::Type, @@ -667,7 +667,7 @@ impl, const SEED_SIZE: usize> Coll #[cfg(test)] mod tests { - use prio_09::{ + use prio_draft09::{ codec::Decode, field::{Field128, Field64}, vdaf::{ diff --git a/crates/daphne/src/protocol/aggregator.rs b/crates/daphne/src/protocol/aggregator.rs index bd85ad4b2..d9fd79f35 100644 --- a/crates/daphne/src/protocol/aggregator.rs +++ b/crates/daphne/src/protocol/aggregator.rs @@ -29,7 +29,7 @@ use crate::{ DapAggregationParam, DapError, DapTaskConfig, DapVersion, VdafConfig, }; -use prio_latest::codec::{encode_u32_items, Encode, ParameterizedDecode, ParameterizedEncode}; +use prio::codec::{encode_u32_items, Encode, ParameterizedDecode, ParameterizedEncode}; use rayon::iter::{IntoParallelIterator, ParallelIterator as _}; use std::{ collections::{HashMap, HashSet}, diff --git a/crates/daphne/src/protocol/client.rs b/crates/daphne/src/protocol/client.rs index 20ac8eed2..153fcf329 100644 --- a/crates/daphne/src/protocol/client.rs +++ b/crates/daphne/src/protocol/client.rs @@ -13,7 +13,7 @@ use crate::{ }, DapError, DapMeasurement, DapVersion, VdafConfig, }; -use prio_latest::codec::ParameterizedEncode; +use prio::codec::ParameterizedEncode; use rand::prelude::*; impl VdafConfig { diff --git a/crates/daphne/src/protocol/mod.rs b/crates/daphne/src/protocol/mod.rs index 62acc6afa..f10c91c13 100644 --- a/crates/daphne/src/protocol/mod.rs +++ b/crates/daphne/src/protocol/mod.rs @@ -1,7 +1,7 @@ // Copyright (c) 2024 Cloudflare, Inc. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause -use prio_latest::codec::{CodecError, Decode as _}; +use prio::codec::{CodecError, Decode as _}; use std::{collections::HashSet, io::Cursor}; pub(crate) mod aggregator; @@ -79,7 +79,14 @@ mod test { }; use assert_matches::assert_matches; use hpke_rs::HpkePublicKey; - use prio_09::{ + use prio::{ + codec::encode_u32_items, + vdaf::{ + prio3::Prio3, Aggregator as VdafAggregator, Collector as VdafCollector, + PrepareTransition, + }, + }; + use prio_draft09::{ field::Field64 as Field64Draft09, vdaf::{ prio3::Prio3 as Prio3Draft09, AggregateShare as AggregateShareDraft09, @@ -87,13 +94,6 @@ mod test { OutputShare as OutputShareDraft09, PrepareTransition as PrepareTransitionDraft09, }, }; - use prio_latest::{ - codec::encode_u32_items, - vdaf::{ - prio3::Prio3, Aggregator as VdafAggregator, Collector as VdafCollector, - PrepareTransition, - }, - }; use rand::prelude::*; use std::iter::zip; diff --git a/crates/daphne/src/protocol/report_init.rs b/crates/daphne/src/protocol/report_init.rs index 45a17d874..a7fb24ab3 100644 --- a/crates/daphne/src/protocol/report_init.rs +++ b/crates/daphne/src/protocol/report_init.rs @@ -17,7 +17,7 @@ use crate::{ }, DapAggregationParam, DapError, DapTaskConfig, }; -use prio_latest::codec::{CodecError, ParameterizedDecode as _}; +use prio::codec::{CodecError, ParameterizedDecode as _}; use std::ops::{Deref, Range}; /// Report state during aggregation initialization after the VDAF preparation step. diff --git a/crates/daphne/src/roles/aggregator.rs b/crates/daphne/src/roles/aggregator.rs index 3b328fddc..d9dd4bac9 100644 --- a/crates/daphne/src/roles/aggregator.rs +++ b/crates/daphne/src/roles/aggregator.rs @@ -4,7 +4,7 @@ use std::{collections::HashSet, ops::Range}; use async_trait::async_trait; -use prio_latest::codec::Encode; +use prio::codec::Encode; use crate::{ audit_log::AuditLog, diff --git a/crates/daphne/src/roles/helper.rs b/crates/daphne/src/roles/helper.rs index 226052781..a5e3ef1e5 100644 --- a/crates/daphne/src/roles/helper.rs +++ b/crates/daphne/src/roles/helper.rs @@ -4,7 +4,7 @@ use std::{collections::HashMap, sync::Once}; use async_trait::async_trait; -use prio_latest::codec::{Encode, ParameterizedDecode, ParameterizedEncode}; +use prio::codec::{Encode, ParameterizedDecode, ParameterizedEncode}; use super::{check_batch, resolve_task_config, DapAggregator}; use crate::{ diff --git a/crates/daphne/src/roles/leader/mod.rs b/crates/daphne/src/roles/leader/mod.rs index 237b725bf..503461805 100644 --- a/crates/daphne/src/roles/leader/mod.rs +++ b/crates/daphne/src/roles/leader/mod.rs @@ -7,7 +7,7 @@ use std::collections::HashMap; use async_trait::async_trait; use futures::future::try_join_all; -use prio_latest::codec::{Decode, Encode, ParameterizedDecode, ParameterizedEncode}; +use prio::codec::{Decode, Encode, ParameterizedDecode, ParameterizedEncode}; use rand::{thread_rng, Rng}; use tracing::debug; use url::Url; diff --git a/crates/daphne/src/roles/mod.rs b/crates/daphne/src/roles/mod.rs index db117c669..9d918a297 100644 --- a/crates/daphne/src/roles/mod.rs +++ b/crates/daphne/src/roles/mod.rs @@ -149,9 +149,9 @@ mod test { DapTaskConfig, DapTaskParameters, DapVersion, }; use assert_matches::assert_matches; + use prio::codec::{Encode, ParameterizedDecode}; #[cfg(feature = "experimental")] - use prio_09::{idpf::IdpfInput, vdaf::poplar1::Poplar1AggregationParam}; - use prio_latest::codec::{Encode, ParameterizedDecode}; + use prio_draft09::{idpf::IdpfInput, vdaf::poplar1::Poplar1AggregationParam}; use rand::{thread_rng, Rng}; use std::{ collections::HashMap, diff --git a/crates/daphne/src/taskprov.rs b/crates/daphne/src/taskprov.rs index 0e0e2bb94..71a87bd2e 100644 --- a/crates/daphne/src/taskprov.rs +++ b/crates/daphne/src/taskprov.rs @@ -466,7 +466,7 @@ impl TryFrom<&DapTaskConfig> for messages::taskprov::TaskprovAdvertisement { mod test { use std::num::{NonZeroU32, NonZeroUsize}; - use prio_latest::codec::ParameterizedEncode; + use prio::codec::ParameterizedEncode; use super::{compute_task_id, compute_vdaf_verify_key}; use crate::{ diff --git a/crates/daphne/src/testing/mod.rs b/crates/daphne/src/testing/mod.rs index fd300f902..16e49e337 100644 --- a/crates/daphne/src/testing/mod.rs +++ b/crates/daphne/src/testing/mod.rs @@ -30,7 +30,7 @@ use crate::{ }; use async_trait::async_trait; use deepsize::DeepSizeOf; -use prio_latest::codec::{ParameterizedDecode, ParameterizedEncode}; +use prio::codec::{ParameterizedDecode, ParameterizedEncode}; use rand::{thread_rng, Rng}; use serde::{Deserialize, Serialize}; use std::{ diff --git a/crates/daphne/src/vdaf/mastic.rs b/crates/daphne/src/vdaf/mastic.rs index e390161ff..73dc495ce 100644 --- a/crates/daphne/src/vdaf/mastic.rs +++ b/crates/daphne/src/vdaf/mastic.rs @@ -15,7 +15,7 @@ use super::{ decode_field_vec, VdafAggregateShare, VdafError, VdafPrepShare, VdafPrepState, VdafVerifyKey, }; -use prio_09::{ +use prio_draft09::{ codec::{CodecError, Decode}, field::{Field64, FieldElement}, vdaf::{AggregateShare, VdafError as PrioVdafError}, @@ -230,7 +230,7 @@ pub(crate) fn mastic_unshard>>( #[cfg(test)] mod test { - use prio_09::{idpf::IdpfInput, vdaf::poplar1::Poplar1AggregationParam}; + use prio_draft09::{idpf::IdpfInput, vdaf::poplar1::Poplar1AggregationParam}; use super::*; use crate::{ diff --git a/crates/daphne/src/vdaf/mod.rs b/crates/daphne/src/vdaf/mod.rs index 92ae5dd5d..9a2cecf3d 100644 --- a/crates/daphne/src/vdaf/mod.rs +++ b/crates/daphne/src/vdaf/mod.rs @@ -14,9 +14,17 @@ pub(crate) mod prio3_latest; use crate::pine::vdaf::PinePrepState; use crate::{fatal_error, messages::TaskId, DapError}; use pine::PineConfig; +use prio::{ + codec::{CodecError, Encode, ParameterizedDecode}, + field::{Field128, Field64, FieldPrio2}, + vdaf::{ + prio3::{Prio3PrepareShare, Prio3PrepareState}, + AggregateShare, Aggregator, Client, Collector, PrepareTransition, Vdaf, + }, +}; #[cfg(any(test, feature = "test-utils", feature = "experimental"))] -use prio_09::field::FieldElement as FieldElementDraft09; -use prio_09::{ +use prio_draft09::field::FieldElement as FieldElementDraft09; +use prio_draft09::{ codec::{ CodecError as CodecErrorDraft09, Encode as EncodeDraft09, ParameterizedDecode as ParameterizedDecodeDraft09, @@ -35,14 +43,6 @@ use prio_09::{ PrepareTransition as PrepareTransitionDraft09, Vdaf as VdafDraft09, }, }; -use prio_latest::{ - codec::{CodecError, Encode, ParameterizedDecode}, - field::{Field128, Field64, FieldPrio2}, - vdaf::{ - prio3::{Prio3PrepareShare, Prio3PrepareState}, - AggregateShare, Aggregator, Client, Collector, PrepareTransition, Vdaf, - }, -}; use rand::prelude::*; use ring::hkdf::KeyType; use serde::{Deserialize, Serialize}; @@ -59,11 +59,11 @@ pub(crate) enum VdafError { #[error("{0}")] CodecDraft09(#[from] CodecErrorDraft09), #[error("{0}")] - VdafDraft09(#[from] prio_09::vdaf::VdafError), + VdafDraft09(#[from] prio_draft09::vdaf::VdafError), #[error("{0}")] Codec(#[from] CodecError), #[error("{0}")] - Vdaf(#[from] prio_latest::vdaf::VdafError), + Vdaf(#[from] prio::vdaf::VdafError), #[error("{0}")] Dap(DapError), } @@ -111,8 +111,8 @@ pub(crate) fn from_codec_error(c: CodecErrorDraft09) -> CodecError { impl std::fmt::Display for VdafConfig { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - VdafConfig::Prio3Draft09(prio3_config) => write!(f, "Prio3({prio3_config})"), - VdafConfig::Prio3(prio3_config) => write!(f, "Prio3Latest({prio3_config})"), + VdafConfig::Prio3Draft09(prio3_config) => write!(f, "Prio3Draft09({prio3_config})"), + VdafConfig::Prio3(prio3_config) => write!(f, "Prio3({prio3_config})"), VdafConfig::Prio2 { dimension } => write!(f, "Prio2({dimension})"), #[cfg(feature = "experimental")] VdafConfig::Mastic { diff --git a/crates/daphne/src/vdaf/pine.rs b/crates/daphne/src/vdaf/pine.rs index af0f3ff26..9230f3a86 100644 --- a/crates/daphne/src/vdaf/pine.rs +++ b/crates/daphne/src/vdaf/pine.rs @@ -14,7 +14,7 @@ use super::{ prep_finish_draft09, prep_finish_from_shares_draft09, shard_then_encode_draft09, unshard_draft09, VdafAggregateShare, VdafError, VdafPrepShare, VdafPrepState, VdafVerifyKey, }; -use prio_09::{ +use prio_draft09::{ codec::ParameterizedDecode, field::{FftFriendlyFieldElement, Field64, FieldPrio2}, vdaf::{ diff --git a/crates/daphne/src/vdaf/prio2.rs b/crates/daphne/src/vdaf/prio2.rs index aabb1ee6d..4eb873aab 100644 --- a/crates/daphne/src/vdaf/prio2.rs +++ b/crates/daphne/src/vdaf/prio2.rs @@ -8,7 +8,7 @@ use crate::{ fatal_error, vdaf::VdafError, DapAggregateResult, DapMeasurement, VdafAggregateShare, VdafPrepShare, VdafPrepState, VdafVerifyKey, }; -use prio_09::{ +use prio_draft09::{ codec::{Decode, Encode, ParameterizedDecode}, field::FieldPrio2, vdaf::{ diff --git a/crates/daphne/src/vdaf/prio3_draft09.rs b/crates/daphne/src/vdaf/prio3_draft09.rs index 0d59efb90..bbc2e0606 100644 --- a/crates/daphne/src/vdaf/prio3_draft09.rs +++ b/crates/daphne/src/vdaf/prio3_draft09.rs @@ -16,7 +16,7 @@ use super::{ unshard_draft09, }; -use prio_09::{ +use prio_draft09::{ codec::ParameterizedDecode, field::Field64, flp::{ @@ -523,7 +523,7 @@ pub(crate) fn prio3_draft09_unshard>>( #[cfg(test)] mod test { - use prio_09::vdaf::prio3_test::check_test_vec; + use prio_draft09::vdaf::prio3_test::check_test_vec; use crate::{ hpke::HpkeKemId, diff --git a/crates/daphne/src/vdaf/prio3_latest.rs b/crates/daphne/src/vdaf/prio3_latest.rs index 5f96f8be7..2fac19f9a 100644 --- a/crates/daphne/src/vdaf/prio3_latest.rs +++ b/crates/daphne/src/vdaf/prio3_latest.rs @@ -13,7 +13,7 @@ use crate::{ use super::{prep_finish, prep_finish_from_shares, shard_then_encode, unshard}; -use prio_latest::{ +use prio::{ codec::ParameterizedDecode, field::Field64, flp::{ @@ -32,15 +32,15 @@ use prio_latest::{ const ERR_FIELD_TYPE: &str = "unexpected field type for step or message"; const CTX_STRING: &[u8] = "dap-13".as_bytes(); -type Prio3LatestSumVecField64MultiproofHmacSha256Aes128 = +type Prio3SumVecField64MultiproofHmacSha256Aes128 = Prio3>>, XofHmacSha256Aes128, 32>; -fn new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( +fn new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( bits: usize, length: usize, chunk_length: usize, num_proofs: u8, -) -> Result { +) -> Result { Prio3::new( 2, num_proofs, @@ -117,7 +117,7 @@ pub(crate) fn prio3_shard( }, DapMeasurement::U64Vec(measurement), ) => { - let vdaf = new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( + let vdaf = new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( *bits, *length, *chunk_length, @@ -221,7 +221,7 @@ pub(crate) fn prio3_prep_init( }, VdafVerifyKey::L32(verify_key), ) => { - let vdaf = new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( + let vdaf = new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( *bits, *length, *chunk_length, @@ -360,7 +360,7 @@ pub(crate) fn prio3_prep_finish_from_shares( VdafPrepState::Prio3Field64HmacSha256Aes128(state), VdafPrepShare::Prio3Field64HmacSha256Aes128(share), ) => { - let vdaf = new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( + let vdaf = new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( *bits, *length, *chunk_length, @@ -435,7 +435,7 @@ pub(crate) fn prio3_prep_finish( }, VdafPrepState::Prio3Field64HmacSha256Aes128(state), ) => { - let vdaf = new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( + let vdaf = new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( *bits, *length, *chunk_length, @@ -497,7 +497,7 @@ pub(crate) fn prio3_unshard>>( chunk_length, num_proofs, } => { - let vdaf = new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( + let vdaf = new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( *bits, *length, *chunk_length, @@ -512,15 +512,15 @@ pub(crate) fn prio3_unshard>>( #[cfg(test)] mod test { - use prio_latest::vdaf::prio3_test::check_test_vec; + use prio::vdaf::prio3_test::check_test_vec; use crate::{ hpke::HpkeKemId, test_versions, testing::AggregationJobTest, vdaf::{ - prio3_latest::new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128, - Prio3Config, VdafConfig, + prio3_latest::new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128, Prio3Config, + VdafConfig, }, DapAggregateResult, DapAggregationParam, DapMeasurement, DapVersion, }; @@ -627,7 +627,7 @@ mod test { ] { check_test_vec(test_vec_json_str, |json_params, num_aggregators| { assert_eq!(num_aggregators, 2); - new_prio3_latest_sum_vec_field64_multiproof_hmac_sha256_aes128( + new_prio3_sum_vec_field64_multiproof_hmac_sha256_aes128( json_params["bits"].as_u64().unwrap().try_into().unwrap(), json_params["length"].as_u64().unwrap().try_into().unwrap(), json_params["chunk_length"]