#post-quantum-cryptography #ml-kem #pqc

no-std kylix-core

Core traits and utilities for the Kylix post-quantum cryptography library

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

Download history 683/week @ 2026-01-22 92/week @ 2026-01-29 330/week @ 2026-02-05 164/week @ 2026-02-12 47/week @ 2026-02-19 50/week @ 2026-02-26 131/week @ 2026-03-05 45/week @ 2026-03-12

274 downloads per month
Used in 4 crates

MIT license

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 by kylix-ml-kem.
  • Signer — Digital Signature (keygen, sign, verify). Used by kylix-ml-dsa and kylix-slh-dsa.

Error Types

  • Error — Unified error type (invalid lengths, verification failure, decapsulation failure, etc.)
  • Result<T> — Alias for core::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 erasure
  • subtle — 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