Struct fuzzytags::DetectionKey [−][src]
pub struct DetectionKey<const GAMMA: u8>(_);
Expand description
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
calculate the ideal false positive rate of this detection key
use fuzzytags::RootSecret; use rand::rngs::OsRng; let mut rng = OsRng; let secret = RootSecret::<24>::generate(&mut rng); let tagging_key = secret.tagging_key(); // extract a detection key let detection_key = secret.extract_detection_key(5); detection_key.false_positive_probability();
returns true if the tag was intended for this key Example:
use fuzzytags::RootSecret; use rand::rngs::OsRng; let mut rng = OsRng; let secret = RootSecret::<24>::generate(&mut rng); 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(&mut rng); // 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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<const GAMMA: u8> RefUnwindSafe for DetectionKey<GAMMA>
impl<const GAMMA: u8> Send for DetectionKey<GAMMA>
impl<const GAMMA: u8> Sync for DetectionKey<GAMMA>
impl<const GAMMA: u8> Unpin for DetectionKey<GAMMA>
impl<const GAMMA: u8> UnwindSafe for DetectionKey<GAMMA>
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self