pub struct RustCrypto { /* private fields */ }Expand description
The type that implements
- key generation
- AEAD encryption & decryption
- signing & signature verification
- HPKE operations
Trait Implementations§
Source§impl Clone for RustCrypto
impl Clone for RustCrypto
Source§fn clone(&self) -> RustCrypto
fn clone(&self) -> RustCrypto
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RustCrypto
impl Debug for RustCrypto
Source§impl Default for RustCrypto
impl Default for RustCrypto
Source§impl OpenMlsCrypto for RustCrypto
impl OpenMlsCrypto for RustCrypto
Source§fn signature_key_gen(
&self,
alg: SignatureScheme,
) -> Result<(Vec<u8>, Vec<u8>), CryptoError>
fn signature_key_gen( &self, alg: SignatureScheme, ) -> Result<(Vec<u8>, Vec<u8>), CryptoError>
Generate a (secret key, public key) pair from a signature scheme.
Source§fn signature_public_key_len(&self, signature_scheme: SignatureScheme) -> usize
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>
fn supports(&self, ciphersuite: Ciphersuite) -> Result<(), CryptoError>
Check whether the
Ciphersuite is supported by the backend or not. Read moreSource§fn supported_ciphersuites(&self) -> Vec<Ciphersuite>
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>
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>
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>
fn hash(&self, hash_type: HashType, data: &[u8]) -> Result<Vec<u8>, CryptoError>
Hash the
data. Read moreSource§fn aead_encrypt(
&self,
alg: AeadType,
key: &[u8],
data: &[u8],
nonce: &[u8],
aad: &[u8],
) -> Result<Vec<u8>, CryptoError>
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>
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 validate_signature_key(
&self,
alg: SignatureScheme,
key: &[u8],
) -> Result<(), CryptoError>
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>
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>
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>
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>
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>
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>
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>
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
impl OpenMlsRand for RustCrypto
type Error = MlsProviderError
type RandImpl = ChaCha20Rng
type BorrowTarget<'a> = RwLockWriteGuard<'a, <RustCrypto as OpenMlsRand>::RandImpl>
fn borrow_rand(&self) -> Result<Self::BorrowTarget<'_>, Self::Error>
Auto Trait Implementations§
impl Freeze for RustCrypto
impl RefUnwindSafe for RustCrypto
impl Send for RustCrypto
impl Sync for RustCrypto
impl Unpin for RustCrypto
impl UnsafeUnpin for RustCrypto
impl UnwindSafe for RustCrypto
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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