Skip to main content

RestrictedCrypto

Struct RestrictedCrypto 

Source
pub struct RestrictedCrypto { /* private fields */ }
Available on (32-bit or 64-bit) and (crate features test-utils) only.
Expand description

A crypto provider that performs all operations via [RustCrypto] but only claims support for an explicit allowlist of ciphersuites.

Trait Implementations§

Source§

impl OpenMlsCrypto for RestrictedCrypto

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 Ciphersuites.
Source§

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

HKDF extract. Read more
Source§

fn hmac( &self, hash_type: HashType, key: &[u8], message: &[u8], ) -> Result<SecretVLBytes, CryptoError>

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 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<(KemOutput, 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§

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

Available on crate feature targeted-messages-draft only.
HPKE single-shot decryption in PSK mode of input with sk_r, using info, aad, psk, and psk_id.
Source§

fn hpke_seal_psk_resolved_aad<F, E>( &self, config: HpkeConfig, pk_r: &[u8], info: &[u8], ptxt: &[u8], psk: &[u8], psk_id: &[u8], aad_builder: F, ) -> Result<HpkeCiphertext, HpkeSealPskResolvedAadError<E>>
where Self: Sized, F: FnOnce(&[u8]) -> Result<Vec<u8>, E>,

Available on crate feature targeted-messages-draft only.
HPKE PSK encryption where the AAD depends on the KEM output. Read more
Source§

fn ff1_aes128_encrypt( &self, key: &[u8; 16], plaintext: u32, ) -> Result<u32, CryptoError>

Available on crate feature virtual-clients-draft only.
FF1-AES128 encryption of a 32-bit value under a 16-byte key. Read more
Source§

fn ff1_aes128_decrypt( &self, key: &[u8; 16], ciphertext: u32, ) -> Result<u32, CryptoError>

Available on crate feature virtual-clients-draft only.
FF1-AES128 decryption of a 32-bit value under a 16-byte key. Read more

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Classify for T

§

type Classified = T

§

fn classify(self) -> T

§

impl<T> Declassify for T

§

type Declassified = T

§

fn declassify(self) -> T

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

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

§

fn vzip(self) -> V