aws_lc_rs::key_wrap

Trait KeyWrap

Source
pub trait KeyWrap: Sealed {
    // Required methods
    fn wrap<'output>(
        self,
        plaintext: &[u8],
        output: &'output mut [u8],
    ) -> Result<&'output mut [u8], Unspecified>;
    fn unwrap<'output>(
        self,
        ciphertext: &[u8],
        output: &'output mut [u8],
    ) -> Result<&'output mut [u8], Unspecified>;
}
Expand description

A Key Wrap (KW) algorithm implementation.

Required Methods§

Source

fn wrap<'output>( self, plaintext: &[u8], output: &'output mut [u8], ) -> Result<&'output mut [u8], Unspecified>

Peforms the key wrap encryption algorithm using a block cipher. It wraps plaintext and writes the corresponding ciphertext to output.

§Errors
  • Unspecified: Any error that has occurred performing the operation.
Source

fn unwrap<'output>( self, ciphertext: &[u8], output: &'output mut [u8], ) -> Result<&'output mut [u8], Unspecified>

Peforms the key wrap decryption algorithm using a block cipher. It unwraps ciphertext and writes the corresponding plaintext to output.

§Errors
  • Unspecified: Any error that has occurred performing the operation.

Implementors§