pub struct ReportAuthorizationKey { /* private fields */ }Expand description
Authorizes publication of a report of potential exposure.
Implementations§
Source§impl ReportAuthorizationKey
impl ReportAuthorizationKey
Sourcepub fn new<R: RngCore + CryptoRng>(rng: R) -> ReportAuthorizationKey
pub fn new<R: RngCore + CryptoRng>(rng: R) -> ReportAuthorizationKey
Initialize a new report authorization key from a random number generator.
Sourcepub fn initial_temporary_contact_key(&self) -> TemporaryContactKey
pub fn initial_temporary_contact_key(&self) -> TemporaryContactKey
Compute the initial temporary contact key derived from this report authorization key.
Note: this function returns tck_1, the first temporary contact key that can be
used to generate tcks.
Source§impl ReportAuthorizationKey
impl ReportAuthorizationKey
Sourcepub fn create_report(
&self,
memo_type: MemoType,
memo_data: Vec<u8>,
j_1: u16,
j_2: u16,
) -> Result<SignedReport, Error>
pub fn create_report( &self, memo_type: MemoType, memo_data: Vec<u8>, j_1: u16, j_2: u16, ) -> Result<SignedReport, Error>
Create a report of potential exposure.
§Inputs
memo_type,memo_data: the type and data for the report’s memo field.j_1 > 0: the ratchet index of the first temporary contact number in the report.j_2: the ratchet index of the last temporary contact number other users should check.
§Notes
Creating a report reveals all temporary contact numbers subsequent to
j_1, not just up to j_2, which is included for convenience.
The memo_data must be less than 256 bytes long.
Reports are unlinkable from each other only up to the memo field. In other words, adding the same high-entropy data to the memo fields of multiple reports will cause them to be linkable.
Trait Implementations§
Source§impl Clone for ReportAuthorizationKey
impl Clone for ReportAuthorizationKey
Source§fn clone(&self) -> ReportAuthorizationKey
fn clone(&self) -> ReportAuthorizationKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReportAuthorizationKey
impl Debug for ReportAuthorizationKey
impl Copy for ReportAuthorizationKey
Auto Trait Implementations§
impl Freeze for ReportAuthorizationKey
impl RefUnwindSafe for ReportAuthorizationKey
impl Send for ReportAuthorizationKey
impl Sync for ReportAuthorizationKey
impl Unpin for ReportAuthorizationKey
impl UnwindSafe for ReportAuthorizationKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more