1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Noise Protocol implementation for WhatsApp with AES-256-GCM.
//!
//! This crate provides both a generic Noise Protocol XX state machine and
//! WhatsApp-specific handshake utilities.
//!
//! # Structure
//!
//! - `NoiseState` - Generic Noise XX protocol state machine
//! - `NoiseHandshake` - WhatsApp-specific wrapper with libsignal DH
//! - `HandshakeUtils` - WhatsApp protocol message building/parsing
//!
//! # Example (Generic)
//!
//! ```ignore
//! use wacore_noise::{NoiseState, generate_iv};
//!
//! let mut noise = NoiseState::new(b"Noise_XX_25519_AESGCM_SHA256\0\0\0\0", &prologue)?;
//! noise.authenticate(&my_ephemeral_public);
//! noise.mix_key(&shared_secret)?;
//! let ciphertext = noise.encrypt(plaintext)?;
//! let keys = noise.split()?;
//! ```
//!
//! # Example (WhatsApp)
//!
//! ```ignore
//! use wacore_noise::{NoiseHandshake, HandshakeUtils};
//!
//! let mut nh = NoiseHandshake::new(NOISE_START_PATTERN, &WA_CONN_HEADER)?;
//! nh.authenticate(&ephemeral_public);
//! nh.mix_shared_secret(&private_key, &their_public)?;
//! let (write_key, read_key) = nh.finish()?;
//! ```
pub use Aes256Gcm;
pub use ;
pub use ;
pub use ;
pub use ;