Mercurial > dropbear
comparison libtomcrypt/src/modes/f8/f8_setiv.c @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 6dba84798cd5 |
children |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
3 * LibTomCrypt is a library that provides various cryptographic | 3 * LibTomCrypt is a library that provides various cryptographic |
4 * algorithms in a highly modular and flexible manner. | 4 * algorithms in a highly modular and flexible manner. |
5 * | 5 * |
6 * The library is free for all purposes without any express | 6 * The library is free for all purposes without any express |
7 * guarantee it works. | 7 * guarantee it works. |
8 * | |
9 * Tom St Denis, [email protected], http://libtom.org | |
10 */ | 8 */ |
11 #include "tomcrypt.h" | 9 #include "tomcrypt.h" |
12 | 10 |
13 /** | 11 /** |
14 @file f8_setiv.c | 12 @file f8_setiv.c |
16 */ | 14 */ |
17 | 15 |
18 #ifdef LTC_F8_MODE | 16 #ifdef LTC_F8_MODE |
19 | 17 |
20 /** | 18 /** |
21 Set an initial vector | 19 Set an initialization vector |
22 @param IV The initial vector | 20 @param IV The initialization vector |
23 @param len The length of the vector (in octets) | 21 @param len The length of the vector (in octets) |
24 @param f8 The F8 state | 22 @param f8 The F8 state |
25 @return CRYPT_OK if successful | 23 @return CRYPT_OK if successful |
26 */ | 24 */ |
27 int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8) | 25 int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8) |
42 /* force next block */ | 40 /* force next block */ |
43 f8->padlen = 0; | 41 f8->padlen = 0; |
44 return cipher_descriptor[f8->cipher].ecb_encrypt(IV, f8->IV, &f8->key); | 42 return cipher_descriptor[f8->cipher].ecb_encrypt(IV, f8->IV, &f8->key); |
45 } | 43 } |
46 | 44 |
47 #endif | 45 #endif |
48 | 46 |
49 | 47 |
50 /* $Source$ */ | 48 /* ref: $Format:%D$ */ |
51 /* $Revision$ */ | 49 /* git commit: $Format:%H$ */ |
52 /* $Date$ */ | 50 /* commit time: $Format:%ai$ */ |