crypto2 0.1.2

cryptographic algorithms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


pub fn constant_time_eq(a: &[u8], b: &[u8]) -> bool {
    if a.len() != b.len() {
        return false;
    }

    let mut x = 0u8;
    
    for i in 0..a.len() {
        x |= a[i] ^ b[i];
    }

    x == 0
}