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