#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

#45 in Cryptography

Download history 895432/week @ 2024-08-20 875830/week @ 2024-08-27 941724/week @ 2024-09-03 890516/week @ 2024-09-10 995069/week @ 2024-09-17 1025058/week @ 2024-09-24 1423292/week @ 2024-10-01 1611396/week @ 2024-10-08 1497155/week @ 2024-10-15 1060517/week @ 2024-10-22 973388/week @ 2024-10-29 987619/week @ 2024-11-05 1009562/week @ 2024-11-12 1006956/week @ 2024-11-19 834534/week @ 2024-11-26 1048751/week @ 2024-12-03

4,073,720 downloads per month
Used in 5,570 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