NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #374 most downloaded on crates.io
Compares two equal-sized byte strings in constant time.
Last release 7 days ago
01 Oct 2026
Release timing varies
gaps range from 9 days to 1.2 years
Most releases are documented
notes for 16 of 20 stable releases
2 versions withdrawn
withdrawn after publishing
11 years old
22 releases · first in 2015
Fixed minimal version of rustversion dependency.
The official repository for this project is now on Codeberg. The git repository on GitHub is still in use; issues and pull requests are accepted on ei
One column per quarter.
Unfortunately, the Rust-version aware resolver only has an effect if the main crate being compiled is using edition 2024 or opts in, it's not enough t
Cargo's version-aware dependency resolution should prevent this from being a breaking change.
Refactor detection of the DIT feature on ARM. For builds without the "std" feature, there's now an undocumented function to force the use of the DIT b
Simplify code to make it easier to review.
BREAKING CHANGE: this crate now has a "std" feature which is enabled by default. Disable it if you need to use this crate as a no_std crate.
BREAKING CHANGE: this crate now has a "std" feature which is enabled by default. Disable it if you need to use this crate as a no_std crate.
Previous versions of this crate protected against the optimizer doing an early exit when the accumulator becomes non-zero (found a difference), but not against a sufficiently smart optimizer doing an early exit when the accumulator has all bits set (the accumulator never clears a bit, so having all bits set means it will no longer change).
Protecting against that also prevents autovectorization, so this release does manual vectorization to recover most of the speed lost. Where there is enough compiler support (stable vector intrinsics), it uses a mix of vector intrinsics and inline assembly for inputs which are a multiple of the vector size, while for other architectures and for the remainder of an input which is not a multiple of the vector size, it uses a generic word-at-a-time implementation with the native word size.
Some newer implementations of the ARM architecture do not guarantee the timing of instructions unless the DIT bit is set. Fortunately, that bit can be set on all privilege levels; unfortunately, that bit only exists on these newer implementations of the ARM architecture, and the flag to detect whether it exists is not accessible on all privilege levels. How to obtain that flag varies depending on the operating system, but Rust has a good implementation of that on its standard library. This means that runtime detection introduces a dependency on std (enabled by the "std" feature, which is enabled by default); compile-time detection is always available.
This release is a candidate for becoming the 1.0 release. In preparation for that, it uses the 2024 edition, which enables the new resolver which will allow future updates to the set of architectures which can use the inline assembly implementation of optimizer_hide(), without breaking downstream crates (for instance, s390x and arm64ec were stabilized in Rust 1.84.0).
Use the portable optimizer_hide() when running under Miri.
Use black_box instead of volatile read when inline assembly is not available.
New tests using the count_instructions crate; no functional changes.
Add #[must_use] to all functions.
Release 0.2.4 with MIT-0 or Apache-2.0 as license options
Release 0.2.4 with MIT-0 or Apache-2.0 as license options
Add fixed-size variant for arrays of any size (using const generics).
Set rust-version in Cargo.toml to 1.59.
Reduce inlining of variable-size variant. In 0.1.5, the loop was not inlined, and it can be a bit large due to the auto-vectorization. Go back to how
Use inline assembly when available to hide from the optimizer.
Add fixed-size variant for arrays with sizes 16 bytes, 32 bytes, and 64 bytes.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →