Sha224Context

Struct Sha224Context 

Source
pub struct Sha224Context(/* private fields */);
Expand description

A SHA-224 context.

Implementations§

Source§

impl Sha224Context

Source

pub fn new() -> Self

Creates a new context.

The context represents the in-progress processing of a single message. You need to feed message bytes to Self::update, then finalize the process using Self::finalize.

Any number of contexts can be created, to hash any number of messages concurrently.

Source

pub fn update<'t>(&'t mut self, data: &'t [u8]) -> ShaHandle<'t>

Hashes data.

Source

pub fn finalize<'t>(&'t mut self, result: &mut [u8; 28]) -> ShaHandle<'t>

Finishes the hashing process, writes the final hash to result.

Resets the context to an empty state.

Source

pub fn finalize_into_slice<'t>( &'t mut self, result: &mut [u8], ) -> Result<ShaHandle<'t>, FinalizeError>

Finishes the hashing process, writes the final hash to result.

Resets the context to an empty state.

Returns FinalizeError::BufferTooSmall if result is not large enough to hold the final hash.

Trait Implementations§

Source§

impl Default for Sha224Context

Available on crate feature unstable only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FixedOutput for Sha224Context

Available on crate feature unstable only.
Source§

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

Consume value and write result into provided array.
Source§

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

Retrieve result and consume the hasher instance.
Source§

impl OutputSizeUser for Sha224Context

Available on crate feature unstable only.
Source§

type OutputSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>

Size of the output in bytes.
Source§

fn output_size() -> usize

Return output size in bytes.
Source§

impl Update for Sha224Context

Available on crate feature unstable only.
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 HashMarker for Sha224Context

Available on crate feature unstable only.

Auto Trait Implementations§

§

impl Freeze for Sha224Context

§

impl RefUnwindSafe for Sha224Context

§

impl !Send for Sha224Context

§

impl !Sync for Sha224Context

§

impl Unpin for Sha224Context

§

impl UnwindSafe for Sha224Context

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
Source§

impl<D> Digest for D
where D: FixedOutput + Default + Update + HashMarker,

Source§

fn new() -> D

Create new hasher instance.
Source§

fn new_with_prefix(data: impl AsRef<[u8]>) -> D
where D: Default,

Create new hasher instance which has processed the provided data.
Source§

fn update(&mut self, data: impl AsRef<[u8]>)

Process data, updating the internal state.
Source§

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

Process input data in a chained manner.
Source§

fn finalize(self) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>

Retrieve result and consume hasher instance.
Source§

fn finalize_into( self, out: &mut GenericArray<u8, <D as OutputSizeUser>::OutputSize>, )

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

fn finalize_reset( &mut self, ) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>

Retrieve result and reset hasher instance.
Source§

fn finalize_into_reset( &mut self, out: &mut GenericArray<u8, <D as OutputSizeUser>::OutputSize>, )

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

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

Reset hasher instance to its initial state.
Source§

fn output_size() -> usize

Get output size of the hasher
Source§

fn digest( data: impl AsRef<[u8]>, ) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>

Compute hash of data.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.