- Rust 100%
| .github | ||
| src | ||
| .editorconfig | ||
| .gitignore | ||
| ARCHITECTURE.md | ||
| Cargo.toml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| ROADMAP.md | ||
| rustfmt.toml | ||
| SECURITY.md | ||
lib-constant-time
Minimal no_std constant-time primitives for EriX security-critical code paths.
This crate exists to provide small, auditable building blocks for byte-level operations where timing behavior must not depend on secret data.
UEFI + x86_64 are current primary targets, but this crate is explicitly
portable and architecture-neutral.
Scope
This crate provides:
- constant-time equality for fixed and variable byte slices
- constant-time zero checks
- constant-time conditional selection/masking helpers
This crate does not provide:
- hashing algorithms
- signature algorithms
- key storage or secure element integration
- random number generation
Why this crate exists
EriX verification paths (boot image verification, signature checks, hash comparison) need a shared implementation for constant-time byte operations.
Keeping these primitives in a dedicated crate improves:
- auditability (small API, focused code)
- reuse (
lib-bootimg, futurelib-ed25519, future kernel-side verifiers) - consistency (single behavior across components)
Design constraints
#![no_std]- zero external dependencies
- no dynamic allocation required
- deterministic behavior and explicit error handling
- minimal
unsafe(ideally none)
Security notes
"Constant-time" here means branch/data-flow behavior should not depend on secret values for supported operations.
This does not eliminate all side channels (cache hierarchy, power, platform noise), but removes common variable-time bugs in straightforward comparisons.
Intended consumers
lib-bootimg(manifest/section hash comparisons)- future
lib-ed25519(verification helpers) - bootloader and kernel-side validation code
Status
Implemented baseline.
Core constant-time primitives are implemented with unit coverage. Remaining work focuses on hardening-oriented review and expanded downstream integration checks.
See ARCHITECTURE.md and ROADMAP.md.