pub trait KeyWrapPadded: Sealed {
// Required methods
fn wrap_with_padding<'output>(
self,
plaintext: &[u8],
output: &'output mut [u8],
) -> Result<&'output mut [u8], Unspecified>;
fn unwrap_with_padding<'output>(
self,
ciphertext: &[u8],
output: &'output mut [u8],
) -> Result<&'output mut [u8], Unspecified>;
}
Expand description
A Key Wrap with Padding (KWP) algorithm implementation.
Required Methods§
Sourcefn wrap_with_padding<'output>(
self,
plaintext: &[u8],
output: &'output mut [u8],
) -> Result<&'output mut [u8], Unspecified>
fn wrap_with_padding<'output>( self, plaintext: &[u8], output: &'output mut [u8], ) -> Result<&'output mut [u8], Unspecified>
Peforms the key wrap padding encryption algorithm using a block cipher.
It wraps and pads plaintext
writes the corresponding ciphertext to output
.
§Errors
Unspecified
: Any error that has occurred performing the operation.
Sourcefn unwrap_with_padding<'output>(
self,
ciphertext: &[u8],
output: &'output mut [u8],
) -> Result<&'output mut [u8], Unspecified>
fn unwrap_with_padding<'output>( self, ciphertext: &[u8], output: &'output mut [u8], ) -> Result<&'output mut [u8], Unspecified>
Peforms the key wrap padding decryption algorithm using a block cipher.
It unwraps the padded ciphertext
and writes the corresponding plaintext to output
.
§Errors
Unspecified
: Any error that has occurred performing the operation.