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 Integration Guide
QSC Target Industries
Related Specifications and Analysis Papers for proprietary components
CSX Technical Specification
CSX Formal Analysis
QMAC Technical Specification
QMAC Formal Analysis
RCS Technical Specification
RCS Formal Analysis
SCB Technical Specification
SCB Formal Analysis
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.
Written to high-security standards (MISRA), and intended as a solution for environments that require a strong guarantee of long-term security and implementation correctness. The QSC library is set apart from the alternatives, incorporating the strongest cryptographic primitives available in the world today.
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.
Included in the distrubution are three Visual Studio projects.
Tests all of the cryptographic primitives, asymmetric ciphers, signature schemes, symmetric ciphers, MAC functions, DRBGs and random Providers. Runs for known answer tests, fuzzing, stress testing, and function correctness across the entire library.
Tests NIST certified components using the vector sets from the current CAVP and ACVP test vectors.
This includes the symmetric primitives:
Hash, MAC, and XOF Functions: SHA2, HMAC, SHA3, SHAKE, CSHAKE, and KMAC.
Symmetric Cipher: AES, GMAC, and GCM, CTR, CBC, ECB modes.
Asymmetric Signature Schemes: ML-DSA (Dilithium) and SLH-DSA (SPHINCS+) both tested with the ACVP FIPS-204 and FIPS-205 vector sets.
Asymmetric Ciphers: ML-KEM (Kyber) tested with the NIST ACVP FIPS-203 vector set.
A C# .NET wrapper written in managed C++. The wrapper allows .NET access to all of the QSC libraries core components and functions.
-
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).
- 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).
- 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.handstringutils.hfor managing character arrays and strings. - Memory Functions:
memutils.himplements optimized memory operations using SIMD instructions. - Integer and Arithmetic:
intutils.handdonna128.hprovide high-precision arithmetic and integer manipulation. - File and Folder Utilities:
fileutils.handfolderutils.hsimplify 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.handsocketserver.h.
- Asynchronous Operations:
Managed throughasync.handthreadpool.hfor multi-threaded processing. - System and CPU Information:
cpuidex.h,sysutils.h, andipinfo.hfor system statistics and CPU feature detection. - Timing and Events:
timerex.h,timestamp.h, andevent.hoffer precise timing and event management. - Platform-Specific Utilities:
consoleutils.handwinutils.hprovide 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.hfor multiple encoding schemes andqsort.hfor quicksort operations. - Self-Test Mechanisms:
selftest.hcontains 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.
QSC is a standalone, portable, and MISRA-aligned cryptographic library written in C. It supports platform-optimized builds across Windows, macOS, and Linux via CMake, and includes support for modern hardware acceleration such as AVX/AVX2/AVX-512, AES-NI, and RDRAND.
- CMake: 3.15 or newer
- Windows: Visual Studio 2022 or newer
- macOS: Clang via Xcode or Homebrew
- Ubuntu: GCC or Clang
Use the Visual Studio solution to create the library and test project QSC Test.
Extract the files, and open the QSCTest project. The QSC library has a default location in a folder parallel to the QSCTest folder.
The QSCTest additional files folder is set to: $(SolutionDir)..\QSC\QSC, if this is not the location of the library files, change it by going to QSCTest project properties Configuration Properties->C/C++->General->Additional Include Directories and set the library files location.
Ensure that the QSCTest->References property contains a reference to the QSC library. QSC supports every AVX instruction family (AVX/AVX2/AVX-512).
Set the QSC library and the QSCTest project to the same AVX family setting in Configuration Properties->C/C++->All Options->Enable Enhanced Instruction Set.
Set both QSC and QSCTest to the same instruction set in Debug and Release Solution Configurations.
Compile the QSC library (right-click and choose build), then set the QSCTest project as the startup project (right-click Set as Startup Project), and run the project.
The QSC library and QSCTest project have been tested using the Eclipse IDE on Ubuntu and MacOS.
In the Eclipse folder there are subfolders for Ubuntu and MacOS that contain the .project, .cproject, and .settings Eclipse project files. Copy those files directly into the folders containing the code files, ex. in the Eclipse\Ubuntu\QSC or Eclipse\MacOS\QSC folder, and do the same for the QSCTest project.
Create a new project for QSC, select C/C++ project, and then Create an empty project with the same name as the folder with the files, 'QSC'.
Eclipse should load the project with all of the settings into the project view window. The same proceedure is true for MacOS and Ubuntu, but some settings are different (GCC/Clang), so choose the project files that correspond to the operating system.
The default projects use minimal flags, and is set to No Enhanced Instructions by default..
Sample flag sets and their meanings:
-AVX Support: -msse2 -mavx -maes -mpclmul -mrdrnd -mbmi2
-msse2 # baseline for x86_64
-mavx # 256-bit FP/SIMD
-maes # AES-NI (128-bit AES rounds)
-mpclmul # PCLMUL (carry-less multiply)
-mrdrnd # RDRAND (hardware RNG)
-mbmi2 # BMI2 (PEXT/PDEP, bit-manipulation)
-AVX2 Support: -msse2 -mavx -mavx2 -mpclmul -maes -mrdrnd -mbmi2
-msse2 # baseline for x86_64
-mavx # AVX baseline
-mavx2 # 256-bit integer + FP SIMD
-mpclmul # PCLMUL (carry-less multiply for AES-GCM, GHASH, etc.)
-maes # AES-NI (128-bit AES rounds)
-mrdrnd # RDRAND (hardware RNG)
-mbmi2 # BMI2 (PEXT/PDEP, bit-manipulation)
-AVX-512 Support: -msse2 -mavx -mavx2 -mavx512f -mavx512bw -mvaes -mpclmul -mrdrnd -mbmi2 -maes
-msse2 # baseline for x86_64
-mavx # AVX baseline
-mavx2 # AVX2 baseline (implied by AVX-512 but explicit is safer)
-mavx512f # 512-bit Foundation instructions
-mavx512bw # 512-bit Byte/Word integer instructions
-mvaes # Vector-AES (VAES) in 512-bit registers
-mpclmul # PCLMUL (carry-less multiply for GF(2ⁿ))
-mrdrnd # RDRAND (hardware RNG)
-mbmi2 # BMI2 (PEXT/PDEP, bit-manipulation)
-maes # AES-NI (128-bit AES rounds; optional if VAES covers your AES use)
- Continued ASM/SIMD integration and optimization.
- Wrapper library for Java.
- Expansion of testing and benchmarking frameworks.
- Integration of emerging cryptographic research and standards.
INVESTMENT INQUIRIES:
QRCS is currently seeking a corporate investor for this technology.
Parties interested in licensing or investment should connect to us at: [email protected]
Visit https://www.qrcscorp.ca for a full inventory of our products and services.
PATENT NOTICE: One or more patent applications (provisional and/or non-provisional) covering aspects of this software have been filed with the United States Patent and Trademark Office (USPTO). Unauthorized use may result in patent infringement liability.
License and Use Notice (2025-2026)
This repository contains cryptographic reference implementations, test code, and supporting materials published by Quantum Resistant Cryptographic Solutions Corporation (QRCS) for the purposes of public review, cryptographic analysis, interoperability testing, and evaluation.
All source code and materials in this repository are provided under the Quantum Resistant Cryptographic Solutions Public Research and Evaluation License (QRCS-PREL), 2025-2026, unless explicitly stated otherwise.
This license permits public access and non commercial research, evaluation, and testing use only. It does not permit production deployment, operational use, or incorporation into any commercial product or service without a separate written agreement executed with QRCS.
The public availability of this repository is intentional and is provided to support cryptographic transparency, independent security assessment, and compliance with applicable cryptographic publication and export regulations.
Commercial use, production deployment, supported builds, certified implementations, and integration into products or services require a separate commercial license and support agreement.
For licensing inquiries, supported implementations, or commercial use, contact: [email protected]
Quantum Resistant Cryptographic Solutions Corporation, 2026.
All rights reserved by QRCS Corp. 2026.