pub struct SHA512Internal<PARAMS: SHA2Params> { /* private fields */ }Expand description
Internal struct for SHA512. This uses a private bound so that you cannot instantiate it directly and have to use the provided and NIST-approved parameters.
Implementations§
Source§impl<PARAMS: SHA2Params> SHA512Internal<PARAMS>
impl<PARAMS: SHA2Params> SHA512Internal<PARAMS>
Trait Implementations§
Source§impl<PARAMS: SHA2Params> Algorithm for SHA512Internal<PARAMS>
impl<PARAMS: SHA2Params> Algorithm for SHA512Internal<PARAMS>
Source§const ALG_NAME: &'static str = PARAMS::ALG_NAME
const ALG_NAME: &'static str = PARAMS::ALG_NAME
String name for the algorithm, used consistently across the library.
Source§const MAX_SECURITY_STRENGTH: SecurityStrength = PARAMS::MAX_SECURITY_STRENGTH
const MAX_SECURITY_STRENGTH: SecurityStrength = PARAMS::MAX_SECURITY_STRENGTH
Maximum security strength supported by the algorithm.
In other words, this algorithm can produce outputs up to this security strength,
but may produce outputs with lower security strength, for example, if asked to truncate.
Source§impl<PARAMS: Clone + SHA2Params> Clone for SHA512Internal<PARAMS>
impl<PARAMS: Clone + SHA2Params> Clone for SHA512Internal<PARAMS>
Source§fn clone(&self) -> SHA512Internal<PARAMS>
fn clone(&self) -> SHA512Internal<PARAMS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<PARAMS: SHA2Params> Default for SHA512Internal<PARAMS>
impl<PARAMS: SHA2Params> Default for SHA512Internal<PARAMS>
Source§impl<PARAMS: SHA2Params> Hash for SHA512Internal<PARAMS>
impl<PARAMS: SHA2Params> Hash for SHA512Internal<PARAMS>
Source§fn block_bitlen(&self) -> usize
fn block_bitlen(&self) -> usize
As per FIPS 180-4 Figure 1
Source§fn do_final_partial_bits(
self,
partial_byte: u8,
num_partial_bits: usize,
) -> Result<Vec<u8>, HashError>
fn do_final_partial_bits( self, partial_byte: u8, num_partial_bits: usize, ) -> Result<Vec<u8>, HashError>
TODO: This is defined in FIPS 180-4 s. 5.1.2 TODO: https://pages.nist.gov/ACVP/draft-celi-acvp-sha.html TODO: It can be implemented if required
Source§fn do_final_partial_bits_out(
self,
partial_byte: u8,
num_partial_bits: usize,
output: &mut [u8],
) -> Result<usize, HashError>
fn do_final_partial_bits_out( self, partial_byte: u8, num_partial_bits: usize, output: &mut [u8], ) -> Result<usize, HashError>
TODO: This is defined in FIPS 180-4 s. 5.1.2 TODO: https://pages.nist.gov/ACVP/draft-celi-acvp-sha.html TODO: It can be implemented if required
Source§fn output_len(&self) -> usize
fn output_len(&self) -> usize
The size of the output in bytes.
Source§fn hash(self, data: &[u8]) -> Vec<u8> ⓘ
fn hash(self, data: &[u8]) -> Vec<u8> ⓘ
A static one-shot API that hashes the provided data.
data can be of any length, including zero bytes.Source§fn hash_out(self, data: &[u8], output: &mut [u8]) -> usize
fn hash_out(self, data: &[u8], output: &mut [u8]) -> usize
A static one-shot API that hashes the provided data into the provided output slice.
data can be of any length, including zero bytes.
The entire output buffer is zeroized before the hash output is written.
The return value is the number of bytes written.Source§fn do_update(&mut self, block: &[u8])
fn do_update(&mut self, block: &[u8])
Provide a chunk of data to be absorbed into the hashes.
data can be of any length, including zero bytes.
do_update() is intended to be used as part of a streaming interface, and so may by called multiple times.Source§fn do_final(self) -> Vec<u8> ⓘ
fn do_final(self) -> Vec<u8> ⓘ
Finish absorbing input and produce the hashes output.
Consumes self, so this must be the final call to this object.
Source§fn do_final_out(self, output: &mut [u8]) -> usize
fn do_final_out(self, output: &mut [u8]) -> usize
Finish absorbing input and produce the hashes output.
Consumes self, so this must be the final call to this object. Read more
Source§fn max_security_strength(&self) -> SecurityStrength
fn max_security_strength(&self) -> SecurityStrength
Returns the maximum security strength that this KDF is capable of supporting, based on the underlying primitives.
Source§impl<PARAMS: SHA2Params> Suspendable<SUSPENDED_SHA512_STATE_LEN> for SHA512Internal<PARAMS>
impl<PARAMS: SHA2Params> Suspendable<SUSPENDED_SHA512_STATE_LEN> for SHA512Internal<PARAMS>
Auto Trait Implementations§
impl<PARAMS> Freeze for SHA512Internal<PARAMS>
impl<PARAMS> RefUnwindSafe for SHA512Internal<PARAMS>where
PARAMS: RefUnwindSafe,
impl<PARAMS> Send for SHA512Internal<PARAMS>where
PARAMS: Send,
impl<PARAMS> Sync for SHA512Internal<PARAMS>where
PARAMS: Sync,
impl<PARAMS> Unpin for SHA512Internal<PARAMS>where
PARAMS: Unpin,
impl<PARAMS> UnsafeUnpin for SHA512Internal<PARAMS>
impl<PARAMS> UnwindSafe for SHA512Internal<PARAMS>where
PARAMS: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more