INNER CODE UNIT · Rust
new
matrix-org/vodozemac · src/ecies/mod.rs:182
pub fn new() -> Self {
Self::with_info(MATRIX_QR_LOGIN_INFO_PREFIX)
}
/// Create a new, random, unestablished ECIES session with the given
/// application info.
///
/// The application info will be used to derive the various secrets and
/// provide domain separation.
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