mirror of
https://github.com/BLAKE3-team/BLAKE3
synced 2024-06-07 02:56:03 +02:00
Compare commits
3 Commits
05b314f399
...
d650d38cab
Author | SHA1 | Date | |
---|---|---|---|
Pavel(Pavlo) Mazniker | d650d38cab | ||
Jack O'Connor | 4ec3be8bfa | ||
P.M | bf42932833 |
|
@ -78,23 +78,14 @@ fn compress(
|
||||||
block_len: u32,
|
block_len: u32,
|
||||||
flags: u32,
|
flags: u32,
|
||||||
) -> [u32; 16] {
|
) -> [u32; 16] {
|
||||||
|
let counter_low = counter as u32;
|
||||||
|
let counter_high = (counter >> 32) as u32;
|
||||||
|
#[rustfmt::skip]
|
||||||
let mut state = [
|
let mut state = [
|
||||||
chaining_value[0],
|
chaining_value[0], chaining_value[1], chaining_value[2], chaining_value[3],
|
||||||
chaining_value[1],
|
chaining_value[4], chaining_value[5], chaining_value[6], chaining_value[7],
|
||||||
chaining_value[2],
|
IV[0], IV[1], IV[2], IV[3],
|
||||||
chaining_value[3],
|
counter_low, counter_high, block_len, flags,
|
||||||
chaining_value[4],
|
|
||||||
chaining_value[5],
|
|
||||||
chaining_value[6],
|
|
||||||
chaining_value[7],
|
|
||||||
IV[0],
|
|
||||||
IV[1],
|
|
||||||
IV[2],
|
|
||||||
IV[3],
|
|
||||||
counter as u32,
|
|
||||||
(counter >> 32) as u32,
|
|
||||||
block_len,
|
|
||||||
flags,
|
|
||||||
];
|
];
|
||||||
let mut block = *block_words;
|
let mut block = *block_words;
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test;
|
mod test;
|
||||||
|
|
||||||
// The guts module is for incremental use cases like the `bao` crate that need
|
// The guts module is for incremental use cases like the `bao` crate that needs
|
||||||
// to explicitly compute chunk and parent chaining values. It is semi-stable
|
// to explicitly compute chunk and parent chaining values. It is semi-stable
|
||||||
// and likely to keep working, but largely undocumented and not intended for
|
// and likely to keep working, but largely undocumented and not intended for
|
||||||
// widespread use.
|
// widespread use.
|
||||||
|
@ -223,7 +223,7 @@ pub struct Hash([u8; OUT_LEN]);
|
||||||
|
|
||||||
impl Hash {
|
impl Hash {
|
||||||
/// The raw bytes of the `Hash`. Note that byte arrays don't provide
|
/// The raw bytes of the `Hash`. Note that byte arrays don't provide
|
||||||
/// constant-time equality checking, so if you need to compare hashes,
|
/// constant-time equality checking, so if you need to compare hashes,
|
||||||
/// prefer the `Hash` type.
|
/// prefer the `Hash` type.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn as_bytes(&self) -> &[u8; OUT_LEN] {
|
pub const fn as_bytes(&self) -> &[u8; OUT_LEN] {
|
||||||
|
|
Loading…
Reference in New Issue