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