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;
12mod constants;
13pub mod keys;
14pub mod primitives;
15pub mod server;
16pub mod setup;
17mod traits;
18pub mod wire;
19
20pub mod journalist;
21pub mod source;
22
23pub use constants::{LEN_DH_ITEM, LEN_MLKEM_ENCAPS_KEY, LEN_XWING_ENCAPS_KEY};
24
25pub use ciphertext::{Envelope, FetchResponse, Plaintext};
26
27pub use keys::{
28    DhFetchKeyPair, Enrollment, KeyBundlePublic, KeyPair, SessionStorage, SignedKeyBundlePublic,
29    SignedLongtermPubKeyBytes, SigningKeyPair,
30};
31
32pub use traits::{Enrollable, JournalistPublic, UserPublic, UserSecret};
33
34pub use journalist::{Journalist, JournalistPublicView};
35pub use source::{Source, SourcePublicView};
36
37pub(crate) use keys::MessageKeyBundle;
38
39// Primitives for signing
40pub mod sign;
41pub use sign::{
42    DomainTag, FpfOnNewsroom, JournalistEphemeralKey, JournalistLongTermKey, NewsroomOnJournalist,
43    Signature, SigningKey, VerifyingKey,
44};
45
46pub mod storage;
47
48pub mod encrypt_decrypt;
49pub mod message;
50pub mod metadata;
51
52// Do not make this module public or re-export it anywhere!
53/// It uses the [sealed trait pattern](https://rust-lang.github.io/api-guidelines/future-proofing.html#c-sealed)
54/// to gate features that downstream crates should not implement.
55mod sealed;