INNER CODE UNIT · Rust
new
matrix-org/vodozemac · src/cipher/mod.rs:117
pub fn new(key: &[u8; 32]) -> Self {
let keys = CipherKeys::new(key);
Self { keys }
}
/// Creates a new [`Cipher`] from the given 128-byte raw key.
///
/// The key is deterministically expanded into a 32-byte AES key, a 32-byte
/// MAC key, and a 16-byte initialization vector (IV) using HKDF, with
/// the byte string "MEGOLM_KEYS" used as the info during key
/// derivation.
///
/// This key derivation format is typically used for generating individual
/// message keys in the Megolm ratchet.
#[allow(unreachable_pub)]
pub fn new_megolm(&key: &[u8; 128]) -> Self {
let keys = CipherKeys::new_megolm(&key);