blockset-lib 0.7.0

BLOCKSET internal library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::uint::{
    u256::{u32x8_add, U256},
    u512::U512,
};

use super::{round::round16, w_round::w_round16};

/// https://en.wikipedia.org/wiki/One-way_compression_function
pub const fn compress(init: U256, mut w: U512) -> U256 {
    let mut x = round16(init, &w, 0);
    w = w_round16(w);
    x = round16(x, &w, 1);
    w = w_round16(w);
    x = round16(x, &w, 2);
    w = w_round16(w);
    x = round16(x, &w, 3);
    u32x8_add(&x, &init)
}