Crate constant_time_eq

Source
Expand description

Compares two equal-sized byte strings in constant time.

The time of the comparison does not depend on:

  • The contents of the inputs;
  • The position of the difference(s) between the inputs.

The time of the comparison can depend on:

  • The memory addresses of the inputs;
  • The length of the inputs.

Functionsยง

constant_time_eq
Compares two equal-sized byte strings in constant time.
constant_time_eq_16
Compares two 128-bit byte strings in constant time.
constant_time_eq_32
Compares two 256-bit byte strings in constant time.
constant_time_eq_64
Compares two 512-bit byte strings in constant time.
constant_time_eq_n
Compares two fixed-size byte strings in constant time.