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 F8 implementation, set IV, Tom St Denis
19 Set an initialization vector
20 @param IV The initialization vector
21 @param len The length of the vector (in octets)
22 @param f8 The F8 state
23 @return CRYPT_OK if successful
25 int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8)
29 LTC_ARGCHK(IV != NULL);
30 LTC_ARGCHK(f8 != NULL);
32 if ((err = cipher_is_valid(f8->cipher)) != CRYPT_OK) {
36 if (len != (unsigned long)f8->blocklen) {
37 return CRYPT_INVALID_ARG;
40 /* force next block */
42 return cipher_descriptor[f8->cipher].ecb_encrypt(IV, f8->IV, &f8->key);
48 /* ref: $Format:%D$ */
49 /* git commit: $Format:%H$ */
50 /* commit time: $Format:%ai$ */