comparison libtomcrypt/src/encauth/gcm/gcm_reset.c @ 1435:f849a5ca2efc

update to libtomcrypt 1.17 (with Dropbear changes)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 17:50:50 +0800
parents 0cbe8f6dbf9e
children 6dba84798cd5
comparison
equal deleted inserted replaced
1434:27b9ddb06b09 1435:f849a5ca2efc
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 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.com 9 * Tom St Denis, [email protected], http://libtom.org
10 */ 10 */
11 11
12 /** 12 /**
13 @file gcm_reset.c 13 @file gcm_reset.c
14 GCM implementation, reset a used state so it can accept IV data, by Tom St Denis 14 GCM implementation, reset a used state so it can accept IV data, by Tom St Denis
15 */ 15 */
16 #include "tomcrypt.h" 16 #include "tomcrypt.h"
17 17
18 #ifdef GCM_MODE 18 #ifdef LTC_GCM_MODE
19 19
20 /** 20 /**
21 Reset a GCM state to as if you just called gcm_init(). This saves the initialization time. 21 Reset a GCM state to as if you just called gcm_init(). This saves the initialization time.
22 @param gcm The GCM state to reset 22 @param gcm The GCM state to reset
23 @return CRYPT_OK on success 23 @return CRYPT_OK on success
26 { 26 {
27 LTC_ARGCHK(gcm != NULL); 27 LTC_ARGCHK(gcm != NULL);
28 28
29 zeromem(gcm->buf, sizeof(gcm->buf)); 29 zeromem(gcm->buf, sizeof(gcm->buf));
30 zeromem(gcm->X, sizeof(gcm->X)); 30 zeromem(gcm->X, sizeof(gcm->X));
31 gcm->mode = GCM_MODE_IV; 31 gcm->mode = LTC_GCM_MODE_IV;
32 gcm->ivmode = 0; 32 gcm->ivmode = 0;
33 gcm->buflen = 0; 33 gcm->buflen = 0;
34 gcm->totlen = 0; 34 gcm->totlen = 0;
35 gcm->pttotlen = 0; 35 gcm->pttotlen = 0;
36 36
37 return CRYPT_OK; 37 return CRYPT_OK;
38 } 38 }
39 39
40 #endif 40 #endif
41 41
42 /* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_reset.c,v $ */ 42 /* $Source$ */
43 /* $Revision: 1.4 $ */ 43 /* $Revision$ */
44 /* $Date: 2006/03/31 14:15:35 $ */ 44 /* $Date$ */