comparison src/encauth/gcm/gcm_add_aad.c @ 380:d5faf4814ddb libtomcrypt-orig libtomcrypt-1.16

Update to LibTomCrypt 1.16
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:22:00 +0000
parents 59400faa4b44
children
comparison
equal deleted inserted replaced
280:59400faa4b44 380:d5faf4814ddb
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.org 9 * Tom St Denis, [email protected], http://libtomcrypt.com
10 */ 10 */
11 11
12 /** 12 /**
13 @file gcm_add_aad.c 13 @file gcm_add_aad.c
14 GCM implementation, Add AAD data to the stream, by Tom St Denis 14 GCM implementation, Add AAD data to the stream, by Tom St Denis
55 } 55 }
56 if (gcm->buflen) { 56 if (gcm->buflen) {
57 gcm->totlen += gcm->buflen * CONST64(8); 57 gcm->totlen += gcm->buflen * CONST64(8);
58 gcm_mult_h(gcm, gcm->X); 58 gcm_mult_h(gcm, gcm->X);
59 } 59 }
60 60
61 /* mix in the length */ 61 /* mix in the length */
62 zeromem(gcm->buf, 8); 62 zeromem(gcm->buf, 8);
63 STORE64H(gcm->totlen, gcm->buf+8); 63 STORE64H(gcm->totlen, gcm->buf+8);
64 for (x = 0; x < 16; x++) { 64 for (x = 0; x < 16; x++) {
65 gcm->X[x] ^= gcm->buf[x]; 65 gcm->X[x] ^= gcm->buf[x];
118 } 118 }
119 #endif 119 #endif
120 120
121 121
122 /* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_add_aad.c,v $ */ 122 /* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_add_aad.c,v $ */
123 /* $Revision: 1.14 $ */ 123 /* $Revision: 1.16 $ */
124 /* $Date: 2005/05/05 14:35:58 $ */ 124 /* $Date: 2006/09/23 19:24:21 $ */