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
16
int cfb_setiv(const unsigned char *IV, unsigned long len, symmetric_CFB *cfb)
23
if ((err = cipher_is_valid(cfb->cipher)) != CRYPT_OK) {
27
if (len != (unsigned long)cfb->blocklen) {
28
return CRYPT_INVALID_ARG;
31
/* force next block */
33
cipher_descriptor[cfb->cipher].ecb_encrypt(IV, cfb->IV, &cfb->key);