pub fn cipher_data(&mut self, data: &mut Vec<u8>, incoming: bool) {
        let mut buf_copy = data.clone();
        if incoming == true {
            self.key_pair
                .incoming
                .xor_key_stream(&mut data[5..], &mut buf_copy[5..]);
        } else {
            self.key_pair
                .outgoing
                .xor_key_stream(&mut data[5..], &mut buf_copy[5..]);
        }
    }
/// Might need to make this return the data buffer
Might need to make this return the data buffer
Might need to make this return the data buffer
pub fn cipher_data(&mut self, data: &mut Vec<u8>, incoming: bool) {
        let mut buf_copy = data.clone();
        if incoming == true {
            self.key_pair
                .incoming
                .xor_key_stream(&mut data[5..], &mut buf_copy[5..]);
        } else {
            self.key_pair
                .outgoing
                .xor_key_stream(&mut data[5..], &mut buf_copy[5..]);
        }
    }
pub fn cipher_data ( & mut self , data : & mut Vec < u8 > , incoming : bool ) { let mut buf_copy = data . clone ( ) ; if incoming == true { self . key_pair . incoming . xor_key_stream ( & mut data [ 5 .. ] , & mut buf_copy [ 5 .. ] ) ; } else { self . key_pair . outgoing . xor_key_stream ( & mut data [ 5 .. ] , & mut buf_copy [ 5 .. ] ) ; } }
Might need to make this return the data buffer
Might need to make this return the data buffer
&mut self
data
&mut Vec<u8>
incoming
bool
&mut self
data
&mut Vec<u8>
incoming
bool