comparison libtomcrypt/src/mac/omac/omac_memory.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 omac_memory.c 12 @file omac_memory.c
15 LTC_OMAC1 support, process a block of memory, Tom St Denis 13 OMAC1 support, process a block of memory, Tom St Denis
16 */ 14 */
17 15
18 #ifdef LTC_OMAC 16 #ifdef LTC_OMAC
19 17
20 /** 18 /**
21 LTC_OMAC a block of memory 19 OMAC a block of memory
22 @param cipher The index of the desired cipher 20 @param cipher The index of the desired cipher
23 @param key The secret key 21 @param key The secret key
24 @param keylen The length of the secret key (octets) 22 @param keylen The length of the secret key (octets)
25 @param in The data to send through LTC_OMAC 23 @param in The data to send through OMAC
26 @param inlen The length of the data to send through LTC_OMAC (octets) 24 @param inlen The length of the data to send through OMAC (octets)
27 @param out [out] The destination of the authentication tag 25 @param out [out] The destination of the authentication tag
28 @param outlen [in/out] The max size and resulting size of the authentication tag (octets) 26 @param outlen [in/out] The max size and resulting size of the authentication tag (octets)
29 @return CRYPT_OK if successful 27 @return CRYPT_OK if successful
30 */ 28 */
31 int omac_memory(int cipher, 29 int omac_memory(int cipher,
32 const unsigned char *key, unsigned long keylen, 30 const unsigned char *key, unsigned long keylen,
33 const unsigned char *in, unsigned long inlen, 31 const unsigned char *in, unsigned long inlen,
34 unsigned char *out, unsigned long *outlen) 32 unsigned char *out, unsigned long *outlen)
35 { 33 {
36 int err; 34 int err;
73 #ifdef LTC_CLEAN_STACK 71 #ifdef LTC_CLEAN_STACK
74 zeromem(omac, sizeof(omac_state)); 72 zeromem(omac, sizeof(omac_state));
75 #endif 73 #endif
76 74
77 XFREE(omac); 75 XFREE(omac);
78 return err; 76 return err;
79 } 77 }
80 78
81 #endif 79 #endif
82 80
83 /* $Source$ */ 81 /* ref: $Format:%D$ */
84 /* $Revision$ */ 82 /* git commit: $Format:%H$ */
85 /* $Date$ */ 83 /* commit time: $Format:%ai$ */