Mercurial > dropbear
comparison libtomcrypt/src/encauth/gcm/gcm_gf_mult.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_gf_mult.c | 13 @file gcm_gf_mult.c |
14 GCM implementation, do the GF mult, by Tom St Denis | 14 GCM implementation, do the GF mult, by Tom St Denis |
15 */ | 15 */ |
16 #include "tomcrypt.h" | 16 #include "tomcrypt.h" |
17 | 17 |
18 #if defined(GCM_TABLES) || defined(LRW_TABLES) || ((defined(GCM_MODE) || defined(GCM_MODE)) && defined(LTC_FAST)) | 18 #if defined(LTC_GCM_TABLES) || defined(LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) |
19 | 19 |
20 /* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the | 20 /* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the |
21 * lower 16 bits are not zero'ed I removed the upper 14 bytes */ | 21 * lower 16 bits are not zero'ed I removed the upper 14 bytes */ |
22 const unsigned char gcm_shift_table[256*2] = { | 22 const unsigned char gcm_shift_table[256*2] = { |
23 0x00, 0x00, 0x01, 0xc2, 0x03, 0x84, 0x02, 0x46, 0x07, 0x08, 0x06, 0xca, 0x04, 0x8c, 0x05, 0x4e, | 23 0x00, 0x00, 0x01, 0xc2, 0x03, 0x84, 0x02, 0x46, 0x07, 0x08, 0x06, 0xca, 0x04, 0x8c, 0x05, 0x4e, |
54 0xbb, 0xf0, 0xba, 0x32, 0xb8, 0x74, 0xb9, 0xb6, 0xbc, 0xf8, 0xbd, 0x3a, 0xbf, 0x7c, 0xbe, 0xbe }; | 54 0xbb, 0xf0, 0xba, 0x32, 0xb8, 0x74, 0xb9, 0xb6, 0xbc, 0xf8, 0xbd, 0x3a, 0xbf, 0x7c, 0xbe, 0xbe }; |
55 | 55 |
56 #endif | 56 #endif |
57 | 57 |
58 | 58 |
59 #if defined(GCM_MODE) || defined(LRW_MODE) | 59 #if defined(LTC_GCM_MODE) || defined(LRW_MODE) |
60 | 60 |
61 #ifndef LTC_FAST | 61 #ifndef LTC_FAST |
62 /* right shift */ | 62 /* right shift */ |
63 static void gcm_rightshift(unsigned char *a) | 63 static void gcm_rightshift(unsigned char *a) |
64 { | 64 { |
213 | 213 |
214 #endif | 214 #endif |
215 | 215 |
216 #endif | 216 #endif |
217 | 217 |
218 /* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_gf_mult.c,v $ */ | 218 /* $Source$ */ |
219 /* $Revision: 1.23 $ */ | 219 /* $Revision$ */ |
220 /* $Date: 2006/03/31 14:15:35 $ */ | 220 /* $Date$ */ |
221 | 221 |