exo_messaging/lib.rs
1// Copyright 2026 Exochain Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at:
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// SPDX-License-Identifier: Apache-2.0
16
17//! EXOCHAIN constitutional trust fabric — end-to-end encrypted messaging.
18//!
19//! This crate provides:
20//!
21//! - **Key exchange** (`kex`) — X25519 Diffie-Hellman with caller-supplied key material
22//! - **Message envelopes** (`envelope`) — Encrypted message container types
23//! - **Compose & lock** (`compose`) — Sender-side: encrypt + sign → Lock & Send
24//! - **Open & verify** (`open`) — Recipient-side: decrypt + verify signature
25//! - **Death triggers** (`death_trigger`) — Afterlife message release state machine
26
27#![cfg_attr(test, allow(clippy::expect_used, clippy::unwrap_used))]
28
29pub mod compose;
30pub mod death_trigger;
31pub mod envelope;
32pub mod error;
33pub mod kex;
34pub mod open;
35
36pub use compose::{
37 ComposeMetadata, attach_verified_signature, lock_and_send, lock_and_send_with_ephemeral,
38 prepare_envelope_for_signing, prepare_envelope_for_signing_with_ephemeral,
39 sign_prepared_envelope,
40};
41pub use envelope::{ContentType, EncryptedEnvelope};
42pub use error::MessagingError;
43pub use kex::{X25519KeyPair, X25519PublicKey, X25519SecretKey};
44pub use open::unlock;