Module Bytesrw_crypto.Verify

Constant time byte equality checking.

Note. The functions raise Invalid_argument on sequence length mismatch or empty sequences. In the context where these functions should be used, these conditions usually means something is not done right.

val equal_slices : Bytesrw.Bytes.Slice.t -> Bytesrw.Bytes.Slice.t -> bool

equal_slices s0 s1 checks in constant time that the bytes in the range of s0 and s1 are equal. Raises Invalid_argument if the length of slices are not positive and equal.

val equal_strings : string -> string -> bool

equal_strings s0 s1 checks in constant time that the bytes of s0 and s1 are equal. Raises Invalid_argument if the length of strings are not positive and equal.

val equal_bytes : bytes -> bytes -> bool

equal_bytes b0 b1 checks in constant time that the bytes of b1 and b2 are equal. Raises Invalid_argument if the length of bytes are not positive and equal.

val equal_bigbytes : bigbytes -> bigbytes -> bool

equal_bigbytes b0 b1 checks in constant time that the bytes of b1 and b2 are equal. Raises Invalid_argument if the length of bigbytes are not positive and equal.