fn pad_to_1024(&self, bytes: &[u8]) -> Vec<u8> {
        let mut out = vec![];
        let len = bytes.len() as u32;

        out.push(0);
        out.push(1);
        // 7 comes from the 0 and 1 in the beginning, the 0 byte at the end, plus four for the length
        for _ in 0..(128 - 7 - len) {
            out.push(std::u8::MAX);
        }
        out.push(0);
        out.append(&mut len.to_be_bytes().to_vec());
        out.append(&mut bytes.to_vec());
        out
    }
// padding format is 00h 01h ffh ffh ... ffh ffh 00h 32bitLength String+SHA1
padding format is 00h 01h ffh ffh ... ffh ffh 00h 32bitLength String+SHA1
padding format is 00h 01h ffh ffh ... ffh ffh 00h 32bitLength String + SHA1
fn pad_to_1024(&self, bytes: &[u8]) -> Vec<u8> {
        let mut out = vec![];
        let len = bytes.len() as u32;
        out.push(0);
        out.push(1);
        // 7 comes from the 0 and 1 in the beginning, the 0 byte at the end, plus four for the length
        for _ in 0..(128 - 7 - len) {
            out.push(std::u8::MAX);
        }
        out.push(0);
        out.append(&mut len.to_be_bytes().to_vec());
        out.append(&mut bytes.to_vec());
        out
    }
fn pad_to_1024 ( & self , bytes : & [ u8 ] ) -> Vec < u8 > { let mut out = vec ! [ ] ; let len = bytes . len ( ) as u32 ; out . push ( 0 ) ; out . push ( 1 ) ; // 7 comes from the 0 and 1 in the beginning, the 0 byte at the end, plus four for the length for _ in 0 .. ( 128 - 7 - len ) { out . push ( std :: u8 :: MAX ) ; } out . push ( 0 ) ; out . append ( & mut len . to_be_bytes ( ) . to_vec ( ) ) ; out . append ( & mut bytes . to_vec ( ) ) ; out }
padding format is 00h 01h ffh ffh ... ffh ffh 00h 32bitLength String+SHA1
padding format is 00h 01h ffh ffh ... ffh ffh 00h 32bitLength String + SHA1
&self
bytes
&[u8]