Struct fuzzytags::DetectionKey [−][src]
A collection of "secret" data that can be used to determine if a FuzzyTag
was intended for
the derived tagging key with probability p
Implementations
impl<const GAMMA: u8> DetectionKey<{ GAMMA }>
[src]
pub fn id(&self) -> String
[src]
a convenient id for a detection key for internal accounting purposes do not expose this to applications
impl<const GAMMA: u8> DetectionKey<{ GAMMA }>
[src]
pub fn false_positive_probability(&self) -> f64
[src]
calculate the ideal false positive rate of this detection key
use fuzzytags::RootSecret; let secret = RootSecret::<24>::generate(); let tagging_key = secret.tagging_key(); // extract a detection key let detection_key = secret.extract_detection_key(5); detection_key.false_positive_probability();
pub fn test_tag(&self, tag: &Tag<{ GAMMA }>) -> bool
[src]
returns true if the tag was intended for this key Example:
use fuzzytags::RootSecret; let secret = RootSecret::<24>::generate(); let tagging_key = secret.tagging_key(); // extract a detection key let detection_key = secret.extract_detection_key(5); // Give tagging key to a another party... // and then they can do... let tag = tagging_key.generate_tag(); // The server can now do this: if detection_key.test_tag(&tag) { // the message attached to this tag *might* be for the party associated with the detection key } else { // the message attached to this tag is definitely *not* for the party associated with the detection key. }
Trait Implementations
impl<const GAMMA: u8> Clone for DetectionKey<GAMMA>
[src]
fn clone(&self) -> DetectionKey<GAMMA>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<const GAMMA: u8> Debug for DetectionKey<GAMMA>
[src]
impl<'de, const GAMMA: u8> Deserialize<'de> for DetectionKey<GAMMA>
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<const GAMMA: u8> Display for DetectionKey<{ GAMMA }>
[src]
impl<const GAMMA: u8> Serialize for DetectionKey<GAMMA>
[src]
Auto Trait Implementations
impl<const GAMMA: u8> RefUnwindSafe for DetectionKey<GAMMA>
[src]
impl<const GAMMA: u8> Send for DetectionKey<GAMMA>
[src]
impl<const GAMMA: u8> Sync for DetectionKey<GAMMA>
[src]
impl<const GAMMA: u8> Unpin for DetectionKey<GAMMA>
[src]
impl<const GAMMA: u8> UnwindSafe for DetectionKey<GAMMA>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,