comparison libtomcrypt/src/modes/ofb/ofb_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 ofb_setiv.c 12 @file ofb_setiv.c
16 */ 14 */
17 15
18 #ifdef LTC_OFB_MODE 16 #ifdef LTC_OFB_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 ofb The OFB state 22 @param ofb The OFB state
25 @return CRYPT_OK if successful 23 @return CRYPT_OK if successful
26 */ 24 */
27 int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb) 25 int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb)
42 /* force next block */ 40 /* force next block */
43 ofb->padlen = 0; 41 ofb->padlen = 0;
44 return cipher_descriptor[ofb->cipher].ecb_encrypt(IV, ofb->IV, &ofb->key); 42 return cipher_descriptor[ofb->cipher].ecb_encrypt(IV, ofb->IV, &ofb->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$ */