pub fn pkcs7(b: &[u8], l: usize) -> Vec<u8> {
    if b.len() % l == 0 {
        return Vec::from(b);
    }

    let blocks = l - (b.len() % l);

    let mut result = Vec::from(b);

    for _ in 0..blocks {
        result.push(blocks as u8);
    }

    result
}
/// PKCS#7 padding
///
/// Solution for problem 1 from set 2: <https://cryptopals.com/sets/2/challenges/9>
PKCS#7 padding
Solution for problem 1 from set 2.
PKCS#7 padding Solution for problem 1 from set 2 .
pub fn pkcs7(b: &[u8], l: usize) -> Vec<u8> {
    if b.len() % l == 0 {
        return Vec::from(b);
    }
    let blocks = l - (b.len() % l);
    let mut result = Vec::from(b);
    for _ in 0..blocks {
        result.push(blocks as u8);
    }
    result
}
pub fn pkcs7 ( b : & [ u8 ] , l : usize ) -> Vec < u8 > { if b . len ( ) % l == 0 { return Vec :: from ( b ) ; } let blocks = l - ( b . len ( ) % l ) ; let mut result = Vec :: from ( b ) ; for _ in 0 .. blocks { result . push ( blocks as u8 ) ; } result }
PKCS#7 padding
Solution for problem 1 from set 2: <https://cryptopals.com/sets/2/challenges/9>
PKCS#7 padding Solution for problem 1 from set 2 : <https : // cryptopals . com / sets / 2 / challenges / 9 >
b
&[u8]
l
usize