pluto / signius

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

feat: `ch()` function #8

Open Autoparallel opened 5 months ago

Autoparallel commented 5 months ago

Another function that works on basic u32 is the ch() function which, essentially, makes a choice between bits of y and z based on another input x. It is implemented like so:

fn ch(x: u32, y: u32, z: u32) -> u32 { (x & y) ^ (!x & z) }