pluto / signius

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

feat: `sigma_1()` function #5

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_1$. It is implemented like so:

fn sigma_1(x: u32) -> u32 {
  rotate_right::<6>(x) ^ rotate_right::<11>(x) ^ rotate_right::<25>(x)
}

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