pub fn update<'b, X>(&mut self, data: X)
        where X: IntoIterator<Item = &'b u8> {
        let mut block = self.block;
        let mut ptr = self.ptr;
        for &v in data {
            let copy_ofs = ptr % 4;
            block |= (v as u32) << (copy_ofs * 8);
            ptr += 1;

            if copy_ofs == 3 {
                unsafe {
                    while self.sha.function_reg_1.read().fifo_in_full().bit() {
                        atomic::compiler_fence(Ordering::SeqCst)
                    }
                    self.sha.data_in.write(|w| w.bits(block));
                }
                block = 0;
            }
        }
        self.block = block;
        self.ptr = ptr;
    }
/** Update SHA256 computation with new data. */
Update SHA256 computation with new data.
Update SHA256 computation with new data .
pub fn update<'b, X>(&mut self, data: X)
        where X: IntoIterator<Item = &'b u8> {
        let mut block = self.block;
        let mut ptr = self.ptr;
        for &v in data {
            let copy_ofs = ptr % 4;
            block |= (v as u32) << (copy_ofs * 8);
            ptr += 1;
            if copy_ofs == 3 {
                unsafe {
                    while self.sha.function_reg_1.read().fifo_in_full().bit() {
                        atomic::compiler_fence(Ordering::SeqCst)
                    }
                    self.sha.data_in.write(|w| w.bits(block));
                }
                block = 0;
            }
        }
        self.block = block;
        self.ptr = ptr;
    }
pub fn update < ' b , X > ( & mut self , data : X ) where X : IntoIterator < Item = & ' b u8 > { let mut block = self . block ; let mut ptr = self . ptr ; for & v in data { let copy_ofs = ptr % 4 ; block |= ( v as u32 ) << ( copy_ofs * 8 ) ; ptr += 1 ; if copy_ofs == 3 { unsafe { while self . sha . function_reg_1 . read ( ) . fifo_in_full ( ) . bit ( ) { atomic :: compiler_fence ( Ordering :: SeqCst ) } self . sha . data_in . write ( | w | w . bits ( block ) ) ; } block = 0 ; } } self . block = block ; self . ptr = ptr ; }
Update SHA256 computation with new data.
Update SHA256 computation with new data .
&mut self
data
X
&mut self
data
X