@qorechain/pqc
v0.1.0
Published
QoreChain post-quantum cryptography — FIPS-204 ML-DSA, FIPS-203 ML-KEM, FIPS-202 SHAKE-256, with blockchain helpers. Byte-compatible across Rust/Go/Python/Java/C via shared test vectors.
Downloads
43
Maintainers
Readme
@qorechain/pqc
Post-quantum cryptography for QoreChain — standardized NIST primitives with one consistent API, proven byte-compatible against a shared cross-language test-vector suite.
| Primitive | Standard | Role | |---|---|---| | ML-DSA | FIPS-204 | digital signatures (44 · 65 · 87) | | ML-KEM | FIPS-203 | key encapsulation (512 · 768 · 1024) | | SHAKE-256 | FIPS-202 | extendable-output hash |
Backed by @noble/post-quantum.
Install
npm install @qorechain/pqcUse
import { mldsa, mlkem, shake256, pubkeyHash } from '@qorechain/pqc';
// ML-DSA-87 signatures
const { publicKey, secretKey } = mldsa.keygen();
const sig = mldsa.sign(secretKey, message);
mldsa.verify(publicKey, message, sig); // true
// ML-KEM-1024 key encapsulation
const { publicKey: ek, secretKey: dk } = mlkem.keygen();
const { cipherText, sharedSecret } = mlkem.encapsulate(ek);
mlkem.decapsulate(dk, cipherText); // === sharedSecret
// SHAKE-256 + blockchain helpers
shake256(data, 32); // 32-byte digest
pubkeyHash(publicKey, 20); // pay-to-pubkey-hashLevel-specific exports: mldsa44/65/87, mlkem512/768/1024 (mldsa/mlkem are the L5 defaults). Also hybridSignBytes(bodyWithoutPqcExt, authInfo) and batchVerify.
Interop
Every binding (JS, Rust, Go, C, Python, Java) verifies the same vectors in /vectors, so a signature produced here verifies in every other language. See the root README.
License
Apache-2.0
