pub struct AesHash { /* private fields */ }
Expand description
AES accelerated hashing of Block
s.
Implementations§
Source§impl AesHash
impl AesHash
Sourcepub fn cr_hash_block(&self, x: Block) -> Block
pub fn cr_hash_block(&self, x: Block) -> Block
Compute the correlation robust hash of a block.
§Warning: only secure in semi-honest setting!
See https://eprint.iacr.org/2019/074 for details.
Sourcepub fn cr_hash_blocks<const N: usize>(&self, x: &[Block; N]) -> [Block; N]
pub fn cr_hash_blocks<const N: usize>(&self, x: &[Block; N]) -> [Block; N]
Compute the correlation robust hashes of multiple blocks.
Warning: only secure in semi-honest setting! See https://eprint.iacr.org/2019/074 for details.
Sourcepub fn cr_hash_blocks_b2b<const N: usize>(
&self,
inp: &[Block; N],
out: &mut [Block],
)
pub fn cr_hash_blocks_b2b<const N: usize>( &self, inp: &[Block; N], out: &mut [Block], )
Compute the correlation robust hashes of multiple blocks.
Warning: only secure in semi-honest setting! See https://eprint.iacr.org/2019/074 for details.
§Panics
If N != out.len()
Sourcepub fn cr_hash_slice_mut(&self, x: &mut [Block])
pub fn cr_hash_slice_mut(&self, x: &mut [Block])
Correlation robust hash of a slice of blocks.
Warning: only secure in semi-honest setting! See https://eprint.iacr.org/2019/074 for details.
In most cases, this method will be the most performant, as it can make use of AES instruction level parallelism.
Sourcepub fn tccr_hash_slice_mut(
&self,
x: &mut [Block],
tweak_fn: impl FnMut(usize) -> Block,
)
pub fn tccr_hash_slice_mut( &self, x: &mut [Block], tweak_fn: impl FnMut(usize) -> Block, )
Tweakable circular correlation robust hash function.
See https://eprint.iacr.org/2019/074 for details. This is the TMMO function.
Auto Trait Implementations§
impl Freeze for AesHash
impl RefUnwindSafe for AesHash
impl Send for AesHash
impl Sync for AesHash
impl Unpin for AesHash
impl UnwindSafe for AesHash
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more