intel / isa-l_crypto

Other
275 stars 80 forks source link

Why len_bytes must be a multiple of 16bytes in aes_cbc? #112

Closed chenxuqiang closed 1 year ago

chenxuqiang commented 1 year ago
void aes_cbc_dec_128(
    void     *in,        //!< Input cipher text
    uint8_t  *IV,        //!< Must be 16 bytes aligned to a 16 byte boundary
    uint8_t  *keys,      //!< Must be on a 16 byte boundary and length of key size * key rounds or dec_keys of cbc_key_data
    void     *out,       //!< Output plain text
    uint64_t len_bytes   //!< Must be a multiple of 16 bytes
    );

Why len_bytes must be a multiple of 16bytes? Why not pad in use (16 - len_bytes % 16)? (・∀・)?

gbtucker commented 1 year ago

Just not a common feature request for CBC. User can still run with padded input and output buffer sizes if necessary.