Mercurial > dropbear
comparison libtomcrypt/src/modes/cbc/cbc_setiv.c @ 1471:6dba84798cd5
Update to libtomcrypt 1.18.1, merged with Dropbear changes
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 09 Feb 2018 21:44:05 +0800 |
parents | f849a5ca2efc |
children |
comparison
equal
deleted
inserted
replaced
1470:8bba51a55704 | 1471:6dba84798cd5 |
---|---|
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_setiv.c | 12 @file cbc_setiv.c |
17 | 15 |
18 | 16 |
19 #ifdef LTC_CBC_MODE | 17 #ifdef LTC_CBC_MODE |
20 | 18 |
21 /** | 19 /** |
22 Set an initial vector | 20 Set an initialization vector |
23 @param IV The initial vector | 21 @param IV The initialization vector |
24 @param len The length of the vector (in octets) | 22 @param len The length of the vector (in octets) |
25 @param cbc The CBC state | 23 @param cbc The CBC state |
26 @return CRYPT_OK if successful | 24 @return CRYPT_OK if successful |
27 */ | 25 */ |
28 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc) | 26 int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc) |
34 } | 32 } |
35 XMEMCPY(cbc->IV, IV, len); | 33 XMEMCPY(cbc->IV, IV, len); |
36 return CRYPT_OK; | 34 return CRYPT_OK; |
37 } | 35 } |
38 | 36 |
39 #endif | 37 #endif |
40 | 38 |
41 | 39 |
42 /* $Source$ */ | 40 /* ref: $Format:%D$ */ |
43 /* $Revision$ */ | 41 /* git commit: $Format:%H$ */ |
44 /* $Date$ */ | 42 /* commit time: $Format:%ai$ */ |