Registry / crypto / constant-time-eq

constant-time-eq

JSON →
library0.5.0rscratesunverified

Compares two equal-sized byte strings in constant time to prevent timing attacks.

# Cargo.toml [dependencies] constant_time_eq = "0.5.0"
INSTALL
IMPORT
SIG · CONSTANT-TIME-EQ
C
constant-time-eq
cryptorustv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

constant_time_eq
use constant_time_eq::constant_time_eq;

Compare two byte slices in constant time.

use constant_time_eq::constant_time_eq; fn main() { let a = b"secret"; let b = b"secret"; if constant_time_eq(a, b) { println!("Equal"); } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.5.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
Amazon
1
Resources
constant-time-eq — cargo add constant-time-eq · libregistry