pub fn xor_key_stream(&mut self, dst: &mut [u8], src: &mut [u8]) {
        let mut i = self.i;
        let mut j = self.j;
        let mut idx = 0;
        for v in src.iter() {
            i = i.wrapping_add(1);
            j = j.wrapping_add(self.s[i as usize] as u8);
            self.s.swap(i as usize, j as usize);
            let t = self.s[(self.s[i as usize].wrapping_add(self.s[j as usize])) as usize] as u8;
            dst[idx] = v ^ t;
            idx += 1;
        }
        // assert_eq!(idx, dst.len()); //check to make sure we guud
        self.i = i;
        self.j = j;
    }
/// Generic function to xor the buffer with the cipher. Generally, use a higher level wrapper over this.
Generic function to xor the buffer with the cipher. Generally, use a higher level wrapper over this.
Generic function to xor the buffer with the cipher . Generally use a higher level wrapper over this .
pub fn xor_key_stream(&mut self, dst: &mut [u8], src: &mut [u8]) {
        let mut i = self.i;
        let mut j = self.j;
        let mut idx = 0;
        for v in src.iter() {
            i = i.wrapping_add(1);
            j = j.wrapping_add(self.s[i as usize] as u8);
            self.s.swap(i as usize, j as usize);
            let t = self.s[(self.s[i as usize].wrapping_add(self.s[j as usize])) as usize] as u8;
            dst[idx] = v ^ t;
            idx += 1;
        }
        // assert_eq!(idx, dst.len()); //check to make sure we guud
        self.i = i;
        self.j = j;
    }
pub fn xor_key_stream ( & mut self , dst : & mut [ u8 ] , src : & mut [ u8 ] ) { let mut i = self . i ; let mut j = self . j ; let mut idx = 0 ; for v in src . iter ( ) { i = i . wrapping_add ( 1 ) ; j = j . wrapping_add ( self . s [ i as usize ] as u8 ) ; self . s . swap ( i as usize , j as usize ) ; let t = self . s [ ( self . s [ i as usize ] . wrapping_add ( self . s [ j as usize ] ) ) as usize ] as u8 ; dst [ idx ] = v ^ t ; idx += 1 ; } // assert_eq!(idx, dst.len()); //check to make sure we guud self . i = i ; self . j = j ; }
Generic function to xor the buffer with the cipher.
Generic function to xor the buffer with the cipher .
&mut self
dst
&mut [u8]
src
&mut [u8]
&mut self
dst
&mut [u8]
src
&mut [u8]