comparison libtomcrypt/src/encauth/ccm/ccm_reset.c @ 1511:5916af64acd4 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Sat, 17 Feb 2018 19:29:51 +0800
parents 6dba84798cd5
children
comparison
equal deleted inserted replaced
1457:32f990cc96b1 1511:5916af64acd4
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2 *
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
5 *
6 * The library is free for all purposes without any express
7 * guarantee it works.
8 */
9 #include "tomcrypt.h"
10
11 #ifdef LTC_CCM_MODE
12
13 /**
14 Reset a CCM state to as if you just called ccm_init(). This saves the initialization time.
15 @param ccm The CCM state to reset
16 @return CRYPT_OK on success
17 */
18 int ccm_reset(ccm_state *ccm)
19 {
20 LTC_ARGCHK(ccm != NULL);
21 zeromem(ccm->PAD, sizeof(ccm->PAD));
22 zeromem(ccm->ctr, sizeof(ccm->ctr));
23 zeromem(ccm->CTRPAD, sizeof(ccm->CTRPAD));
24 ccm->CTRlen = 0;
25 ccm->current_ptlen = 0;
26 ccm->current_aadlen = 0;
27
28 return CRYPT_OK;
29 }
30
31 #endif
32
33 /* ref: $Format:%D$ */
34 /* git commit: $Format:%H$ */
35 /* commit time: $Format:%ai$ */