pub struct EX {}Expand description
The ARX-KW-8-2-4-EX variant. Has a key length of 48 bytes and a maximum input length of one MiB.
See the ArxKW trait for usage.
Implementations§
Trait Implementations§
Source§impl ArxKW for EX
impl ArxKW for EX
Source§const VARIANT_ID: u8 = 3
const VARIANT_ID: u8 = 3
Stable identifier stored in versioned envelopes (1=E, 2=G, 3=EX, 4=GX).
Source§type Key = [u8; 48]
type Key = [u8; 48]
The type of data which is used as a key for the type that
impls this trait.
Note that this is not the same for all variants of ARX-KW. E and EX use 48-byte keys; G and GX use 32-byte keysSource§fn decrypt(
key: &Self::Key,
ciphertext: &[u8],
authentication_tag: &AuthTag,
) -> Result<Vec<u8>, ArxKwError>
fn decrypt( key: &Self::Key, ciphertext: &[u8], authentication_tag: &AuthTag, ) -> Result<Vec<u8>, ArxKwError>
Attempts to decrypt the ciphertext using ARX-KW and returns the decrypted plaintext if
successful. As ARX-KW is a form of authenticated encryption, the authenticity of the
decrypted text is verified if the function returns an
Ok value. Read moreSource§const MAX_INPUT_LENGTH: usize = MAX_INPUT_LENGTH
const MAX_INPUT_LENGTH: usize = MAX_INPUT_LENGTH
Maximum plaintext or ciphertext length accepted before allocation.
Source§fn encrypt_envelope(
key: &Self::Key,
plaintext: &[u8],
context: &[u8],
) -> Result<Vec<u8>, ArxKwError>
fn encrypt_envelope( key: &Self::Key, plaintext: &[u8], context: &[u8], ) -> Result<Vec<u8>, ArxKwError>
Wraps key material into a versioned envelope bound to an application context.
Available with the
envelope feature (enabled by default). Read moreSource§fn decrypt_envelope(
key: &Self::Key,
input: &[u8],
context: &[u8],
) -> Result<SecretBytes, ArxKwError>
fn decrypt_envelope( key: &Self::Key, input: &[u8], context: &[u8], ) -> Result<SecretBytes, ArxKwError>
Opens a versioned envelope into plaintext that zeroizes when dropped.
Available with the
envelope feature (enabled by default). Read moreSource§fn decrypt_secret(
key: &Self::Key,
blob: &[u8],
) -> Result<SecretBytes, ArxKwError>
fn decrypt_secret( key: &Self::Key, blob: &[u8], ) -> Result<SecretBytes, ArxKwError>
Decrypts a legacy blob into plaintext that zeroizes when dropped. Read more
Source§fn encrypt_blob(
key: &Self::Key,
plaintext: &[u8],
) -> Result<Vec<u8>, ArxKwError>
fn encrypt_blob( key: &Self::Key, plaintext: &[u8], ) -> Result<Vec<u8>, ArxKwError>
Source§fn decrypt_blob(key: &Self::Key, blob: &[u8]) -> Result<Vec<u8>, ArxKwError>
fn decrypt_blob(key: &Self::Key, blob: &[u8]) -> Result<Vec<u8>, ArxKwError>
Decrypts a blob containing an authentication tag followed by the corresponding ciphertext Read more
Auto Trait Implementations§
impl Freeze for EX
impl RefUnwindSafe for EX
impl Send for EX
impl Sync for EX
impl Unpin for EX
impl UnsafeUnpin for EX
impl UnwindSafe for EX
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