Crate libsignal_protocol
source ·Expand description
Rust implementation of the Signal Protocol for asynchronous forward-secret public-key cryptography.
In particular, this library implements operations conforming to the following specifications:
- the X3DH key agreement protocol,
- the Double Ratchet (Axolotl) messaging protocol,
Re-exports§
pub use error::SignalProtocolError;
Modules§
- Keys and protocol functions for standard key encapsulation mechanisms (KEMs).
Structs§
- The type used in memory to represent a device, i.e. a particular Signal client instance which represents some user.
- A public key that represents the identity of a user.
- The private identity of a user.
- Reference implementation of traits::IdentityKeyStore.
- Reference implementation of traits::KyberPreKeyStore.
- Reference implementation of traits::PreKeyStore.
- Reference implementation of traits::SenderKeyStore.
- Reference implementation of traits::SessionStore.
- Reference implementation of traits::ProtocolStore.
- Reference implementation of traits::SignedPreKeyStore.
- A unique identifier selecting among this client’s known signed pre-keys.
- A unique identifier selecting among this client’s known pre-keys.
- Represents a unique Signal client instance as
(<user ID>, <device ID>)
pair. - A parsed representation of a Sealed Sender v2 SentMessage.
- Represents a single recipient in an SSv2 SentMessage.
- A unique identifier selecting among this client’s known signed pre-keys.
- Timestamp recorded as milliseconds since the Unix epoch.
Enums§
- Each Signal message can be considered to have exactly two participants, a sender and receiver.
- A Signal service ID, which can be one of various types.
- Known types of ServiceId.
Traits§
- Interface defining the identity store, which may be in-memory, on-disk, etc.
- Interface for storing signed Kyber pre-keys downloaded from a server.
- Interface for storing pre-keys downloaded from a server.
- Mixes in all the store interfaces defined in this module.
- Interface for storing sender key records, allowing multiple keys per user.
- Interface for a Signal client instance to store a session associated with another particular separate Signal client instance.
- Interface for storing signed pre-keys downloaded from a server.
Functions§
- For testing
- Decrypt a Sealed Sender message
ciphertext
in either the v1 or v2 format, validate its sender certificate, and then decrypt the inner message payload. - Decrypt the payload of a sealed-sender message in either the v1 or v2 format.
- Encrypt the plaintext message
ptext
, generate anUnidentifiedSenderMessageContent
, then pass the result tosealed_sender_encrypt_from_usmc
. - This method implements the single-key single-recipient KEM described in this Signal blog post, a.k.a. Sealed Sender v1.
- This method implements a single-key multi-recipient KEM as defined in Manuel Barbosa’s “Randomness Reuse: Extensions and Improvements”, a.k.a. Sealed Sender v2.
Type Aliases§
- A service ID representing an ACI (“ACcount Identifier”).
- A service ID representing a PNI (“Phone Number Identifier”).
- The fixed-width binary representation of a ServiceId.