Quantum Secure Library (QSC)
The Quantum Secure Library
The Quantum Secure Library (QSC) is the common cryptographic and systems foundation across the QRCS technology stack. QSC is not only a bundle of cryptographic routines, it is an integrated toolkit that unifies modern post-quantum primitives, Keccak family hashing and MACs, deterministic key derivation and randomness, and the infrastructure required to build complete secure systems. QSC is written in disciplined C with consistent API patterns, predictable behavior, and explicit state handling. It is designed to integrate cleanly into firmware, embedded controllers, client applications, protocol servers, and long running services where audit scope, dependency control, and memory safety properties matter as much as the mathematics of the primitives. The library includes a complete IPv4 and IPv6 networking stack, cross platform sockets, asynchronous threading and events, secure memory allocation and zeroization primitives, and SIMD accelerated memory utilities. That combination allows QRCS protocols and products to depend on one coherent substrate rather than mixing unrelated libraries with incompatible conventions.
Executive Summary
A high level description of QSC, the strategic rationale, major capabilities, and how the library supports protocol deployment across embedded and enterprise environments.
Open Executive SummaryIntegration Guide
Integration and evaluation guidance, API patterns, test infrastructure, and practical deployment considerations across platforms and build configurations.
Open Integration GuideTechnical Specification
Engineering specification covering the library inventory, module boundaries, function definitions, and supported parameter sets for cryptography, networking, memory, and utilities.
Open Technical SpecificationWhat QSC Is
QSC is intended to be the dependable layer that QRCS protocols can assume is present and correct. It reduces integration risk by enforcing a single, consistent set of rules around state handling, parameter validation, memory lifecycle, and error semantics. This matters in practice because most production failures happen at the boundaries between libraries, not inside the core algorithms.
The library is organized as a set of focused modules that map cleanly to how real protocols are built: symmetric encryption, hashing and MAC, random generation, KDF and DRBG frameworks, post-quantum KEM and signature primitives, and the systems utilities required to run secure services. QSC is designed so that constrained deployments can link only what is required, while full service deployments can leverage the entire stack.
Design Philosophy
QSC follows a uniform API discipline. Stateful cryptographic operations accept a context pointer first, then buffers, sizes, and options. Lifecycle separation is explicit, initialize and configure the state, transform or generate data, then dispose and wipe state. This structure supports secure composition and helps prevent accidental reuse of state or keys.
On platforms that support it, QSC uses runtime CPU feature detection and can enable AVX, AVX2, or AVX-512 accelerated pathways for selected primitives and for high throughput memory utilities. The library is built to scale from embedded systems to multi core servers without requiring application code changes.
Cryptographic Primitive Inventory
QSC includes both modern post-quantum algorithms and a curated set of classical algorithms for compatibility. The post-quantum set is intended for long term security and protocol modernization, while the classical set enables staged adoption, hybrid deployments, and interoperability in existing environments.
Post Quantum Key Establishment and Signatures
QSC exposes NIST aligned primitives under a consistent interface, enabling systems to swap or combine primitives without rewriting large portions of integration code.
- ML-KEM: lattice based key encapsulation for authenticated key establishment and session bootstrap.
- ML-DSA: lattice based digital signatures designed for high performance verification and structured keys.
- SLH-DSA: stateless hash based signatures designed for conservative assumptions and long term durability.
- McEliece: code based key encapsulation offering extremely conservative security assumptions with larger public keys.
Symmetric Encryption
QSC includes modern authenticated encryption primitives designed for protocol composition and packet level protection, along with widely deployed algorithms for compatibility. QSC favors AEAD style usage patterns so that encryption and integrity verification are treated as a single operation rather than separate steps.
CSX Documents
CSX is a 512-bit secure authenticated ARX stream cipher that authenticates using KMAC.
CSX Authenticated Stream Cipher
CSX is designed for high speed packet and message protection, especially in environments where latency matters and deployment must be simple. It follows a stream cipher design derived from ChaCha while extending key and internal state width to increase security margin. CSX is intended to be used as authenticated encryption, so that ciphertext generation and integrity verification are a single integrated action from the perspective of a protocol.
In QRCS protocols, CSX is used where the operational profile demands fast encryption, rapid key rotation, and minimal dependency on platform specific cryptographic accelerators. Its interface is designed to fit into transcript bound protocols and message framing systems.
RCS Documents
RCS is a wide-block Rijndael based AEAD stream cipher that uses KMAC for authentication.
RCS Wide Block Authenticated Encryption
RCS is designed for high assurance authenticated encryption. It adapts a wide block Rijndael style permutation while eliminating conventional key schedule weaknesses by deriving round keys through Keccak based cSHAKE expansion and separating authentication under KMAC. This is intended to produce clean compositional behavior, predictable security margins, and a stable interface for protocol designers.
RCS is a practical fit for tunneling, relay encryption, secure transport, and storage encryption where an explicit authenticated encryption construction is required. In QRCS protocols, RCS is used as the standard AEAD layer when deterministic behavior, strong audit posture, and conservative design margins are preferred over reliance on platform specific acceleration.
Hashing and Message Authentication
QSC uses Keccak family primitives as a primary anchor, including SHA3, SHAKE, cSHAKE, and KMAC, providing both one shot interfaces and incremental stateful APIs for streaming and transcript binding. For compatibility, the library also includes SHA2 and HMAC based constructions.
Protocol designers benefit from the Keccak based design because hashing, MAC, KDF, and authenticated encryption can share consistent domain separation behavior and naming conventions. This reduces the risk of accidental cross protocol key reuse and supports clean transcript binding designs.
QMAC Documents
QMAC is a post-quantum MAC construction built on SHAKE..
QMAC Message Authentication
QMAC is a keyed authentication primitive designed to fit naturally into transcript bound protocols and deterministic key hierarchies. It is intended to provide a robust integrity layer when systems require a MAC that is aligned with the rest of the Keccak centered design of QSC. In practice, QMAC is used as an integrity and binding component in selected KDF and protocol paths where the design benefits from additional mixing beyond conventional constructions.
The QSC API exposes consistent initialize, update, and finalize behavior for incremental message authentication, allowing large inputs, streaming messages, or transcript accumulation without forcing applications to buffer full messages in memory.
Randomness, DRBG, and Key Derivation
QSC provides multiple entropy providers and deterministic generators designed for reproducible, auditable key schedules. The library includes a default auto entropy provider that combines platform entropy sources and hardware outputs where available. This is complemented by platform wrappers and portable fallbacks designed to keep integration behavior consistent across systems.
For key derivation and deterministic randomness, QSC includes SHAKE and cSHAKE based constructions, HKDF, and dedicated generators designed to support protocol key scheduling. These primitives are designed to support domain separation, stable parameter selection, and explicit lifecycle management.
SCB Documents
SCB is a cost based SHAKE derived KDF supporting configurable time and memory costs.
SCB Cost Based Key Derivation
SCB is a configurable cost based KDF intended for environments where a secret must be hardened against brute force and resource scale adversaries. It is designed to support configurable time and memory cost parameters so that deployments can tune hardness based on platform constraints and operational threat models.
SCB is used to derive keys, seeds, and hardened root material in systems that require an explicit cost profile. The interface includes state initialization, generation, update, and disposal semantics to ensure that sensitive internal buffers can be wiped deterministically after use.
Asymmetric Cryptography and PQC Integration
QSC includes post-quantum KEM and signature primitives designed for long term security and for practical integration. ML-KEM, ML-DSA, SLH-DSA, and McEliece are available within the library alongside classical ECDH and ECDSA to support staged adoption, hybrid systems, and compatibility with existing infrastructure.
The primary goal is algorithm agility under a consistent interface. Protocols can be structured to negotiate or select primitive families without rewriting integration layers, and without changing the underlying memory and error handling conventions that govern secure operation.
Full IPv4 and IPv6 Networking Stack
QSC includes a cross platform sockets library supporting IPv4 and IPv6 and wrapping platform specifics behind consistent calls. The networking layer includes socket client and server helpers, queueing and multi threaded operation support, and practical utilities for address conversion and local interface enumeration. This is designed to let protocol servers and secure applications build on a stable substrate without pulling in separate networking frameworks.
Because QRCS protocols are often deployed as networked services, the inclusion of sockets, queues, and server helpers inside QSC reduces integration complexity and ensures consistent behavior across Windows and Unix like systems.
Threading, Events, and Asynchronous Processing
QSC includes an asynchronous framework consisting of threads, events, and a dynamic thread pool. These utilities are designed to support high throughput servers and protocol handlers, enabling concurrent encryption, signature verification, and network processing without forcing application code to implement fragile concurrency primitives.
The thread pool is intended to scale with available CPU cores and to integrate naturally with the networking stack. This supports deployment patterns where cryptography and network I/O must be overlapped and scheduled across worker threads.
Secure Memory and SIMD Integration
Secure memory functions are treated as core infrastructure. QSC includes constant time comparisons, secure zeroization, secure copy and XOR utilities, and protected allocation patterns intended for keying material and sensitive state. These primitives reduce the likelihood of key leakage through residual buffers or unsafe memory reuse.
QSC also includes SIMD accelerated memory utilities and CPU feature detection. When available, AVX, AVX2, and AVX-512 pathways are used to improve throughput while preserving constant time behavior for operations that must not leak timing information. These tools are useful both for cryptography and for the high volume memory movement patterns common in networking and protocol servers.
Testing, Verification, and Integration Assurance
QSC ships with an extensive test infrastructure intended to support independent validation, integration confidence, and repeatable regression testing. This includes known answer test sets for post-quantum primitives and standard suites for widely deployed algorithms. Tests are designed to serve as both verification artifacts and executable examples of correct API usage.
This approach supports deployment in high assurance environments where repeatability, correctness evidence, and toolchain independence are required. It also supports staged adoption by letting teams validate small subsets of QSC before enabling larger portions of the library in production builds.