A compact, self-contained, and highly optimized post-quantum secure cryptographic library written in C.
QSC Help Documentation
QSC Technical Specification
QSC Summary Document
QSC is designed to provide next-generation, post-quantum secure cryptographic primitives for applications requiring long-term security. Adhering to MISRA secure coding standards, the library is structured for clarity, ease of verification, and seamless integration into secure communications platforms. The code is well structured, thoroughly commented, and comes with an extensive testing platform covering every primitive contained in the library.
QSC is a compact and self-contained library written in C. It has been developed to meet MISRA secure coding standards and is designed to be easy to read, verify, and implement. The library incorporates next-generation asymmetric and symmetric primitives with a strong emphasis on true long-term security. It forms the basis for future integration efforts as a compact, high-security, post-quantum secure communications platform.
This implementation uses both a base reference code and optimized AVX/AVX2/AVX512 intrinsics for maximum performance. For best results, set your project properties to utilize the highest available SIMD instruction set supported by your CPU—AVX-512 instructions are fully supported and offer the best performance profile.
Version: 1.0.0.6c Tested on:
- Windows 10/11/Server
- Ubuntu Linux
- macOS
All asymmetric ciphers and signature schemes have been updated to new FIPS standards for the winners, and NIST PQC Round 3 standards for last round contenders.
-
Key Encapsulation Mechanisms:
- McEliece: Niederreiter dual form of the McEliece public key crypto-system.
- Kyber: Module-LWE based key encapsulation (updated to NIST FIPS-203 standards).
- NTRU: Asymmetric cipher implementation.
- ECDH: Elliptic Curve Diffie-Hellman key exchange.
-
Digital Signature Schemes:
- Sphincs+: Post-quantum secure signature scheme (updated to NIST FIPS-205 standards).
- Dilithium: Lattice-based signature scheme (updated to NIST FIPS-204 standards).
- Falcon: NTRU-based signature scheme.
- ECDSA (Ed25519): Elliptic Curve Digital Signature Algorithm.
-
Symmetric Ciphers:
- AES: Supports modes such as CBC, CTR, HBA, and ECB.
- RCS: An authenticated AEAD stream cipher based on wide-block Rijndael and KMAC/QMAC.
- CSX: A ChaCha-based authenticated AEAD stream cipher using 64-bit integers, 512-bit keys, and KMAC/QMAC authentication.
- ChaChaPoly20: ChaCha-based stream cipher.
-
Hash Functions:
- SHA3: 256 and 512-bit variants.
- SHA2: 256 and 512-bit variants.
-
Message Authentication Codes:
- QMAC: GMAC(2^256) variant.
- KMAC: Keccak FIPS-202 MAC function.
- HMAC: SHA2-256 and 512-bit MAC functions.
- Poly1305: High-speed MAC generator.
-
DRBGs and PRNGs:
- CSG (
csg.h
): cSHAKE wrapped auto-seeding DRBG. - HCG (
hcg.h
): HMAC wrapped auto-seeding DRBG. - SCB (
scb.h
): SHAKE Cost Based KDF (uses memory thrashing and CPU cost mechanisms). - Secrand (
secrand.h
): Secure PRNG producing random integers of every type.
- CSG (
-
XOF and KDF Functions:
- SHAKE and cSHAKE: (for key derivation functions and DRBGs).
- SCB: SHAKE Cost Based KDF used for secure passphrase-key derivation.
- HKDF: SHA2-256 AND 512 bit variants
-
Entropy Providers & PRNGs:
- ACP (
acp.h
): Auto Entropy Collection Provider for gathering entropy. - CSP (
csp.h
): The operating system entropy provider. - RDRAND (
rdp.h
): Utilizes hardware-based random number generation.
- ACP (
- Array and String Utilities:
arrayutils.h
andstringutils.h
for managing character arrays and strings. - Memory Functions:
memutils.h
implements optimized memory operations using SIMD instructions. - Integer and Arithmetic:
intutils.h
anddonna128.h
provide high-precision arithmetic and integer manipulation. - File and Folder Utilities:
fileutils.h
andfolderutils.h
simplify file handling and directory management.
- TCP/IP and Socket Utilities:
A complete set of network functions provided innetutils.h
,socket.h
,socketbase.h
, andsocketflags.h
. - Socket Server and Client:
An asynchronous high-performance socket server and client in
socketclient.h
andsocketserver.h
.
- Asynchronous Operations:
Managed throughasync.h
andthreadpool.h
for multi-threaded processing. - System and CPU Information:
cpuidex.h
,sysutils.h
, andipinfo.h
for system statistics and CPU feature detection. - Timing and Events:
timerex.h
,timestamp.h
, andevent.h
offer precise timing and event management. - Platform-Specific Utilities:
consoleutils.h
andwinutils.h
provide support for console applications and Windows environments.
- Data Structures:
Efficient keyed collections (collection.h
), list (list.h
), and queue (queue.h
) management. - Encoding & Sorting:
encoding.h
for multiple encoding schemes andqsort.h
for quicksort operations. - Self-Test Mechanisms:
selftest.h
contains routines to verify the integrity and performance of the cryptographic functions.
-
Reference Implementations:
Clear and maintainable C code ensuring broad platform compatibility. -
SIMD Optimizations:
Critical algorithms use AVX, AVX2, and AVX512 intrinsics to leverage modern CPU capabilities, achieving superior performance.
QSC has been thoroughly tested on:
- Windows (Visual Studio)
- Ubuntu Linux (GCC)
- macOS (Apple Clang)
-
Comprehensive Cryptography:
Incorporates next-generation asymmetric and symmetric cryptographic primitives. -
High Security:
Emphasizes long-term security with post-quantum algorithms and robust key management. -
Performance Optimized:
Uses advanced SIMD intrinsics (AVX/AVX2/AVX512) for best performance. -
Testing Platform:
Contains extensive test functions for every primitive, ensuring correctness and performance. -
System Utilities:
Provides asynchronous threading, dual-stack networking, CPUID detection, and secure memory management. -
Language Interoperability Interoperability with C++, and .NET via the QSCNETCW wrapper library.
- Continued ASM/SIMD integration and optimization.
- Wrapper library for Java.
- Development of a post-quantum TLS 1.3 implementation.
- Expansion of testing and benchmarking frameworks.
- Integration of emerging cryptographic research and standards.
QRCS-PL Private License. See the included license file for details.
Software is copyrighted, and some mechanisms are patent pending.
Written by John G. Underhill under the QRCS-PL license.
Redistribution or commercial use is not permitted without expressed written permission.
All rights reserved by QRCS Corp. 2025.