Trait Hinting

Source
pub trait Hinting<K: KeyPair, const L: usize>: Sized {
    // Required methods
    fn new(
        blinded_public_key: &BlindedPublicKey<K>,
        message: &[u8; L],
        salt: &[u8],
        csprng: &mut impl CryptoRngCore,
    ) -> Result<Self, Error>;
    fn from_blinding_factor_secret(
        blinding_factor_secret: &K::SecretKey,
        blinded_public_key: &BlindedPublicKey<K>,
        message: &[u8; L],
        salt: &[u8],
    ) -> Result<Self, Error>;
    fn bytes_length() -> usize;
    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
    fn to_bytes(self) -> Vec<u8> ;
}
Expand description

Semi generic implementations to create new Hints

Required Methods§

Source

fn new( blinded_public_key: &BlindedPublicKey<K>, message: &[u8; L], salt: &[u8], csprng: &mut impl CryptoRngCore, ) -> Result<Self, Error>

Create a new Hint.

Source

fn from_blinding_factor_secret( blinding_factor_secret: &K::SecretKey, blinded_public_key: &BlindedPublicKey<K>, message: &[u8; L], salt: &[u8], ) -> Result<Self, Error>

Create a new Hint using a blinding factor secret.

Source

fn bytes_length() -> usize

Return the underlying Hint’s length when serialized

Source

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

Deserialize from byte slice

Source

fn to_bytes(self) -> Vec<u8>

Serialize to byte vector

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§