Mercurial > dropbear
comparison libtomcrypt/src/modes/cbc/cbc_start.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 cbc_start.c | 12 @file cbc_start.c |
18 #ifdef LTC_CBC_MODE | 16 #ifdef LTC_CBC_MODE |
19 | 17 |
20 /** | 18 /** |
21 Initialize a CBC context | 19 Initialize a CBC context |
22 @param cipher The index of the cipher desired | 20 @param cipher The index of the cipher desired |
23 @param IV The initial vector | 21 @param IV The initialization vector |
24 @param key The secret key | 22 @param key The secret key |
25 @param keylen The length of the secret key (octets) | 23 @param keylen The length of the secret key (octets) |
26 @param num_rounds Number of rounds in the cipher desired (0 for default) | 24 @param num_rounds Number of rounds in the cipher desired (0 for default) |
27 @param cbc The CBC state to initialize | 25 @param cbc The CBC state to initialize |
28 @return CRYPT_OK if successful | 26 @return CRYPT_OK if successful |
29 */ | 27 */ |
30 int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, | 28 int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, |
31 int keylen, int num_rounds, symmetric_CBC *cbc) | 29 int keylen, int num_rounds, symmetric_CBC *cbc) |
32 { | 30 { |
33 int x, err; | 31 int x, err; |
34 | 32 |
35 LTC_ARGCHK(IV != NULL); | 33 LTC_ARGCHK(IV != NULL); |
36 LTC_ARGCHK(key != NULL); | 34 LTC_ARGCHK(key != NULL); |
37 LTC_ARGCHK(cbc != NULL); | 35 LTC_ARGCHK(cbc != NULL); |
38 | 36 |
39 /* bad param? */ | 37 /* bad param? */ |
55 return CRYPT_OK; | 53 return CRYPT_OK; |
56 } | 54 } |
57 | 55 |
58 #endif | 56 #endif |
59 | 57 |
60 /* $Source$ */ | 58 /* ref: $Format:%D$ */ |
61 /* $Revision$ */ | 59 /* git commit: $Format:%H$ */ |
62 /* $Date$ */ | 60 /* commit time: $Format:%ai$ */ |