void bcal_cbc_encMsg(const void *iv, void *msg, uint16_t msg_blocks, bcal_cbc_ctx_t *ctx){ bcal_cbc_loadIV(iv, ctx); while(msg_blocks--){ bcal_cbc_encNext(msg, ctx); msg = (uint8_t*)msg + ctx->blocksize_B; } }
// encrypt one or more blocks of 128bit data // data_len should be mod 16 void aes192_cbc_enc_continue(const aes_context ctx, void* data, const uint16_t data_len){ if (data_len % 16 != 0) { return; } bcal_cbc_ctx_t* _ctx = (bcal_cbc_ctx_t*)ctx; uint16_t msg_blocks = data_len / 16; while(msg_blocks--){ bcal_cbc_encNext(data, _ctx); data = (uint8_t*)data + _ctx->blocksize_B; } }