Struct fuzzytags::FuzzyDetectionKey[][src]

pub struct FuzzyDetectionKey(_);

A collection of "secret" data that can be used to determine if a FuzzyTag was intended for the derived public key with probability p

Implementations

impl FuzzyDetectionKey[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 FuzzyDetectionKey[src]

pub fn false_positive_probability(&self) -> f64[src]

calculate the ideal false positive rate of this detection key

   use fuzzytags::FuzzySecretKey;
   let gamma = 24;
   let secret_key = FuzzySecretKey::generate(gamma);
   let public_key = secret_key.public_key();
   // extract a detection key
   let detection_key = secret_key.extract(5);
   detection_key.false_positive_probability();

pub fn test_tag(&self, tag: &FuzzyTag) -> bool[src]

returns true if the tag was intended for this key Example:

   use fuzzytags::FuzzySecretKey;
    let gamma = 24;
   let secret_key = FuzzySecretKey::generate(gamma);
   let public_key = secret_key.public_key();
   // extract a detection key
   let detection_key = secret_key.extract(5);

   // Give public key to a another party...
   // and then they can do...
   let tag = public_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 Clone for FuzzyDetectionKey[src]

impl Debug for FuzzyDetectionKey[src]

impl<'de> Deserialize<'de> for FuzzyDetectionKey[src]

impl Display for FuzzyDetectionKey[src]

impl Serialize for FuzzyDetectionKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,