Skip to main content

Aes192Kwp

Struct Aes192Kwp 

Source
pub struct Aes192Kwp;
Expand description

SP 800-38F KWP with AES-24*8, per RFC 5649.

Implementations§

Source§

impl Aes192Kwp

Source

pub const KEY_LEN: usize = 24

Key-encryption key length.

Source

pub const fn wrapped_len(plaintext_len: usize) -> usize

Output length for a given input length: padded up to a multiple of eight, plus the eight-byte header.

Source

pub fn wrap(kek: &[u8], plaintext: &[u8], out: &mut [u8]) -> Result<()>

Wrap data of any length from one byte upwards.

The length is carried in the check value, so unwrapping recovers it exactly. It is not hidden: an observer learns the length to within eight bytes from the ciphertext size alone.

Source

pub fn unwrap(kek: &[u8], ciphertext: &[u8], out: &mut [u8]) -> Result<usize>

Unwrap, returning the recovered length.

out must be large enough for the padded data; the return value says how much of it is real.

Trait Implementations§

Source§

impl Algorithm for Aes192Kwp

Source§

const ID: &'static str = "aes-192-kwp"

Stable ontology identifier for this algorithm.
Source§

const NAME: &'static str = "aes-192-kwp"

Human-facing display name (for example "SHA-256").
Source§

impl SelfTest for Aes192Kwp

Source§

fn self_test() -> Result<()>

RFC 5649 section 6: the twenty-byte published vector, which exercises padding across several blocks.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.