Docs

Getting started with NextSSL

Build the C ABI library once, then call any algorithm by name from Rust, Python, JavaScript, Java, PHP, Swift or C.

1 · Build the library

cargo build -p nextssl-ffi --release
cargo build -p nextssl-ffi --release --features everything   # + copyleft and heavy algorithms

Produces libnextssl_ffi (.so, .dylib or .dll) and a static library. Every binding is a thin layer over it.

2 · Call an algorithm

from nextssl_demo import NextSSL

ns = NextSSL()                 # safe API: safe and standard tiers
root = NextSSL(root=True)      # every tier

digest = ns.call("hash_with", "sha256", None, b"abc")[0]
key, nonce = ns.random(32), ns.random(12)
ct = ns.call("aead_seal", "aes-256-gcm", None, key, nonce, b"hdr", b"secret")[0]
pk, sk = ns.call("kem_keygen", "ml-kem-768", None, outs=2)

3 · Compose constructions

Constructions are small expressions of lowercase names, nested up to four deep and validated before anything runs. A name in the wrong slot, an unknown name or an unsupported combination is an explicit error.

nextssl_root::compose("hmac(sha256)")?;
nextssl_root::compose("hkdf(sha256)")?;
nextssl_root::compose("pbkdf2(hmac(sha256))")?;
nextssl_root::compose("cmac(aes-128)")?;
nextssl_root::compose("cbc(aes-256)")?;
nextssl_root::compose("hmac-drbg(sha256)")?;

Language bindings

LanguageMechanismGuide
Rustcrates directlyrust.md
Pythonctypespython.md
JavaScriptNode / WASMjs.md
JavaFFMjava.md
PHPFFIphp.md
SwiftC interopswift.md
Cnextssl.hc-abi.md

Verify it yourself

cargo xtask gen --check          # generated tables, json and header are current
cargo xtask check-symbols        # exports are nextssl_*, upstream symbols prefixed
cargo test --workspace