pluto / signius

Exploring Fast Cryptographic Primitives in Binius
3 stars 0 forks source link

feat: `small_sigma_0()` function #6

Open Autoparallel opened 5 months ago

Autoparallel commented 5 months ago

Requires https://github.com/pluto/signius/issues/3

Another common permutation/compression function used in SHA-256 is commonly called $\sigma_0$ It is implemented like so:

fn small_sigma_0(x: u32) -> u32 {
  rotate_right::<7>(x) ^ rotate_right::<18>(x) ^ (x >> 3)
}

where rotate_right() is a circular bitwise rotation described in https://github.com/pluto/signius/issues/3.