Expand description
Entropy is always an input. Nothing here generates randomness, so the engine stays deterministic.
Modules§
Structs§
- BadKey
Length - Buffer
TooShort - Ed25519
Public Key - Ed25519
Secret Key - Ed25519
Signature - Ed25519
Verifier - Decompresses the Edwards point once, for performance reasons.
VerifyingKey::from_bytesper proof was a measured ~8% of a firehose initiator’s CPU. - Hkdf
Output TooLong - The requested output exceeds HKDF-SHA256’s 255 * 32 byte ceiling (RFC 5869).
- Hmac
Sha256 Stream hmac_sha256_verifyfor a message arriving in spans; the tag comparison stays constant-time.- Invalid
Mac - Invalid
Public Key - The bytes are not a decompressible Edwards point, so no signature under this key can verify.
- Invalid
Signature - Sha256
Prefix State - The absorbed prefix of
sha256_prefix_and_digest_suffix, held apart so one pass over the payload can serve many suffix attempts. - Shared
Prefix Digests - Token
Key - Token
Open Stream token_open_in_placefor a token landing in contiguous spans:absorb_toauthenticates and decrypts each span in place as it grows, andfinalizeverifies the MAC in constant time before inspecting any padding, then names the plaintext. The final ciphertext block waits for that verdict too, so nothing padding-shaped is ever examined ahead of authentication. Callers must not release a decrypted byte beforefinalize.- X25519
Public Key - X25519
Secret Key - X25519
Shared Secret
Enums§
Constants§
- SHA256_
OUTPUT_ LEN - TOKEN_
OVERHEAD - RNS 1.4.2
Identity.TOKEN_OVERHEAD: the 16-byte IV and 32-byte HMAC around every sealed payload.
Functions§
- ed25519_
public_ key - ed25519_
sign - (deterministic, RFC 8032).
- ed25519_
verify - hkdf_
sha256 - HKDF-SHA256 (RFC 5869);
salt/infomap to RNS’ssalt/context. - hkdf_
sha256_ into - RNS masks derive a stream as long as the packet, so the length is runtime-sized.
- hmac_
sha256 - hmac_
sha256_ chunks - hmac_
sha256_ verify - The tag comparison is constant-time;
==against a computed tag would leak where it mismatched. - sealed_
len - PKCS#7 always pads (1..=
BLOCK_LENbytes), so a sealed token strictly outgrows its plaintext. - sha256
- sha256_
chunks - sha256_
prefix_ and_ digest_ suffix - One pass over the
prefixchunks feeds both digests: the midstate is cloned, not rehashed. Two independent hashes would walk the shared prefix twice, and callers pass resource-sized payloads. - token_
is_ authentic - The mutation-free prefix of
token_open_in_place, for ratchet trials before the one in-place decrypt. - token_
open - Verifies the MAC (constant time) before decrypting.
outmust hold the whole ciphertext (token.len() - TOKEN_OVERHEAD); padding is only stripped after the in-place decrypt. - token_
open_ in_ place - MAC-verified (constant time) then decrypted in place; the plaintext is a sub-slice of
token. - token_
seal - token_
seal_ chunks chunksseal exactly as if concatenated.- token_
seal_ in_ place token_seal_chunksfor a plaintext already sitting inoutat its sealed offset (IV_LEN..IV_LEN + plain_len): pads, encrypts, and MACs in place, skipping the staging copy.- x25519_
diffie_ hellman - The shared secret of
secretwithpeer(RFC 7748 clamping applied). - x25519_
keys_ for_ seal - x25519_
public_ key