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
13 CBC implementation, set IV, Tom St Denis
20 Set an initialization vector
21 @param IV The initialization vector
22 @param len The length of the vector (in octets)
23 @param cbc The CBC state
24 @return CRYPT_OK if successful
26 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc)
28 LTC_ARGCHK(IV != NULL);
29 LTC_ARGCHK(cbc != NULL);
30 if (len != (unsigned long)cbc->blocklen) {
31 return CRYPT_INVALID_ARG;
33 XMEMCPY(cbc->IV, IV, len);
40 /* ref: $Format:%D$ */
41 /* git commit: $Format:%H$ */
42 /* commit time: $Format:%ai$ */