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::x25519::DH_PUBLIC_KEY_LEN;
30pub use primitives::xwing::XWING_PUBLIC_KEY_LEN;
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;