Skip to main content

Crate oxabl_cache_crypto

Crate oxabl_cache_crypto 

Source
Expand description

Client-only cryptography: key hierarchy, lookup ids, seal and open, signatures, roster.

Every function that takes bytes from outside treats them as hostile: it checks lengths against the format limits before allocating and returns Error instead of panicking. Secret types zeroize on drop and never print their contents. The server must never link this crate.

Re-exports§

pub use dictionary::DEFAULT_DICTIONARY_BYTES;
pub use dictionary::Dictionary;
pub use dictionary::MAX_DICTIONARY_BYTES;
pub use dictionary::train;
pub use dictionary_pointer::sign_pointer;
pub use dictionary_pointer::verify_pointer;
pub use error::Error;
pub use error::Result;
pub use identity::Identity;
pub use keys::LookupKey;
pub use keys::RecordKey;
pub use keys::RootKey;
pub use keys::SegmentKey;
pub use object_keys::ObjectKeys;
pub use record_context::RecordContext;
pub use record_entry::Entry;
pub use record_entry::EntryFields;
pub use record_entry::FileEntry;
pub use record_open::OpenedRecord;
pub use record_open::open_record;
pub use record_seal::seal_record;
pub use roster_draft::RosterDraft;
pub use roster_member::MemberEntry;
pub use roster_verify::RosterPins;
pub use roster_verify::VerifiedRoster;
pub use segment_info::SegmentSeal;
pub use segment_info::sealed_segment_len;
pub use segment_open::SegmentExpectation;
pub use segment_open::open_segment;
pub use segment_seal::DEFAULT_ZSTD_LEVEL;
pub use segment_seal::SealOptions;
pub use segment_seal::seal_compressed;
pub use segment_seal::seal_segment;
pub use telemetry::open_telemetry;
pub use telemetry::seal_telemetry;
pub use telemetry::telemetry_epoch;
pub use trust::AcceptedRecord;
pub use trust::Provenance;

Modules§

dictionary
Trained zstd dictionaries.
dictionary_pointer
The signed pointer to a cache’s dictionary segment.
error
identity
Member identities: one X25519 key to receive the root key and one Ed25519 key to sign.
identity_env
Loading an identity from the environment.
identity_file
Passphrase-protected identity files: an age file with one scrypt recipient.
identity_string
The Bech32 forms of an identity and its public descriptor.
keys
The cache root key of an epoch and the sub-keys derived from it.
lookup
Lookup ids: the keyed hash of a compile key.
object_keys
Single-use keys of one sealed object, derived from a sub-key and the object’s salt.
record_context
What a record is bound to: cache, epoch, namespace kind and lookup id.
record_entry
The content of a record, as owned values.
record_open
Opening a record: commitment, AEAD, strict decoding and the signature over the transcript.
record_seal
Sealing a record: sign the transcript, pad to 256 bytes, encrypt as one AEAD message.
roster_draft
Building and changing rosters: genesis, add member, remove member, rotate.
roster_member
Roster members as owned values, and the rules every roster must satisfy.
roster_verify
Verifying a roster against the pins in the customer’s repository.
segment_info
What sealing a segment reports, and the size a sealed segment will have.
segment_open
Opening: id, header and commitment checks, STREAM decryption, then bounded decompression.
segment_seal
Sealing: zstd, Padmé padding and AES-256-GCM STREAM into an OXSG segment.
telemetry
Sealed telemetry reports: AES-256-GCM under a key derived from the cache root key, bound to the cache and the epoch, so only members of that epoch read them and the server reads none.
trust
Trust tiers: which signer a reader accepts for which namespace.

Traits§

ExposeSecret
Expose a reference to an inner secret

Functions§

open_dictionary
Verifies sealed against the signed dictionary id, opens it and prepares the dictionary for compression at level.
seal_dictionary
Seals a raw dictionary as a dictionary-kind segment.

Type Aliases§

SecretString
Secret string type.