Skip to main content

Module session

Module session 

Source
Expand description

The C ABI for encrypted, authenticated sessions.

These functions wrap [pamoja_session] for callers that reach the SDK through the flat C boundary: the key agreement two devices use to arrive at the same session key without sending it, and the sealed messages that key then protects.

A session holds the counter it sends under and the window of what it has accepted, so it crosses as an opaque handle; so does an agreement key, because it holds a secret that should not be copied around by value. Messages are encrypted in place, so the caller supplies the buffer and nothing allocates.

Structs§

PamojaAgreementKey
An opaque handle to a key-agreement secret.
PamojaSealed
The header that travels beside a sealed message.
PamojaSession
An opaque handle to a live session with one peer.

Enums§

PamojaSessionRole
Which side of a session a device is on.

Constants§

PAMOJA_SESSION_KEY_LEN
The length in bytes of an agreement seed, a public key, and a digest.
PAMOJA_SESSION_TAG_LEN
The length in bytes of the tag that authenticates a sealed message.

Functions§

pamoja_agreement_key_free
Releases an agreement key handle.
pamoja_agreement_key_from_seed
Creates a key-agreement secret from a provisioned 32-byte seed.
pamoja_agreement_key_public
Copies out the public key to hand to a peer.
pamoja_session_establish
Establishes a session with a peer.
pamoja_session_free
Releases a session handle.
pamoja_session_hkdf_sha256
Expands input keying material into as many bytes as are asked for.
pamoja_session_hmac_sha256
Computes a keyed hash over a message.
pamoja_session_open
Opens a message from the peer, verifying it and decrypting it in place.
pamoja_session_seal
Seals a message for the peer, encrypting it in place.