Skip to content
Snippets Groups Projects
Commit a79b6151 authored by Matt Johnston's avatar Matt Johnston
Browse files

update to libtomcrypt 1.17 (with Dropbear changes)

parent 99361f54
No related branches found
No related tags found
No related merge requests found
Showing
with 127 additions and 127 deletions
Loading
Loading
@@ -6,14 +6,14 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
@file twofish_tab.c
Twofish tables, Tom St Denis
*/
#ifdef TWOFISH_TABLES
#ifdef LTC_TWOFISH_TABLES
 
/* pre generated 8x8 tables from the four 4x4s */
static const unsigned char SBOX[2][256] = {
Loading
Loading
@@ -212,7 +212,7 @@ static const ulong32 mds_tab[4][256] = {
0xc6baf8c6UL, 0x9d55f99dUL, 0x700dfa70UL, 0x2be2fb2bUL, 0xc3bdfcc3UL, 0x9852fd98UL, 0x750afe75UL, 0x2ee5ff2eUL
}};
 
#ifdef TWOFISH_ALL_TABLES
#ifdef LTC_TWOFISH_ALL_TABLES
 
/* the 4x8 RS transform */
static const ulong32 rs_tab0[256] = {
Loading
Loading
@@ -487,10 +487,10 @@ static const ulong32 rs_tab7[256] = {
0x5d8218b2LU, 0x5e9bfd2cLU, 0x5bb09fc3LU, 0x58a97a5dLU, 0x51e65b50LU, 0x52ffbeceLU, 0x57d4dc21LU, 0x54cd39bfLU,
0x454a9e3bLU, 0x46537ba5LU, 0x4378194aLU, 0x4061fcd4LU, 0x492eddd9LU, 0x4a373847LU, 0x4f1c5aa8LU, 0x4c05bf36LU };
 
#endif /* TWOFISH_ALL_TABLES */
#endif /* LTC_TWOFISH_ALL_TABLES */
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/ciphers/twofish/twofish_tab.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,16 +6,16 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
@file xtea.c
Implementation of XTEA, Tom St Denis
Implementation of LTC_XTEA, Tom St Denis
*/
#include "tomcrypt.h"
 
#ifdef XTEA
#ifdef LTC_XTEA
 
const struct ltc_cipher_descriptor xtea_desc =
{
Loading
Loading
@@ -67,7 +67,7 @@ int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_k
}
 
/**
Encrypts a block of text with XTEA
Encrypts a block of text with LTC_XTEA
@param pt The input plaintext (8 bytes)
@param ct The output ciphertext (8 bytes)
@param skey The key as scheduled
Loading
Loading
@@ -103,7 +103,7 @@ int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *
}
 
/**
Decrypts a block of text with XTEA
Decrypts a block of text with LTC_XTEA
@param ct The input ciphertext (8 bytes)
@param pt The output plaintext (8 bytes)
@param skey The key as scheduled
Loading
Loading
@@ -139,7 +139,7 @@ int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *
}
 
/**
Performs a self-test of the XTEA block cipher
Performs a self-test of the LTC_XTEA block cipher
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
*/
int xtea_test(void)
Loading
Loading
@@ -206,6 +206,6 @@ int xtea_keysize(int *keysize)
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/ciphers/xtea.c,v $ */
/* $Revision: 1.12 $ */
/* $Date: 2006/11/08 23:01:06 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
 
Loading
Loading
@@ -15,7 +15,7 @@
CCM support, process a block of memory, Tom St Denis
*/
 
#ifdef CCM_MODE
#ifdef LTC_CCM_MODE
 
/**
CCM encrypt/decrypt and produce an authentication tag
Loading
Loading
@@ -346,6 +346,6 @@ error:
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/ccm/ccm_memory.c,v $ */
/* $Revision: 1.18 $ */
/* $Date: 2006/12/04 21:34:03 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
 
Loading
Loading
@@ -15,7 +15,7 @@
CCM support, process a block of memory, Tom St Denis
*/
 
#ifdef CCM_MODE
#ifdef LTC_CCM_MODE
 
int ccm_test(void)
{
Loading
Loading
@@ -175,6 +175,6 @@ int ccm_test(void)
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/ccm/ccm_test.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/21 00:18:23 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
/**
@file eax_addheader.c
Loading
Loading
@@ -14,7 +14,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
add header (metadata) to the stream
Loading
Loading
@@ -33,6 +33,6 @@ int eax_addheader(eax_state *eax, const unsigned char *header,
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_addheader.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
Decrypt data with the EAX protocol
Loading
Loading
@@ -45,6 +45,6 @@ int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt,
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_decrypt.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
Decrypt a block of memory and verify the provided MAC tag with EAX
Loading
Loading
@@ -103,6 +103,6 @@ LBL_ERR:
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_decrypt_verify_memory.c,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
Terminate an EAX session and get the tag.
Loading
Loading
@@ -89,6 +89,6 @@ LBL_ERR:
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_done.c,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
Encrypt with EAX a block of data.
Loading
Loading
@@ -46,6 +46,6 @@ int eax_encrypt(eax_state *eax, const unsigned char *pt, unsigned char *ct,
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_encrypt.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
EAX encrypt and produce an authentication tag
Loading
Loading
@@ -77,6 +77,6 @@ LBL_ERR:
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_encrypt_authenticate_memory.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
Initialized an EAX state
Loading
Loading
@@ -66,7 +66,7 @@ int eax_init(eax_state *eax, int cipher,
return CRYPT_MEM;
}
 
/* N = OMAC_0K(nonce) */
/* N = LTC_OMAC_0K(nonce) */
zeromem(buf, MAXBLOCKSIZE);
if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) {
goto LBL_ERR;
Loading
Loading
@@ -86,7 +86,7 @@ int eax_init(eax_state *eax, int cipher,
goto LBL_ERR;
}
 
/* H = OMAC_1K(header) */
/* H = LTC_OMAC_1K(header) */
zeromem(buf, MAXBLOCKSIZE);
buf[blklen - 1] = 1;
 
Loading
Loading
@@ -112,7 +112,7 @@ int eax_init(eax_state *eax, int cipher,
goto LBL_ERR;
}
 
/* setup the OMAC for the ciphertext */
/* setup the LTC_OMAC for the ciphertext */
if ((err = omac_init(&eax->ctomac, cipher, key, keylen)) != CRYPT_OK) {
goto LBL_ERR;
}
Loading
Loading
@@ -139,6 +139,6 @@ LBL_ERR:
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_init.c,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
/**
Test the EAX implementation
Loading
Loading
@@ -275,8 +275,8 @@ int eax_test(void)
#endif /* LTC_TEST */
}
 
#endif /* EAX_MODE */
#endif /* LTC_EAX_MODE */
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/eax/eax_test.c,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
/**
Add AAD to the GCM state
Loading
Loading
@@ -47,7 +47,7 @@ int gcm_add_aad(gcm_state *gcm,
}
 
/* in IV mode? */
if (gcm->mode == GCM_MODE_IV) {
if (gcm->mode == LTC_GCM_MODE_IV) {
/* let's process the IV */
if (gcm->ivmode || gcm->buflen != 12) {
for (x = 0; x < (unsigned long)gcm->buflen; x++) {
Loading
Loading
@@ -80,10 +80,10 @@ int gcm_add_aad(gcm_state *gcm,
zeromem(gcm->buf, 16);
gcm->buflen = 0;
gcm->totlen = 0;
gcm->mode = GCM_MODE_AAD;
gcm->mode = LTC_GCM_MODE_AAD;
}
 
if (gcm->mode != GCM_MODE_AAD || gcm->buflen >= 16) {
if (gcm->mode != LTC_GCM_MODE_AAD || gcm->buflen >= 16) {
return CRYPT_INVALID_ARG;
}
 
Loading
Loading
@@ -119,6 +119,6 @@ int gcm_add_aad(gcm_state *gcm,
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_add_aad.c,v $ */
/* $Revision: 1.16 $ */
/* $Date: 2006/09/23 19:24:21 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
/**
Add IV data to the GCM state
Loading
Loading
@@ -36,7 +36,7 @@ int gcm_add_iv(gcm_state *gcm,
}
 
/* must be in IV mode */
if (gcm->mode != GCM_MODE_IV) {
if (gcm->mode != LTC_GCM_MODE_IV) {
return CRYPT_INVALID_ARG;
}
Loading
Loading
@@ -89,6 +89,6 @@ int gcm_add_iv(gcm_state *gcm,
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_add_iv.c,v $ */
/* $Revision: 1.7 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
/**
Terminate a GCM stream
Loading
Loading
@@ -43,7 +43,7 @@ int gcm_done(gcm_state *gcm,
}
 
 
if (gcm->mode != GCM_MODE_TEXT) {
if (gcm->mode != LTC_GCM_MODE_TEXT) {
return CRYPT_INVALID_ARG;
}
 
Loading
Loading
@@ -78,6 +78,6 @@ int gcm_done(gcm_state *gcm,
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_done.c,v $ */
/* $Revision: 1.9 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#if defined(GCM_TABLES) || defined(LRW_TABLES) || ((defined(GCM_MODE) || defined(GCM_MODE)) && defined(LTC_FAST))
#if defined(LTC_GCM_TABLES) || defined(LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST))
 
/* this is x*2^128 mod p(x) ... the results are 16 bytes each stored in a packed format. Since only the
* lower 16 bits are not zero'ed I removed the upper 14 bytes */
Loading
Loading
@@ -56,7 +56,7 @@ const unsigned char gcm_shift_table[256*2] = {
#endif
 
 
#if defined(GCM_MODE) || defined(LRW_MODE)
#if defined(LTC_GCM_MODE) || defined(LRW_MODE)
 
#ifndef LTC_FAST
/* right shift */
Loading
Loading
@@ -215,7 +215,7 @@ void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_gf_mult.c,v $ */
/* $Revision: 1.23 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
/**
Initialize a GCM state
Loading
Loading
@@ -30,7 +30,7 @@ int gcm_init(gcm_state *gcm, int cipher,
{
int err;
unsigned char B[16];
#ifdef GCM_TABLES
#ifdef LTC_GCM_TABLES
int x, y, z, t;
#endif
 
Loading
Loading
@@ -66,13 +66,13 @@ int gcm_init(gcm_state *gcm, int cipher,
zeromem(gcm->buf, sizeof(gcm->buf));
zeromem(gcm->X, sizeof(gcm->X));
gcm->cipher = cipher;
gcm->mode = GCM_MODE_IV;
gcm->mode = LTC_GCM_MODE_IV;
gcm->ivmode = 0;
gcm->buflen = 0;
gcm->totlen = 0;
gcm->pttotlen = 0;
 
#ifdef GCM_TABLES
#ifdef LTC_GCM_TABLES
/* setup tables */
 
/* generate the first table as it has no shifting (from which we make the other tables) */
Loading
Loading
@@ -102,6 +102,6 @@ int gcm_init(gcm_state *gcm, int cipher,
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_init.c,v $ */
/* $Revision: 1.18 $ */
/* $Date: 2006/03/31 14:15:35 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
/**
Process an entire GCM packet in one call.
Loading
Loading
@@ -65,7 +65,7 @@ int gcm_memory( int cipher,
 
 
 
#ifndef GCM_TABLES_SSE2
#ifndef LTC_GCM_TABLES_SSE2
orig = gcm = XMALLOC(sizeof(*gcm));
#else
orig = gcm = XMALLOC(sizeof(*gcm) + 16);
Loading
Loading
@@ -78,7 +78,7 @@ int gcm_memory( int cipher,
* note that we only modify gcm and keep orig intact. This code is not portable
* but again it's only for SSE2 anyways, so who cares?
*/
#ifdef GCM_TABLES_SSE2
#ifdef LTC_GCM_TABLES_SSE2
if ((unsigned long)gcm & 15) {
gcm = (gcm_state *)((unsigned long)gcm + (16 - ((unsigned long)gcm & 15)));
}
Loading
Loading
@@ -104,6 +104,6 @@ LTC_ERR:
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_memory.c,v $ */
/* $Revision: 1.23 $ */
/* $Date: 2006/09/07 10:00:57 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#if defined(GCM_MODE)
#if defined(LTC_GCM_MODE)
/**
GCM multiply by H
@param gcm The GCM state which holds the H value
Loading
Loading
@@ -24,9 +24,9 @@
void gcm_mult_h(gcm_state *gcm, unsigned char *I)
{
unsigned char T[16];
#ifdef GCM_TABLES
#ifdef LTC_GCM_TABLES
int x, y;
#ifdef GCM_TABLES_SSE2
#ifdef LTC_GCM_TABLES_SSE2
asm("movdqa (%0),%%xmm0"::"r"(&gcm->PC[0][I[0]][0]));
for (x = 1; x < 16; x++) {
asm("pxor (%0),%%xmm0"::"r"(&gcm->PC[x][I[x]][0]));
Loading
Loading
@@ -45,7 +45,7 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I)
}
#endif /* LTC_FAST */
}
#endif /* GCM_TABLES_SSE2 */
#endif /* LTC_GCM_TABLES_SSE2 */
#else
gcm_gf_mult(gcm->H, I, T);
#endif
Loading
Loading
@@ -53,6 +53,6 @@ void gcm_mult_h(gcm_state *gcm, unsigned char *I)
}
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_mult_h.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/08/23 20:40:23 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
 
/**
Loading
Loading
@@ -15,7 +15,7 @@
*/
#include "tomcrypt.h"
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
/**
Process plaintext/ciphertext through GCM
Loading
Loading
@@ -50,7 +50,7 @@ int gcm_process(gcm_state *gcm,
}
 
/* in AAD mode? */
if (gcm->mode == GCM_MODE_AAD) {
if (gcm->mode == LTC_GCM_MODE_AAD) {
/* let's process the AAD */
if (gcm->buflen) {
gcm->totlen += gcm->buflen * CONST64(8);
Loading
Loading
@@ -67,10 +67,10 @@ int gcm_process(gcm_state *gcm,
}
 
gcm->buflen = 0;
gcm->mode = GCM_MODE_TEXT;
gcm->mode = LTC_GCM_MODE_TEXT;
}
 
if (gcm->mode != GCM_MODE_TEXT) {
if (gcm->mode != LTC_GCM_MODE_TEXT) {
return CRYPT_INVALID_ARG;
}
 
Loading
Loading
@@ -147,6 +147,6 @@ int gcm_process(gcm_state *gcm,
 
#endif
 
/* $Source: /cvs/libtom/libtomcrypt/src/encauth/gcm/gcm_process.c,v $ */
/* $Revision: 1.14 $ */
/* $Date: 2006/11/19 19:33:36 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment