1
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
3
* LibTomCrypt is a library that provides various cryptographic
4
* algorithms in a highly modular and flexible manner.
6
* The library is free for all purposes without any express
9
* Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org
15
int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key,
16
int keylen, int num_rounds, symmetric_CBC *cbc)
25
if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {
30
if ((err = cipher_descriptor[cipher].setup(key, keylen, num_rounds, &cbc->key)) != CRYPT_OK) {
35
cbc->blocklen = cipher_descriptor[cipher].block_length;
37
for (x = 0; x < cbc->blocklen; x++) {