byte_array_ops/security/
constant_time.rs1use crate::ByteArray;
2use subtle::ConstantTimeEq;
3
4impl PartialEq for ByteArray {
5 fn eq(&self, other: &Self) -> bool {
6 self.as_bytes().ct_eq(other.as_bytes()).unwrap_u8() == 1
7 }
8}
9
10impl Eq for ByteArray {}