INNER CODE UNIT · Rust
with_info
matrix-org/vodozemac · src/ecies/mod.rs:191
pub fn with_info(info: &str) -> Self {
let mut rng = rng();
let secret_key = EphemeralSecret::random_from_rng(&mut rng);
let application_info_prefix = info.to_owned();
Self { secret_key, application_info_prefix }
}
/// Create an [`EstablishedEcies`] session using the other side's Curve25519
/// public key and an initial plaintext.
///
/// After the channel has been established, we can encrypt messages to send
/// to the other side. The other side uses the initial message to
/// establishes the same channel on its side.
pub fn establish_outbound_channel(
self,
their_public_key: Curve25519PublicKey,
initial_plaintext: &[u8],