9 unstable releases (3 breaking)
| 0.4.5 | Feb 10, 2026 |
|---|---|
| 0.4.4 | Feb 1, 2026 |
| 0.4.3 | Jan 28, 2026 |
| 0.3.0 | Jan 22, 2026 |
| 0.1.0 | Jan 22, 2026 |
#2331 in Cryptography
274 downloads per month
Used in 4 crates
40KB
718 lines
kylix-core
Core traits, error types, and macros for the Kylix post-quantum cryptography library.
This crate is an internal building block — most users should depend on kylix-pqc or individual algorithm crates instead.
Contents
Traits
Kem— Key Encapsulation Mechanism (keygen, encaps, decaps). Used bykylix-ml-kem.Signer— Digital Signature (keygen, sign, verify). Used bykylix-ml-dsaandkylix-slh-dsa.
Error Types
Error— Unified error type (invalid lengths, verification failure, decapsulation failure, etc.)Result<T>— Alias forcore::result::Result<T, Error>
Macros
Compile-time code generation for lattice-based cryptography:
| Macro | Purpose |
|---|---|
define_barrett_reduce! |
Barrett modular reduction |
define_montgomery_reduce! |
Montgomery reduction |
define_montgomery_mul! |
Montgomery multiplication |
define_caddq! |
Constant-time conditional add q |
define_freeze! |
Canonical reduction to [0, q-1] |
define_ntt_forward! |
Cooley-Tukey forward NTT |
define_ntt_inverse! |
Gentleman-Sande inverse NTT |
define_simd_dispatch! |
Multi-platform SIMD dispatch (AVX2/NEON/WASM) |
define_has_avx2! |
Runtime SIMD feature detection |
Re-exports
zeroize::{Zeroize, ZeroizeOnDrop}— Secure memory erasuresubtle— Constant-time comparison primitives
Feature Flags
| Flag | Default | Description |
|---|---|---|
std |
Yes | Enables thiserror for std::error::Error impl |
no_std
kylix-core = { version = "0.4", default-features = false }
License
MIT
Dependencies
~215–620KB
~13K SLoC