Mercurial > dropbear
comparison libtomcrypt/src/encauth/gcm/gcm_add_iv.c @ 1439:8d24733026c5 coverity
merge
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 24 Jun 2017 23:33:16 +0800 |
parents | f849a5ca2efc |
children | 6dba84798cd5 |
comparison
equal
deleted
inserted
replaced
1400:238a439670f5 | 1439:8d24733026c5 |
---|---|
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_add_iv.c | 13 @file gcm_add_iv.c |
14 GCM implementation, add IV data to the state, by Tom St Denis | 14 GCM implementation, add IV data to the state, 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 Add IV data to the GCM state | 21 Add IV data to the GCM state |
22 @param gcm The GCM state | 22 @param gcm The GCM state |
23 @param IV The initial value data to add | 23 @param IV The initial value data to add |
34 if (IVlen > 0) { | 34 if (IVlen > 0) { |
35 LTC_ARGCHK(IV != NULL); | 35 LTC_ARGCHK(IV != NULL); |
36 } | 36 } |
37 | 37 |
38 /* must be in IV mode */ | 38 /* must be in IV mode */ |
39 if (gcm->mode != GCM_MODE_IV) { | 39 if (gcm->mode != LTC_GCM_MODE_IV) { |
40 return CRYPT_INVALID_ARG; | 40 return CRYPT_INVALID_ARG; |
41 } | 41 } |
42 | 42 |
43 if (gcm->buflen >= 16 || gcm->buflen < 0) { | 43 if (gcm->buflen >= 16 || gcm->buflen < 0) { |
44 return CRYPT_INVALID_ARG; | 44 return CRYPT_INVALID_ARG; |
87 } | 87 } |
88 | 88 |
89 #endif | 89 #endif |
90 | 90 |
91 | 91 |
92 /* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_add_iv.c,v $ */ | 92 /* $Source$ */ |
93 /* $Revision: 1.7 $ */ | 93 /* $Revision$ */ |
94 /* $Date: 2006/03/31 14:15:35 $ */ | 94 /* $Date$ */ |