#byte-string #constant-time #compare #linux-kernel

no-std constant_time_eq

Compares two equal-sized byte strings in constant time

14 releases

0.3.1 Aug 27, 2024
0.3.0 Jun 17, 2023
0.2.6 Jun 10, 2023
0.2.5 Mar 12, 2023
0.1.0 May 22, 2015

#41 in Cryptography

Download history 1654806/week @ 2024-10-06 1486705/week @ 2024-10-13 1303137/week @ 2024-10-20 968610/week @ 2024-10-27 1008845/week @ 2024-11-03 997288/week @ 2024-11-10 1007613/week @ 2024-11-17 834701/week @ 2024-11-24 988544/week @ 2024-12-01 1329311/week @ 2024-12-08 1002894/week @ 2024-12-15 443393/week @ 2024-12-22 598469/week @ 2024-12-29 1072006/week @ 2025-01-05 1263033/week @ 2025-01-12 1051193/week @ 2025-01-19

4,033,152 downloads per month
Used in 5,803 crates (63 directly)

CC0-1.0 OR MIT-0 OR Apache-2.0

12KB
133 lines

Compares two equal-sized byte strings in constant time.

Inspired by the Linux kernel's crypto_memneq.

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE)
  • MIT No Attribution License (LICENSE-MIT0)
  • CC0 1.0 Universal (LICENSE-CC0)

at your option.

No runtime deps