Struct mls_crypto_provider::RustCrypto

source ·
pub struct RustCrypto { /* private fields */ }

Implementations§

source§

impl RustCrypto

source

pub fn new_with_seed(seed: EntropySeed) -> Self

source

pub fn normalize_p521_secret_key(sk: &[u8]) -> Zeroizing<[u8; 66]>

source

pub fn normalize_ed25519_key(key: &[u8]) -> Result<SigningKey, CryptoError>

Trait Implementations§

source§

impl Debug for RustCrypto

source§

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

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

impl Default for RustCrypto

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl OpenMlsCrypto for RustCrypto

source§

fn signature_public_key_len(&self, signature_scheme: SignatureScheme) -> usize

Gives the length of a signature public key, in bytes
source§

fn supports(&self, ciphersuite: Ciphersuite) -> Result<(), CryptoError>

Check whether the [Ciphersuite] is supported by the backend or not. Read more
source§

fn supported_ciphersuites(&self) -> Vec<Ciphersuite>

Returns the list of supported [Ciphersuite]s.
source§

fn hkdf_extract( &self, hash_type: HashType, salt: &[u8], ikm: &[u8], ) -> Result<SecretVLBytes, CryptoError>

HKDF extract. Read more
source§

fn hkdf_expand( &self, hash_type: HashType, prk: &[u8], info: &[u8], okm_len: usize, ) -> Result<SecretVLBytes, CryptoError>

HKDF expand. Read more
source§

fn hash(&self, hash_type: HashType, data: &[u8]) -> Result<Vec<u8>, CryptoError>

Hash the data. Read more
source§

fn aead_encrypt( &self, alg: AeadType, key: &[u8], data: &[u8], nonce: &[u8], aad: &[u8], ) -> Result<Vec<u8>, CryptoError>

AEAD encrypt with the given parameters. Read more
source§

fn aead_decrypt( &self, alg: AeadType, key: &[u8], ct_tag: &[u8], nonce: &[u8], aad: &[u8], ) -> Result<Vec<u8>, CryptoError>

AEAD decrypt with the given parameters. Read more
source§

fn signature_key_gen( &self, alg: SignatureScheme, ) -> Result<(Vec<u8>, Vec<u8>), CryptoError>

Generate a signature key. Read more
source§

fn validate_signature_key( &self, alg: SignatureScheme, key: &[u8], ) -> Result<(), CryptoError>

Parses and validate a signature public key
source§

fn verify_signature( &self, alg: SignatureScheme, data: &[u8], pk: &[u8], signature: &[u8], ) -> Result<(), CryptoError>

Verify the signature Read more
source§

fn sign( &self, alg: SignatureScheme, data: &[u8], key: &[u8], ) -> Result<Vec<u8>, CryptoError>

Sign with the given parameters. Read more
source§

fn hpke_seal( &self, config: HpkeConfig, pk_r: &[u8], info: &[u8], aad: &[u8], ptxt: &[u8], ) -> Result<HpkeCiphertext, CryptoError>

HPKE single-shot encryption of ptxt to pk_r, using info and aad.
source§

fn hpke_open( &self, config: HpkeConfig, input: &HpkeCiphertext, sk_r: &[u8], info: &[u8], aad: &[u8], ) -> Result<Vec<u8>, CryptoError>

HPKE single-shot decryption of input with sk_r, using info and aad.
source§

fn hpke_setup_sender_and_export( &self, config: HpkeConfig, pk_r: &[u8], info: &[u8], exporter_context: &[u8], exporter_length: usize, ) -> Result<(Vec<u8>, ExporterSecret), CryptoError>

HPKE single-shot setup of a sender and immediate export a secret. Read more
source§

fn hpke_setup_receiver_and_export( &self, config: HpkeConfig, enc: &[u8], sk_r: &[u8], info: &[u8], exporter_context: &[u8], exporter_length: usize, ) -> Result<ExporterSecret, CryptoError>

HPKE single-shot setup of a receiver and immediate export a secret. Read more
source§

fn derive_hpke_keypair( &self, config: HpkeConfig, ikm: &[u8], ) -> Result<HpkeKeyPair, CryptoError>

Derive a new HPKE keypair from a given input key material.
source§

impl OpenMlsRand for RustCrypto

source§

type Error = MlsProviderError

source§

type RandImpl = ChaCha20Rng

source§

type BorrowTarget<'a> = RwLockWriteGuard<'a, <RustCrypto as OpenMlsRand>::RandImpl>

source§

fn borrow_rand(&self) -> Result<Self::BorrowTarget<'_>, Self::Error>

source§

fn random_array<const N: usize>(&self) -> Result<[u8; N], Self::Error>

Fill an array with random bytes.
source§

fn random_vec(&self, len: usize) -> Result<Vec<u8>, Self::Error>

Fill a vector of length len with bytes.

Auto Trait Implementations§

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V