Weave documentation
Rust referencel1fe-weave-core

l1fe-weave-core · crypto::secret_stream

Source declarations, signatures and documentation for crypto::secret_stream.

Reviewed implementation boundary: Some core wrappers derive transport keys from DID strings. Do not infer secret key custody or authenticated peers from a supplied DID string; inspect the chosen wrapper and transport configuration. See /libraries/weave-core/overview.

Source: sigil/weave/libs/weave-core/src/crypto/secret_stream.rs. SHA-256: 199864974241e7046c3d8cb804ec30af710fd24114f27d2cbab0ad5bd715a222.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

crypto::secret_stream::SecretStreamConfig

Configuration for secret streams

#[derive(Debug, Clone)]
pub struct SecretStreamConfig {
/// Buffer size for streaming

pub buffer_size: usize,
/// Whether to use ephemeral keys

pub ephemeral: bool
}

Source line: 14.

crypto::secret_stream::SecretStream

Secret stream for encrypted communication

pub struct SecretStream {

}

Source line: 31.

crypto::secret_stream::SecretStream::new

Create a new secret stream between two parties

Note: This uses ephemeral X25519 keys for key exchange, which are separate from identity keys managed by weave-identity

pub fn new(_our_secret: &[u8; 32], their_public: &[u8; 32]) -> Result<Self>;

Source line: 45.

crypto::secret_stream::SecretStream::generate_ephemeral_keypair

Generate an ephemeral key pair for secret stream Returns (secret_key, public_key)

pub fn generate_ephemeral_keypair() -> ([u8; 32], [u8; 32]);

Source line: 76.

crypto::secret_stream::SecretStream::encrypt

Encrypt a message

pub fn encrypt(&mut self, plaintext: &[u8]) -> Result<Vec<u8>>;

Source line: 84.

crypto::secret_stream::SecretStream::decrypt

Decrypt a message

pub fn decrypt(&mut self, ciphertext: &[u8]) -> Result<Vec<u8>>;

Source line: 91.

crypto::secret_stream::SecretStream::encrypt_last

Encrypt the last message in the stream

pub fn encrypt_last(&mut self, plaintext: &[u8]) -> Result<Vec<u8>>;

Source line: 98.

crypto::secret_stream::SecretStream::decrypt_last

Decrypt the last message in the stream

pub fn decrypt_last(&mut self, ciphertext: &[u8]) -> Result<Vec<u8>>;

Source line: 104.

On this page