raycrypt 0.3.1

Encrypt at the speed of light
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub(crate) fn from_le_bytes(x: &[u8]) -> u32 {
    u32::from_le_bytes([x[0], x[1], x[2], x[3]])
}

pub(crate) fn const_time_eq(a: &[u8], b: &[u8]) -> bool {
    let mut temp = 0;

    for (i, j) in a.iter().zip(b.iter()) {
        temp |= i ^ j;
    }

    temp == 0
}