fn crypt(
        &'a self,
        source: Option<&'a mut [u8]>,
        dest: &'a mut [u8],
        start_index: usize,
        stop_index: usize,
    ) -> Option<(ReturnCode, Option<&'a mut [u8]>, &'a mut [u8])> {
        match source {
            None => Some((ReturnCode::EINVAL, source, dest)),
            Some(src) => {
                if stop_index - start_index <= MAX_LENGTH {
                    // replace buffers
                    self.input.replace(src);
                    self.output.replace(dest);

                    // configure buffer offsets
                    self.current_idx.set(0);
                    self.start_idx.set(start_index);
                    self.end_idx.set(stop_index);

                    // start crypt
                    self.crypt();
                    None
                } else {
                    Some((ReturnCode::ESIZE, Some(src), dest))
                }
            }
        }
    }
// start_index and stop_index not used!!!
// assuming that
start_index and stop_index not used
assuming that
start_index and stop_index not used assuming that
fn crypt(
        &'a self,
        source: Option<&'a mut [u8]>,
        dest: &'a mut [u8],
        start_index: usize,
        stop_index: usize,
    ) -> Option<(ReturnCode, Option<&'a mut [u8]>, &'a mut [u8])> {
        match source {
            None => Some((ReturnCode::EINVAL, source, dest)),
            Some(src) => {
                if stop_index - start_index <= MAX_LENGTH {
                    // replace buffers
                    self.input.replace(src);
                    self.output.replace(dest);
                    // configure buffer offsets
                    self.current_idx.set(0);
                    self.start_idx.set(start_index);
                    self.end_idx.set(stop_index);
                    // start crypt
                    self.crypt();
                    None
                } else {
                    Some((ReturnCode::ESIZE, Some(src), dest))
                }
            }
        }
    }
fn crypt ( & ' a self , source : Option < & ' a mut [ u8 ] > , dest : & ' a mut [ u8 ] , start_index : usize , stop_index : usize , ) -> Option < ( ReturnCode , Option < & ' a mut [ u8 ] > , & ' a mut [ u8 ] ) > { match source { None => Some ( ( ReturnCode :: EINVAL , source , dest ) ) , Some ( src ) => { if stop_index - start_index <= MAX_LENGTH { // replace buffers self . input . replace ( src ) ; self . output . replace ( dest ) ; // configure buffer offsets self . current_idx . set ( 0 ) ; self . start_idx . set ( start_index ) ; self . end_idx . set ( stop_index ) ; // start crypt self . crypt ( ) ; None } else { Some ( ( ReturnCode :: ESIZE , Some ( src ) , dest ) ) } } } }
start_index and stop_index not used!!!
start_index and stop_index not used!!!
&'a self
source
Option<&'a mut [u8]>
dest
&'a mut [u8]
start_index
usize
stop_index
usize
&'a self
source
Option<&'a mut [u8]>
dest
&'a mut [u8]
start_index
usize
stop_index
usize