#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

#37 in Cryptography

Download history 902582/week @ 2024-09-09 959165/week @ 2024-09-16 961869/week @ 2024-09-23 1333690/week @ 2024-09-30 1680840/week @ 2024-10-07 1524247/week @ 2024-10-14 1131428/week @ 2024-10-21 969006/week @ 2024-10-28 1007081/week @ 2024-11-04 1000534/week @ 2024-11-11 1005347/week @ 2024-11-18 839336/week @ 2024-11-25 993546/week @ 2024-12-02 1332558/week @ 2024-12-09 992650/week @ 2024-12-16 457887/week @ 2024-12-23

3,830,100 downloads per month
Used in 5,679 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