pub trait PRF {
type Input: Clone + CanonicalDeserialize;
type Output: Clone + Debug + PartialEq + Eq + CanonicalSerialize;
type Seed: Clone + Debug + Default + UniformRand + CanonicalSerialize + CanonicalDeserialize;
type Error: Error;
// Required method
fn evaluate<S: Borrow<Self::Seed>, I: Borrow<Self::Input>>(
seed: S,
input: I,
) -> Result<Self::Output, Self::Error>;
// Provided method
fn evaluate_with_rand_seed<R: RngCore + CryptoRng, T: Borrow<Self::Input>>(
rng: &mut R,
input: T,
) -> Result<(Self::Seed, Self::Output), Self::Error> { ... }
}
Expand description
Trait for Pseudo-random Functions
Required Associated Types§
Required Methods§
Provided Methods§
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.