Skip to main content

CbcMac

Struct CbcMac 

Source
pub struct CbcMac<C: BlockCipherEncrypt + Clone> { /* private fields */ }
Expand description

Generic CBC-MAC instance.

Trait Implementations§

Source§

impl<C> AlgorithmName for CbcMac<C>

Source§

fn write_alg_name(f: &mut Formatter<'_>) -> Result

Write algorithm name into f.
Source§

impl<C: BlockCipherEncrypt + Clone> BlockSizeUser for CbcMac<C>

Source§

type BlockSize = <CbcMacCore<C> as BlockSizeUser>::BlockSize

Size of the block in bytes.
Source§

fn block_size() -> usize

Return block size in bytes.
Source§

impl<C: BlockCipherEncrypt + Clone> Clone for CbcMac<C>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: BlockCipherEncrypt + Clone> CoreProxy for CbcMac<C>

Source§

type Core = CbcMacCore<C>

Core block-level type.
Source§

fn compose(core: Self::Core, buffer: Buffer<Self::Core>) -> Self

Create Self from core and buffer.
Source§

fn decompose(self) -> (Self::Core, Buffer<Self::Core>)

Decompose self into core and buffer.
Source§

impl<C: BlockCipherEncrypt + Clone> Debug for CbcMac<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: BlockCipherEncrypt + Clone> FixedOutput for CbcMac<C>

Source§

fn finalize_into(self, out: &mut Output<Self>)

Consume value and write result into provided array.
Source§

fn finalize_fixed(self) -> Array<u8, Self::OutputSize>

Retrieve result and consume the hasher instance.
Source§

impl<C: BlockCipherEncrypt + Clone> FixedOutputReset for CbcMac<C>

Source§

fn finalize_into_reset(&mut self, out: &mut Output<Self>)

Write result into provided array and reset the hasher state.
Source§

fn finalize_fixed_reset(&mut self) -> Array<u8, Self::OutputSize>

Retrieve result and reset the hasher state.
Source§

impl<C: BlockCipherEncrypt + Clone> InnerInit for CbcMac<C>

Source§

fn inner_init(inner: Self::Inner) -> Self

Initialize value from the inner.
Source§

impl<C: BlockCipherEncrypt + Clone> InnerUser for CbcMac<C>

Source§

type Inner = <CbcMacCore<C> as InnerUser>::Inner

Inner type.
Source§

impl<C: BlockCipherEncrypt + Clone> OutputSizeUser for CbcMac<C>

Source§

type OutputSize = <CbcMacCore<C> as OutputSizeUser>::OutputSize

Size of the output in bytes.
Source§

fn output_size() -> usize

Return output size in bytes.
Source§

impl<C: BlockCipherEncrypt + Clone> Reset for CbcMac<C>

Source§

fn reset(&mut self)

Reset state to its initial value.
Source§

impl<C: BlockCipherEncrypt + Clone> Update for CbcMac<C>

Source§

fn update(&mut self, data: &[u8])

Update state using the provided data.
Source§

fn chain(self, data: impl AsRef<[u8]>) -> Self
where Self: Sized,

Digest input data in a chained manner.
Source§

impl<C: BlockCipherEncrypt + Clone> MacMarker for CbcMac<C>

Auto Trait Implementations§

§

impl<C> Freeze for CbcMac<C>

§

impl<C> RefUnwindSafe for CbcMac<C>

§

impl<C> Send for CbcMac<C>
where C: Send,

§

impl<C> Sync for CbcMac<C>
where C: Sync,

§

impl<C> Unpin for CbcMac<C>

§

impl<C> UnwindSafe for CbcMac<C>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<D> DynDigest for D
where D: Update + FixedOutputReset + Reset + Clone + 'static,

Source§

fn update(&mut self, data: &[u8])

Digest input data. Read more
Source§

fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>

Write result into provided array and consume the hasher instance. Read more
Source§

fn finalize_into_reset( &mut self, buf: &mut [u8], ) -> Result<(), InvalidBufferSize>

Write result into provided array and reset the hasher instance. Read more
Source§

fn reset(&mut self)

Reset hasher instance to its initial state.
Source§

fn output_size(&self) -> usize

Get output size of the hasher
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> KeyInit for T
where T: InnerInit, <T as InnerUser>::Inner: KeyInit,

Source§

fn new(key: &Array<u8, <T as KeySizeUser>::KeySize>) -> T

Create new value from fixed size key.
Source§

fn new_from_slice(key: &[u8]) -> Result<T, InvalidLength>

Create new value from variable size key.
Source§

impl<T> KeySizeUser for T
where T: InnerUser, <T as InnerUser>::Inner: KeySizeUser,

Source§

type KeySize = <<T as InnerUser>::Inner as KeySizeUser>::KeySize

Key size in bytes.
Source§

fn key_size() -> usize

Return key size in bytes.
Source§

impl<T> Mac for T

Source§

fn update(&mut self, data: &[u8])

Update state using the provided data.
Source§

fn chain_update(self, data: impl AsRef<[u8]>) -> T

Process input data in a chained manner.
Source§

fn finalize(self) -> CtOutput<T>

Obtain the result of a Mac computation as a CtOutput and consume Mac instance.
Source§

fn finalize_reset(&mut self) -> CtOutput<T>

Obtain the result of a Mac computation as a CtOutput and reset Mac instance.
Source§

fn reset(&mut self)
where T: Reset,

Reset MAC instance to its initial state.
Source§

fn verify( self, tag: &Array<u8, <T as OutputSizeUser>::OutputSize>, ) -> Result<(), MacError>

Check if tag/code value is correct for the processed input.
Source§

fn verify_reset( &mut self, tag: &Array<u8, <T as OutputSizeUser>::OutputSize>, ) -> Result<(), MacError>

Check if tag/code value is correct for the processed input and reset Mac instance.
Source§

fn verify_slice(self, tag: &[u8]) -> Result<(), MacError>

Check truncated tag correctness using all bytes of calculated tag. Read more
Source§

fn verify_slice_reset(&mut self, tag: &[u8]) -> Result<(), MacError>

Check truncated tag correctness using all bytes of calculated tag and reset Mac instance. Read more
Source§

fn verify_truncated_left(self, tag: &[u8]) -> Result<(), MacError>

Check truncated tag correctness using left side bytes (i.e. tag[..n]) of calculated tag. Read more
Source§

fn verify_truncated_right(self, tag: &[u8]) -> Result<(), MacError>

Check truncated tag correctness using right side bytes (i.e. tag[n..]) of calculated tag. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.