Tiers make the risk visible in your code
Every algorithm carries a tier. The safe API can only reach safe and standard algorithms; everything else needs the root API, so choosing an old, broken or unproven algorithm is always explicit.
| Tier | Algorithms | Meaning | Reachable from |
|---|---|---|---|
| safe | 33 | Modern and recommended. The default choice for new designs. | safe API and root |
| standard | 147 | Standardised and sound. Reachable from the safe API. | safe API and root |
| legacy | 48 | Old but not broken. Kept for interoperability; root API only. | root only |
| broken | 26 | Practical attacks exist. Present for compatibility and research only. | root only |
| research | 45 | Experimental or unclassified. Root API only. | root only |
| unverified | 1584 | Source found and wired, correctness not fully proven. Root API only. | root only |
Status, read this first
There has been no external security audit, nothing here is FIPS validated, the API may change and no release exists yet. 96 entries carry a FIPS flag only because the algorithm is specified in a FIPS standard; no NIST or CMVP certificate is claimed.
How the core is built
Rust is the safe shell. All untrusted input — parsers, envelopes, parameters, lengths — is handled in Rust. unsafe is allowed only in the FFI crate and in per-algorithm C wrappers.
Upstreams are copied, not rewritten. Each C or C++ core is vendored verbatim at a pinned commit with its license. Upstream symbols are renamed with a per-algorithm prefix so no two cores collide.
Ports are labelled. When the only trustworthy source is in another language, it may be ported line by line to C. A port is always tier unverified and must pass a differential test against the original.
Secrets are zeroized on every exit path, and secret-dependent code is meant to run under constant-time checks. Nothing falls back silently to another algorithm; every length and parameter is validated with an explicit error.
Envelopes
The safe API wraps results in self-describing COSE envelopes (COSE_Encrypt0 and COSE_Sign1, RFC 9052), with a text form of nxs1. followed by unpadded base64url. The algorithm is named in the protected header by its registered COSE id, and decoders enforce size, depth and tier limits.
Broken on purpose
26These have practical attacks. They are in the archive for interoperability and research, and only the root API can reach them.