Skip to main content

build_obfuscated_init

Function build_obfuscated_init 

Source
pub fn build_obfuscated_init(
    framing_byte: u8,
    dc_id: i16,
    proxy_secret: Option<&[u8]>,
) -> ([u8; 64], ObfuscatedCipher)
Expand description

Generate the 64-byte obfuscated init buffer and build the cipher for it.

framing_byte: 0xef = Abridged, 0xdd = PaddedIntermediate. proxy_secret: if present, SHA-256 mixes the key with the secret (MTProxy).

Returns (nonce, cipher). The caller writes nonce to the stream; the cipher is used for all subsequent I/O on that connection.