pub trait CryptographyProvider: Sync {
// Required methods
fn seal(
&self,
key_id: u32,
nonce: &[u8],
aad: &[u8],
plaintext: &[u8],
ciphertext_out: &mut [u8],
tag_out: &mut [u8],
) -> TelemetryResult<(usize, usize)>;
fn open(
&self,
key_id: u32,
nonce: &[u8],
aad: &[u8],
ciphertext: &[u8],
tag: &[u8],
plaintext_out: &mut [u8],
) -> TelemetryResult<usize>;
}Expand description
Rust-side AEAD-like payload cryptography provider.
key_id is application-defined. nonce and aad are passed through by the
caller; the provider is responsible for enforcing the algorithm’s expected sizes.
Required Methods§
fn seal( &self, key_id: u32, nonce: &[u8], aad: &[u8], plaintext: &[u8], ciphertext_out: &mut [u8], tag_out: &mut [u8], ) -> TelemetryResult<(usize, usize)>
fn open( &self, key_id: u32, nonce: &[u8], aad: &[u8], ciphertext: &[u8], tag: &[u8], plaintext_out: &mut [u8], ) -> TelemetryResult<usize>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".