BACAP API over BLAKE2b-512 HKDF and AES-256-GCM-SIV #
Stateless: callers hold their own index. Operations take capabilities rather than loose keys, so
pk = publicKey sk holds by construction.
MessageBoxIndex: ratchet advancement #
Advance the ratchet to target, or none if that would rewind.
Equations
Instances For
See Ratchet.mutateKDFState.
Equations
Instances For
See Ratchet.ofRandomBytes.
Equations
Instances For
MessageBoxIndex: box IDs #
Box ID for this index under rootPublicKey, with no context applied.
Equations
- m.deriveMessageBoxID rootPublicKey = Cryptlib.Protocols.BACAP.Impl.implDeriveMessageBoxID rootPublicKey m
Instances For
Box ID for this index and ctx.
Equations
- m.boxIDForContext rc ctx = Cryptlib.Protocols.BACAP.Impl.implDeriveBoxID rc.rootPublicKey m ctx
Instances For
MessageBoxIndex: sign, verify, encrypt, decrypt #
Sign ciphertext with the blinded key for this index and ctx; returns (box ID, signature).
The signature is plain Ed25519 under the box ID.
Equations
- m.signBox owner ctx ciphertext = Cryptlib.Protocols.BACAP.Impl.implSignBox owner.rootPrivateKey m ctx ciphertext
Instances For
Verify a signature under a box ID.
Equations
- Cryptlib.Protocols.BACAP.Types.verifyBox box ciphertext sig = Cryptlib.Protocols.BACAP.Impl.implVerifyBox box ciphertext sig
Instances For
Returns (box ID, ciphertext, signature). The box ID's first 12 bytes are the AEAD nonce; all 32 bytes are the AD.
Equations
- m.encryptForContext owner ctx plaintext = Cryptlib.Protocols.BACAP.Impl.implEncryptBox owner.rootPrivateKey owner.rootPublicKey m ctx plaintext
Instances For
Verify the signature, then decrypt. A tombstone (empty ciphertext) decrypts to empty.
Equations
- m.decryptForContext box ctx ciphertext sig = Cryptlib.Protocols.BACAP.Impl.implDecryptBox box m ctx ciphertext sig
Instances For
Capabilities #
Box ID for idx under this cap's root key, with no context applied.
Equations
Instances For
Box ID for idx under this cap's root key, with no context applied.
Equations
Instances For
Re-seed this cap's index from ctx.
Equations
- wc.mutateKDFState ctx = { rootSeed := wc.rootSeed, messageBoxIndex := wc.messageBoxIndex.mutateKDFState ctx }
Instances For
Re-seed this cap's index from ctx.
Equations
- rc.mutateKDFState ctx = { rootPublicKey := rc.rootPublicKey, messageBoxIndex := rc.messageBoxIndex.mutateKDFState ctx }
Instances For
Mutating a write cap and its read cap by the same context lands them on the same sequence.
Key generation from the system CSPRNG #
Equations
Instances For
A fresh root keypair and starting index.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Correctness #
A cap's public key is the one its private key derives.
Decrypting a box encrypted under the same cap, index and context returns the plaintext.