Skip to main content

Hinting

Trait Hinting 

Source
pub trait Hinting<K: KeyPair, L: ArraySize>: Sized {
    type HintSize: ArraySize;

    // Required methods
    fn new(
        blinded_public_key: &BlindedPublicKey<K>,
        message: &Array<u8, L>,
        context: &[u8],
        csprng: &mut impl CryptoRng,
    ) -> Result<Self, Error>;
    fn from_blinding_factor_secret(
        blinding_factor_secret: &K::SecretKey,
        blinded_public_key: &BlindedPublicKey<K>,
        message: &Array<u8, L>,
        context: &[u8],
    ) -> Result<Self, Error>;
    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
    fn to_bytes(self) -> Array<u8, Self::HintSize>;
}
Expand description

Semi generic implementations to create new Hints

Required Associated Types§

Source

type HintSize: ArraySize

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

Required Methods§

Source

fn new( blinded_public_key: &BlindedPublicKey<K>, 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: &K::SecretKey, blinded_public_key: &BlindedPublicKey<K>, 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

§Security

Implementers must validate the deserialized blinded blinding factor and reject small-order and identity points with Error::InvalidPoint.

Source

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

Serialize to byte array

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§