Trait wow_srp::header_crypto::Encrypter[][src]

pub trait Encrypter {
    fn encrypt(&mut self, data: &mut [u8]);

    fn write_encrypted_server_header<W: Write>(
        &mut self,
        write: &mut W,
        size: u16,
        opcode: u16
    ) -> Result<()> { ... }
fn write_encrypted_client_header<W: Write>(
        &mut self,
        write: &mut W,
        size: u16,
        opcode: u32
    ) -> Result<()> { ... }
fn encrypt_server_header(&mut self, size: u16, opcode: u16) -> [u8; 4] { ... }
fn encrypt_client_header(&mut self, size: u16, opcode: u32) -> [u8; 6] { ... } }
Expand description

The Encrypter trait allows for decrypting world packet headers.

Only the Encrypter::encrypt method is required to be implemented, the rest are provided as convenience wrappers around it.

The are no async convenience methods because it can be trivially implemented by the user, and it would be tedious to support all the different runtimes. If in doubt look at the source for the Write versions.

Required methods

Directly encrypt the unencrypted data and leave the encrypted values.

Provided methods

Convenience function for encrypting client headers.

Prefer this over directly using Encrypter::encrypt.

Convenience function for encrypting client headers.

Prefer this over directly using Encrypter::encrypt.

Implementors