How APEX-256 is built, from the outside
What APEX-256 looks like from the outside: a 40-byte context, no heap, a 64-bit or 256-bit (X256) nonce, optional 256-byte forward-secrecy ratcheting, word-rate (W64) and full-state (F256) companion modes, and a 24-round constant-time initialization. The internals (state layout, round functions, constants, reference code) are available under an Apex Evaluation NDA.
40 bytes of state, nothing else
Each cipher instance lives in a 40-byte context in registers and on the stack. No heap, and nothing in static .bss/.tbss/.data.
256-Bit Symmetric Key & Nonce Interface
256-Bit Key + 64-Bit Std or 256-Bit X256 Nonce
Supports full 256-bit symmetric keys paired with either standard 64-bit session nonces or extended 256-bit (X256) nonces (2128 random-nonce collision bound with zero added RAM).
Zero-Heap & Zero-BSS Memory Contract
40-Byte Self-Contained Instance Footprint
Requires 0 bytes of dynamic heap allocation and 0 bytes of global or static RAM on the 32-bit and 64-bit targets we support. Instances share no state, so you can run as many as you have stack for.
Constant-Time, Table-Free Execution
Zero Secret Branches • Zero Lookup Tables
Executes with zero secret-dependent conditional branches and zero S-box lookup tables. We check that in disassembly across several ISAs and in our own power captures (CPA |r| = 0.0024, Welch |t| = 0.74 < 4.50). That closes timing and cache leaks; power and EM leakage is measured, not ruled out.
Same length out as in, plus optional companion modes
Zero Ciphertext Expansion in Stream Mode
Generates a 1:1 keystream with zero payload expansion, complemented by compile-time selectable companion modes for AEAD, hashing, MAC, KDF, DRBG, VFS sector encryption, CFB, FPE, and memory tamper detection.
From key to keystream
Every stage, from loading the key to wiping the context, is constant-time: no branches on secret data and no S-box tables.
Four stages
Load the key and nonce
Takes the 256-bit key and a nonce (64-bit standard or 256-bit X256) into the 40-byte context. Each operating mode is domain-separated from the others.
24-Round Constant-Time Burn-In
Runs 24 fixed, branchless rounds before the first keystream byte. Our reduced-round attacks (SMT, SAT, MILP, neural) stop finding structure well before round 24, which by our own measurement leaves a 4.0x to 24.0x margin depending on the method.
Constant-time state updates
Moves the state forward with no table lookups and no branches on secret data. It also includes hardware side-channel countermeasures; in our CPA and TVLA captures, leakage stayed below the detection threshold (CPA |r| = 0.0024, Welch |t| = 0.74 < 4.50).
Encrypt, then wipe
Output is exactly as long as input, however you split it into chunks. Optional: 256-byte forward-secrecy ratcheting, 4x to 8x faster multi-byte processing, and deep-sleep checkpointing. The context is wiped when you are done.
Optional features
- Extended 256-Bit Nonce (
X256): Extended-nonce initialization and AEAD envelopes expand random-nonce birthday safety from232to2128messages with zero added RAM. - Forward-Secrecy Keyframe Ratcheting: Optional keyframe ratcheting executes an irreversible one-way state transition every 256 bytes (100% chunk-split invariant) so a physical RAM capture cannot be inverted to recover prior keystream.
- Companion modes: Independent full-256-bit companion classes for hashing, MAC, KDF, AEAD, DRBG, seekable sector storage (VFS), cipher feedback (CFB), format-preserving encryption (FPE), and stealth execution operate in self-contained
40-byteor48-bytestack contexts with0 Bheap,0 Bstatic.bss, and automatic destructor zeroization. - High-Throughput Multi-Byte Processing: Delivers
4xto8xthroughput acceleration across bulk stream encryption, hashing, MAC, KDF, sector processing, and AEAD while preserving 100% streaming chunk invariance and1:1byte-stream compatibility.
Intellectual Property Restriction: Internal register topologies, round equations, constants, state-guard circuits, and the single-header C/C++ reference library (apex256_nano.h) are proprietary intellectual property provided exclusively to vetted organizations under an executed Apex Evaluation NDA.
What we checked about initialization
Initialization is 24 fixed rounds with no conditional branches, so how long it takes never depends on the key or nonce. Our reduced-round testing across seven methods puts the margin at 4.0x to 24.0x, depending on the method.
What was checked, and how
- Key and nonce binding: Every key bit and nonce bit affects the whole internal state before the first keystream byte. For the initialization as we modeled it, Z3 and Bitwuzla found no two keys in the
2256key space that give the same state under the same nonce (UNSAT). - Weak keys and degenerate states: Initialization includes branchless state checks. Our SMT searches found no weak keys and no short-cycle orbits for the properties we modeled. That rules out the failure modes we looked for, not every possible one.
- Deterministic Instruction & Cycle Count: Initialization executes an identical instruction trace and cycle count across all keys and nonces, verified via multi-ISA binary disassembly and Unicorn CPU instruction tracing.
- Fail-Closed API Contract: Uninitialized or malformed contexts fail closed and immediately scrub caller output buffers before returning an error status.
Authoritative Known Answer Test (KAT)
Standardized test vectors for verifying compliant implementations of the 24-round initialization sequence.
Verification & Compliance Test Vectors
Authoritative Known Answer Test (KAT) suites covering all-zero keys, randomized nonce matrices, edge-condition burn-in sequences, and 32TB PractRand statistical validation streams are maintained in the official APEX-256 Test Harness.
Complete 16-byte, 64-byte, and multi-gigabyte authoritative test vectors and automated C unit tests are provided in the Evaluation SDK.
Intellectual Property & Evaluation Access
The APEX-256 cipher suite is the exclusive intellectual property of Apex Research Labs, LLC (Henderson, NV) and is protected by pending U.S. and International Patent Applications. The complete C/C++ reference SDK (single-header apex256_nano.h), formal Z3 SMT verification scripts, and automated hardware test harnesses are available under an evaluation Non-Disclosure Agreement (NDA).