/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::error::Error; use std::io::Cursor;
use log::{debug, warn};
use prio::field::Field128; use prio::vdaf::prio3::{Prio3Histogram, Prio3Sum, Prio3SumVec}; use prio::vdaf::prio3::{Prio3InputShare, Prio3PublicShare}; use thin_vec::ThinVec;
pubmod types; use types::HpkeConfig; use types::PlaintextInputShare; use types::Report; use types::ReportID; use types::ReportMetadata; use types::Time;
use prio::codec::Encode; use prio::codec::{decode_u16_items, encode_u32_items}; use prio::vdaf::Client;
for config in hpke_configs { if config.kem_id == SUPPORTED_KEM
&& config.kdf_id == SUPPORTED_KDF
&& config.aead_id == SUPPORTED_AEAD
{ return Ok(config);
}
}
Err("No suitable HPKE config found.".into())
}
/// This function creates a full report - ready to send - for a measurement. /// /// To do that it also needs the HPKE configurations for the endpoints and some /// additional data which is part of the authentication. fn get_dap_report_internal<T: Shardable>(
leader_hpke_config_encoded: &ThinVec<u8>,
helper_hpke_config_encoded: &ThinVec<u8>,
measurement: &T,
task_id: &ThinVec<u8>,
time_precision: u64,
) -> Result<Report, Box<dyn std::error::Error>> { let leader_hpke_config = select_hpke_config(leader_hpke_config_encoded)?; let helper_hpke_config = select_hpke_config(helper_hpke_config_encoded)?;
let report_id = ReportID::generate(); let (encoded_public_share, encoded_input_shares) = measurement.shard(report_id.as_ref())?;
let time = Time::generate(time_precision); let metadata = ReportMetadata { report_id, time };
// This quote from the standard describes which info and aad to use for the encryption: // enc, payload = SealBase(pk, // "dap-09 input share" || 0x01 || server_role, // input_share_aad, plaintext_input_share) // https://www.ietf.org/archive/id/draft-ietf-ppm-dap-09.html#name-upload-request letmut info = b"dap-09 input share\x01".to_vec();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.