@maatara/core-pqc-wasm
v0.2.0
Published
Ma'atara PQC WASM bindings
Downloads
17
Readme
@maatara/core-pqc-wasm
WASM bindings for Ma'atara's Post-Quantum Cryptography toolkit. Exposes Kyber ML‑KEM‑768, Dilithium (ML‑DSA‑65), HKDF‑SHA256, AES‑256‑GCM, and base64url helpers.
- Targets:
web(browsers) andbundler(modern bundlers) - Typings: included via wasm-pack generated
.d.ts - Size: ~238 KB
.wasm(0.1.0), under 500 KB budget
Install
npm install @maatara/core-pqc-wasmUsage (direct)
Most projects should depend on the higher-level wrapper @maatara/core-pqc. If you need the raw WASM exports:
import init, {
kyber_keygen,
kyber_encaps,
kyber_decaps,
hkdf_sha256,
aes_gcm_wrap,
aes_gcm_unwrap,
dilithium_keygen,
dilithium_sign,
dilithium_verify,
} from '@maatara/core-pqc-wasm';
await init();
const { public_b64u, secret_b64u } = JSON.parse(kyber_keygen());Security notes
- Zero‑knowledge: intended for client‑side use; servers should only perform verification.
- Constant‑time: uses vetted crates (
subtle,aes-gcm). - RNG:
getrandomwithjsfeature uses Web Crypto / Node WebCrypto. - Provenance: WASM uses pure‑Rust
ml-kemandml-dsacrates; native builds (not used here) rely onpqcrypto(PQClean).
Build targets
wasm-pack build --target webwasm-pack build --target bundler
