Skip to main content

Hint

Struct Hint 

Source
pub struct Hint<K: KeyPair, A: Aead + KeyInit, L: ArraySize>
where Self: HintSized<K, A, L>,
{ /* private fields */ }
Expand description

Message encrypted by a third party, decryptable by an anonymous recipient that doesn’t know whether it is addressed to them or not.

Trait Implementations§

Source§

impl<K: Clone + KeyPair, A: Clone + Aead + KeyInit, L: Clone + ArraySize> Clone for Hint<K, A, L>
where Self: HintSized<K, A, L>, K::PublicKey: Clone,

Source§

fn clone(&self) -> Hint<K, A, L>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug + KeyPair, A: Debug + Aead + KeyInit, L: Debug + ArraySize> Debug for Hint<K, A, L>
where Self: HintSized<K, A, L>, K::PublicKey: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: KeyPair, A: Aead + KeyInit, L: ArraySize> HintSized<K, A, L> for Hint<K, A, L>
where <A as AeadCore>::TagSize: Add<L>, <<A as AeadCore>::TagSize as Add<L>>::Output: ArraySize, <K as KeyPair>::PublicKeySize: Add<Sum<<A as AeadCore>::TagSize, L>>, <<K as KeyPair>::PublicKeySize as Add<Sum<<A as AeadCore>::TagSize, L>>>::Output: ArraySize,

Source§

type CiphertextSize = <<A as AeadCore>::TagSize as Add<L>>::Output

Ciphertext size: AEAD tag size plus message length.
Source§

type Size = <<K as KeyPair>::PublicKeySize as Add<<<A as AeadCore>::TagSize as Add<L>>::Output>>::Output

Total hint size: public key size plus ciphertext size.
Source§

impl<A: Aead + KeyInit, L: ArraySize> Hinting<DalekRistretto255, L> for Hint<DalekRistretto255, A, L>
where Self: HintSized<DalekRistretto255, A, L>,

Source§

type HintSize = <Hint<DalekRistretto255, A, L> as HintSized<DalekRistretto255, A, L>>::Size

Byte length of a serialized Hint: public key + ciphertext + tag.
Source§

fn new( blinded_public_key: &BlindedPublicKey<DalekRistretto255>, message: &Array<u8, L>, context: &[u8], csprng: &mut impl CryptoRng, ) -> Result<Self, Error>

Create a new Hint.
Source§

fn from_blinding_factor_secret( blinding_factor_secret: &StaticSecret, blinded_public_key: &BlindedPublicKey<DalekRistretto255>, message: &Array<u8, L>, context: &[u8], ) -> Result<Self, Error>

Create a new Hint using a blinding factor secret.
Source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from byte slice Read more
Source§

fn to_bytes(self) -> Array<u8, Self::HintSize>

Serialize to byte array
Source§

impl<A: Aead + KeyInit, L: ArraySize> Hinting<DalekX25519, L> for Hint<DalekX25519, A, L>
where Self: HintSized<DalekX25519, A, L>,

Source§

type HintSize = <Hint<DalekX25519, A, L> as HintSized<DalekX25519, A, L>>::Size

Byte length of a serialized Hint: public key + ciphertext + tag.
Source§

fn new( blinded_public_key: &BlindedPublicKey<DalekX25519>, message: &Array<u8, L>, context: &[u8], csprng: &mut impl CryptoRng, ) -> Result<Self, Error>

Create a new Hint.
Source§

fn from_blinding_factor_secret( blinding_factor_secret: &StaticSecret, blinded_public_key: &BlindedPublicKey<DalekX25519>, message: &Array<u8, L>, context: &[u8], ) -> Result<Self, Error>

Create a new Hint using a blinding factor secret.
Source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from byte slice Read more
Source§

fn to_bytes(self) -> Array<u8, Self::HintSize>

Serialize to byte array
Source§

impl<A: Aead + KeyInit, C: CurveArithmetic + PointCompression, L: ArraySize> Hinting<EllipticCurve<C>, L> for Hint<EllipticCurve<C>, A, L>

Available on crate feature rustcrypto-ec only.
Source§

type HintSize = <Hint<EllipticCurve<C>, A, L> as HintSized<EllipticCurve<C>, A, L>>::Size

Byte length of a serialized Hint: public key + ciphertext + tag.
Source§

fn new( blinded_public_key: &BlindedPublicKey<EllipticCurve<C>>, message: &Array<u8, L>, context: &[u8], csprng: &mut impl CryptoRng, ) -> Result<Self, Error>

Create a new Hint.
Source§

fn from_blinding_factor_secret( blinding_factor_secret: &SecretKey<C>, blinded_public_key: &BlindedPublicKey<EllipticCurve<C>>, message: &Array<u8, L>, context: &[u8], ) -> Result<Self, Error>

Create a new Hint using a blinding factor secret.
Source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Deserialize from byte slice Read more
Source§

fn to_bytes(self) -> Array<u8, Self::HintSize>

Serialize to byte array
Source§

impl<K: KeyPair, A: Aead + KeyInit, L: ArraySize> TryFrom<&[u8]> for Hint<K, A, L>
where Self: Hinting<K, L> + HintSized<K, A, L>,

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8]) -> Result<Self, Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<K, A, L> !Freeze for Hint<K, A, L>

§

impl<K, A, L> !RefUnwindSafe for Hint<K, A, L>

§

impl<K, A, L> Send for Hint<K, A, L>
where Hint<K, A, L>: Sized, <K as KeyPair>::PublicKey: Send, A: Send,

§

impl<K, A, L> Sync for Hint<K, A, L>
where Hint<K, A, L>: Sized, <K as KeyPair>::PublicKey: Sync, A: Sync,

§

impl<K, A, L> !Unpin for Hint<K, A, L>

§

impl<K, A, L> !UnsafeUnpin for Hint<K, A, L>

§

impl<K, A, L> !UnwindSafe for Hint<K, A, L>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.