Skip to main content

securedrop_protocol_minimal/
lib.rs

1#![no_std]
2// Deny direct access to system randomness except in tests.
3// See clippy.toml
4// hax breaks on these clippy statements
5#![cfg_attr(not(hax), deny(clippy::disallowed_types, clippy::disallowed_methods))]
6#![cfg_attr(all(not(hax), test), allow(clippy::disallowed_types))]
7#![cfg_attr(all(not(hax), test), allow(clippy::disallowed_methods))]
8extern crate alloc;
9
10pub mod api;
11mod ciphertext;
12pub mod keys;
13pub mod primitives;
14pub mod server;
15pub mod setup;
16mod traits;
17pub mod wire;
18
19pub mod journalist;
20pub mod source;
21
22pub use ciphertext::{Envelope, FetchResponse, Plaintext};
23
24pub use keys::{
25    DhFetchKeyPair, Enrollment, KeyBundlePublic, KeyPair, SessionStorage, SignedKeyBundlePublic,
26    SignedLongtermPubKeyBytes, SigningKeyPair,
27};
28pub use primitives::dh_akem::DH_AKEM_PUBLIC_KEY_LEN;
29pub use primitives::mlkem::{MLKEM768_PRIVATE_KEY_LEN, MLKEM768_PUBLIC_KEY_LEN};
30pub use primitives::x25519::DH_PUBLIC_KEY_LEN;
31pub use primitives::xwing::XWING_PUBLIC_KEY_LEN;
32
33pub use traits::{Enrollable, JournalistPublic, UserPublic, UserSecret};
34
35pub use journalist::{
36    EphemeralBundleBytes, Journalist, JournalistLongTermBytes, JournalistPublicView,
37};
38pub use source::{Source, SourcePublicView};
39
40pub(crate) use keys::MessageKeyBundle;
41
42// Primitives for signing
43pub mod sign;
44pub use sign::{
45    DomainTag, FpfOnNewsroom, JournalistEphemeralKey, JournalistLongTermKey, NewsroomOnJournalist,
46    Signature, SigningKey, VerifyingKey,
47};
48
49pub mod storage;
50
51pub mod encrypt_decrypt;
52pub mod message;
53pub mod metadata;
54
55// Do not make this module public or re-export it anywhere!
56/// It uses the [sealed trait pattern](https://rust-lang.github.io/api-guidelines/future-proofing.html#c-sealed)
57/// to gate features that downstream crates should not implement.
58mod sealed;