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 297 additions and 233 deletions
Loading
Loading
@@ -6,17 +6,17 @@
* 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"
 
 
/**
@file md5.c
MD5 hash function by Tom St Denis
LTC_MD5 hash function by Tom St Denis
*/
 
#ifdef MD5
#ifdef LTC_MD5
 
const struct ltc_hash_descriptor md5_desc =
{
Loading
Loading
@@ -363,6 +363,6 @@ int md5_test(void)
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/md5.c,v $ */
/* $Revision: 1.8 $ */
/* $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
*/
#include "tomcrypt.h"
 
Loading
Loading
@@ -15,13 +15,13 @@
RMD128 Hash function
*/
 
/* Implementation of RIPEMD-128 based on the source by Antoon Bosselaers, ESAT-COSIC
/* Implementation of LTC_RIPEMD-128 based on the source by Antoon Bosselaers, ESAT-COSIC
*
* This source has been radically overhauled to be portable and work within
* the LibTomCrypt API by Tom St Denis
*/
 
#ifdef RIPEMD128
#ifdef LTC_RIPEMD128
 
const struct ltc_hash_descriptor rmd128_desc =
{
Loading
Loading
@@ -405,6 +405,6 @@ int rmd128_test(void)
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/rmd128.c,v $ */
/* $Revision: 1.9 $ */
/* $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
*/
#include "tomcrypt.h"
 
Loading
Loading
@@ -15,13 +15,13 @@
RMD160 hash function
*/
 
/* Implementation of RIPEMD-160 based on the source by Antoon Bosselaers, ESAT-COSIC
/* Implementation of LTC_RIPEMD-160 based on the source by Antoon Bosselaers, ESAT-COSIC
*
* This source has been radically overhauled to be portable and work within
* the LibTomCrypt API by Tom St Denis
*/
 
#ifdef RIPEMD160
#ifdef LTC_RIPEMD160
 
const struct ltc_hash_descriptor rmd160_desc =
{
Loading
Loading
@@ -464,6 +464,6 @@ int rmd160_test(void)
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/rmd160.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,22 +6,22 @@
* 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"
 
/**
@param rmd256.c
RMD256 Hash function
RLTC_MD256 Hash function
*/
 
#ifdef RIPEMD256
#ifdef LTC_RIPEMD256
 
const struct ltc_hash_descriptor rmd256_desc =
{
"rmd256",
8,
16,
32,
64,
 
/* OID */
Loading
Loading
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,13 +15,13 @@
RMD320 hash function
*/
 
#ifdef RIPEMD320
#ifdef LTC_RIPEMD320
 
const struct ltc_hash_descriptor rmd320_desc =
{
"rmd320",
9,
20,
40,
64,
 
/* OID */
Loading
Loading
Loading
Loading
@@ -6,17 +6,17 @@
* 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"
 
/**
@file sha1.c
SHA1 code by Tom St Denis
LTC_SHA1 code by Tom St Denis
*/
 
 
#ifdef SHA1
#ifdef LTC_SHA1
 
const struct ltc_hash_descriptor sha1_desc =
{
Loading
Loading
@@ -283,6 +283,6 @@ int sha1_test(void)
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha1.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,11 +6,11 @@
* 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
*/
/**
@param sha224.c
SHA-224 new NIST standard based off of SHA-256 truncated to 224 bits (Tom St Denis)
LTC_SHA-224 new NIST standard based off of LTC_SHA-256 truncated to 224 bits (Tom St Denis)
*/
 
const struct ltc_hash_descriptor sha224_desc =
Loading
Loading
@@ -120,6 +120,6 @@ int sha224_test(void)
}
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha224.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $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
*/
#include "tomcrypt.h"
 
/**
@file sha256.c
SHA256 by Tom St Denis
LTC_SHA256 by Tom St Denis
*/
 
#ifdef SHA256
#ifdef LTC_SHA256
 
const struct ltc_hash_descriptor sha256_desc =
{
Loading
Loading
@@ -327,7 +327,7 @@ int sha256_test(void)
#endif
}
 
#ifdef SHA224
#ifdef LTC_SHA224
#include "sha224.c"
#endif
 
Loading
Loading
@@ -335,6 +335,6 @@ int sha256_test(void)
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha256.c,v $ */
/* $Revision: 1.9 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,11 +6,11 @@
* 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
*/
/**
@param sha384.c
SHA384 hash included in sha512.c, Tom St Denis
LTC_SHA384 hash included in sha512.c, Tom St Denis
*/
 
const struct ltc_hash_descriptor sha384_desc =
Loading
Loading
@@ -130,6 +130,6 @@ int sha384_test(void)
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha384.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $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
*/
#include "tomcrypt.h"
 
/**
@param sha512.c
SHA512 by Tom St Denis
LTC_SHA512 by Tom St Denis
*/
 
#ifdef SHA512
#ifdef LTC_SHA512
 
const struct ltc_hash_descriptor sha512_desc =
{
Loading
Loading
@@ -305,7 +305,7 @@ int sha512_test(void)
#endif
}
 
#ifdef SHA384
#ifdef LTC_SHA384
#include "sha384.c"
#endif
 
Loading
Loading
@@ -314,6 +314,6 @@ int sha512_test(void)
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha512.c,v $ */
/* $Revision: 1.8 $ */
/* $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
*/
 
#include "tomcrypt.h"
Loading
Loading
@@ -16,7 +16,7 @@
Tiger hash function, Tom St Denis
*/
 
#ifdef TIGER
#ifdef LTC_TIGER
 
const struct ltc_hash_descriptor tiger_desc =
{
Loading
Loading
@@ -809,6 +809,6 @@ Hash of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFG
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/tiger.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -6,17 +6,17 @@
* 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 whirl.c
WHIRLPOOL (using their new sbox) hash function by Tom St Denis
LTC_WHIRLPOOL (using their new sbox) hash function by Tom St Denis
*/
 
#include "tomcrypt.h"
 
#ifdef WHIRLPOOL
#ifdef LTC_WHIRLPOOL
 
const struct ltc_hash_descriptor whirlpool_desc =
{
Loading
Loading
@@ -309,6 +309,6 @@ int whirlpool_test(void)
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/whirl/whirl.c,v $ */
/* $Revision: 1.8 $ */
/* $Date: 2006/11/01 09:28:17 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
/**
@file whirltab.c
WHIRLPOOL tables, Tom St Denis
LTC_WHIRLPOOL tables, Tom St Denis
*/
static const ulong64 sbox0[] = {
CONST64(0x18186018c07830d8), CONST64(0x23238c2305af4626), CONST64(0xc6c63fc67ef991b8), CONST64(0xe8e887e8136fcdfb),
Loading
Loading
@@ -578,6 +578,6 @@ CONST64(0x6302aa71c81949d9),
};
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/hashes/whirl/whirltab.c,v $ */
/* $Revision: 1.2 $ */
/* $Date: 2005/05/05 14:35:58 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -16,8 +16,8 @@ extern "C" {
#endif
 
/* version */
#define CRYPT 0x0116
#define SCRYPT "1.16"
#define CRYPT 0x0117
#define SCRYPT "1.17"
 
/* max size of either a cipher/hash block or symmetric key [largest of the two] */
#define MAXBLOCKSIZE 128
Loading
Loading
@@ -83,6 +83,6 @@ enum {
#endif /* TOMCRYPT_H_ */
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt.h,v $ */
/* $Revision: 1.20 $ */
/* $Date: 2006/11/26 01:45:14 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -41,6 +41,6 @@ void crypt_argchk(char *v, char *s, int d) ATTRIB_NORETURN;
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_argchk.h,v $ */
/* $Revision: 1.5 $ */
/* $Date: 2006/08/27 20:50:21 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -131,6 +131,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cfg.h,v $ */
/* $Revision: 1.19 $ */
/* $Date: 2006/12/04 02:19:48 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -3,41 +3,41 @@
* We put each of the ciphers scheduled keys in their own structs then we put all of
* the key formats in one union. This makes the function prototypes easier to use.
*/
#ifdef BLOWFISH
#ifdef LTC_BLOWFISH
struct blowfish_key {
ulong32 S[4][256];
ulong32 K[18];
};
#endif
 
#ifdef RC5
#ifdef LTC_RC5
struct rc5_key {
int rounds;
ulong32 K[50];
};
#endif
 
#ifdef RC6
#ifdef LTC_RC6
struct rc6_key {
ulong32 K[44];
};
#endif
 
#ifdef SAFERP
#ifdef LTC_SAFERP
struct saferp_key {
unsigned char K[33][16];
long rounds;
};
#endif
 
#ifdef RIJNDAEL
#ifdef LTC_RIJNDAEL
struct rijndael_key {
ulong32 eK[60], dK[60];
int Nr;
};
#endif
 
#ifdef KSEED
#ifdef LTC_KSEED
struct kseed_key {
ulong32 K[32], dK[32];
};
Loading
Loading
@@ -51,14 +51,14 @@ struct kasumi_key {
};
#endif
 
#ifdef XTEA
#ifdef LTC_XTEA
struct xtea_key {
unsigned long A[32], B[32];
};
#endif
 
#ifdef TWOFISH
#ifndef TWOFISH_SMALL
#ifdef LTC_TWOFISH
#ifndef LTC_TWOFISH_SMALL
struct twofish_key {
ulong32 S[4][256], K[40];
};
Loading
Loading
@@ -70,24 +70,24 @@ struct xtea_key {
#endif
#endif
 
#ifdef SAFER
#define SAFER_K64_DEFAULT_NOF_ROUNDS 6
#define SAFER_K128_DEFAULT_NOF_ROUNDS 10
#define SAFER_SK64_DEFAULT_NOF_ROUNDS 8
#define SAFER_SK128_DEFAULT_NOF_ROUNDS 10
#define SAFER_MAX_NOF_ROUNDS 13
#define SAFER_BLOCK_LEN 8
#define SAFER_KEY_LEN (1 + SAFER_BLOCK_LEN * (1 + 2 * SAFER_MAX_NOF_ROUNDS))
typedef unsigned char safer_block_t[SAFER_BLOCK_LEN];
typedef unsigned char safer_key_t[SAFER_KEY_LEN];
#ifdef LTC_SAFER
#define LTC_SAFER_K64_DEFAULT_NOF_ROUNDS 6
#define LTC_SAFER_K128_DEFAULT_NOF_ROUNDS 10
#define LTC_SAFER_SK64_DEFAULT_NOF_ROUNDS 8
#define LTC_SAFER_SK128_DEFAULT_NOF_ROUNDS 10
#define LTC_SAFER_MAX_NOF_ROUNDS 13
#define LTC_SAFER_BLOCK_LEN 8
#define LTC_SAFER_KEY_LEN (1 + LTC_SAFER_BLOCK_LEN * (1 + 2 * LTC_SAFER_MAX_NOF_ROUNDS))
typedef unsigned char safer_block_t[LTC_SAFER_BLOCK_LEN];
typedef unsigned char safer_key_t[LTC_SAFER_KEY_LEN];
struct safer_key { safer_key_t key; };
#endif
 
#ifdef RC2
#ifdef LTC_RC2
struct rc2_key { unsigned xkey[64]; };
#endif
 
#ifdef DES
#ifdef LTC_DES
struct des_key {
ulong32 ek[32], dk[32];
};
Loading
Loading
@@ -97,32 +97,32 @@ struct des3_key {
};
#endif
 
#ifdef CAST5
#ifdef LTC_CAST5
struct cast5_key {
ulong32 K[32], keylen;
};
#endif
 
#ifdef NOEKEON
#ifdef LTC_NOEKEON
struct noekeon_key {
ulong32 K[4], dK[4];
};
#endif
 
#ifdef SKIPJACK
#ifdef LTC_SKIPJACK
struct skipjack_key {
unsigned char key[10];
};
#endif
 
#ifdef KHAZAD
#ifdef LTC_KHAZAD
struct khazad_key {
ulong64 roundKeyEnc[8 + 1];
ulong64 roundKeyDec[8 + 1];
};
#endif
 
#ifdef ANUBIS
#ifdef LTC_ANUBIS
struct anubis_key {
int keyBits;
int R;
Loading
Loading
@@ -131,59 +131,69 @@ struct anubis_key {
};
#endif
 
#ifdef LTC_MULTI2
struct multi2_key {
int N;
ulong32 uk[8];
};
#endif
typedef union Symmetric_key {
#ifdef DES
#ifdef LTC_DES
struct des_key des;
struct des3_key des3;
#endif
#ifdef RC2
#ifdef LTC_RC2
struct rc2_key rc2;
#endif
#ifdef SAFER
#ifdef LTC_SAFER
struct safer_key safer;
#endif
#ifdef TWOFISH
#ifdef LTC_TWOFISH
struct twofish_key twofish;
#endif
#ifdef BLOWFISH
#ifdef LTC_BLOWFISH
struct blowfish_key blowfish;
#endif
#ifdef RC5
#ifdef LTC_RC5
struct rc5_key rc5;
#endif
#ifdef RC6
#ifdef LTC_RC6
struct rc6_key rc6;
#endif
#ifdef SAFERP
#ifdef LTC_SAFERP
struct saferp_key saferp;
#endif
#ifdef RIJNDAEL
#ifdef LTC_RIJNDAEL
struct rijndael_key rijndael;
#endif
#ifdef XTEA
#ifdef LTC_XTEA
struct xtea_key xtea;
#endif
#ifdef CAST5
#ifdef LTC_CAST5
struct cast5_key cast5;
#endif
#ifdef NOEKEON
#ifdef LTC_NOEKEON
struct noekeon_key noekeon;
#endif
#ifdef SKIPJACK
#ifdef LTC_SKIPJACK
struct skipjack_key skipjack;
#endif
#ifdef KHAZAD
#ifdef LTC_KHAZAD
struct khazad_key khazad;
#endif
#ifdef ANUBIS
#ifdef LTC_ANUBIS
struct anubis_key anubis;
#endif
#ifdef KSEED
#ifdef LTC_KSEED
struct kseed_key kseed;
#endif
#ifdef LTC_KASUMI
struct kasumi_key kasumi;
#endif
#ifdef LTC_MULTI2
struct multi2_key multi2;
#endif
void *data;
} symmetric_key;
 
Loading
Loading
@@ -257,8 +267,11 @@ typedef struct {
blocklen,
/** The padding offset */
padlen,
/** The mode (endianess) of the CTR, 0==little, 1==big */
mode;
/** The mode (endianess) of the CTR, 0==little, 1==big */
mode,
/** counter width */
ctrlen;
/** The counter */
unsigned char ctr[MAXBLOCKSIZE],
/** The pad used to encrypt/decrypt */
Loading
Loading
@@ -488,7 +501,7 @@ extern struct ltc_cipher_descriptor {
unsigned char *tag, unsigned long *taglen,
int direction);
 
/** Accelerated one shot OMAC
/** Accelerated one shot LTC_OMAC
@param key The secret key
@param keylen The key length (octets)
@param in The message
Loading
Loading
@@ -532,7 +545,7 @@ extern struct ltc_cipher_descriptor {
unsigned char *out, unsigned long *outlen);
} cipher_descriptor[];
 
#ifdef BLOWFISH
#ifdef LTC_BLOWFISH
int blowfish_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -542,7 +555,7 @@ int blowfish_keysize(int *keysize);
extern const struct ltc_cipher_descriptor blowfish_desc;
#endif
 
#ifdef RC5
#ifdef LTC_RC5
int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -552,7 +565,7 @@ int rc5_keysize(int *keysize);
extern const struct ltc_cipher_descriptor rc5_desc;
#endif
 
#ifdef RC6
#ifdef LTC_RC6
int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -562,7 +575,7 @@ int rc6_keysize(int *keysize);
extern const struct ltc_cipher_descriptor rc6_desc;
#endif
 
#ifdef RC2
#ifdef LTC_RC2
int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int rc2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int rc2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -572,7 +585,7 @@ int rc2_keysize(int *keysize);
extern const struct ltc_cipher_descriptor rc2_desc;
#endif
 
#ifdef SAFERP
#ifdef LTC_SAFERP
int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int saferp_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int saferp_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -582,7 +595,7 @@ int saferp_keysize(int *keysize);
extern const struct ltc_cipher_descriptor saferp_desc;
#endif
 
#ifdef SAFER
#ifdef LTC_SAFER
int safer_k64_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int safer_sk64_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int safer_k128_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
Loading
Loading
@@ -598,7 +611,7 @@ int safer_128_keysize(int *keysize);
extern const struct ltc_cipher_descriptor safer_k64_desc, safer_k128_desc, safer_sk64_desc, safer_sk128_desc;
#endif
 
#ifdef RIJNDAEL
#ifdef LTC_RIJNDAEL
 
/* make aes an alias */
#define aes_setup rijndael_setup
Loading
Loading
@@ -626,7 +639,7 @@ extern const struct ltc_cipher_descriptor rijndael_desc, aes_desc;
extern const struct ltc_cipher_descriptor rijndael_enc_desc, aes_enc_desc;
#endif
 
#ifdef XTEA
#ifdef LTC_XTEA
int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -636,7 +649,7 @@ int xtea_keysize(int *keysize);
extern const struct ltc_cipher_descriptor xtea_desc;
#endif
 
#ifdef TWOFISH
#ifdef LTC_TWOFISH
int twofish_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int twofish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int twofish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -646,7 +659,7 @@ int twofish_keysize(int *keysize);
extern const struct ltc_cipher_descriptor twofish_desc;
#endif
 
#ifdef DES
#ifdef LTC_DES
int des_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int des_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int des_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -662,7 +675,7 @@ int des3_keysize(int *keysize);
extern const struct ltc_cipher_descriptor des_desc, des3_desc;
#endif
 
#ifdef CAST5
#ifdef LTC_CAST5
int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -672,7 +685,7 @@ int cast5_keysize(int *keysize);
extern const struct ltc_cipher_descriptor cast5_desc;
#endif
 
#ifdef NOEKEON
#ifdef LTC_NOEKEON
int noekeon_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -682,7 +695,7 @@ int noekeon_keysize(int *keysize);
extern const struct ltc_cipher_descriptor noekeon_desc;
#endif
 
#ifdef SKIPJACK
#ifdef LTC_SKIPJACK
int skipjack_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int skipjack_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int skipjack_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -692,7 +705,7 @@ int skipjack_keysize(int *keysize);
extern const struct ltc_cipher_descriptor skipjack_desc;
#endif
 
#ifdef KHAZAD
#ifdef LTC_KHAZAD
int khazad_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int khazad_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int khazad_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -702,7 +715,7 @@ int khazad_keysize(int *keysize);
extern const struct ltc_cipher_descriptor khazad_desc;
#endif
 
#ifdef ANUBIS
#ifdef LTC_ANUBIS
int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int anubis_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int anubis_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -712,7 +725,7 @@ int anubis_keysize(int *keysize);
extern const struct ltc_cipher_descriptor anubis_desc;
#endif
 
#ifdef KSEED
#ifdef LTC_KSEED
int kseed_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int kseed_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
Loading
Loading
@@ -732,6 +745,17 @@ int kasumi_keysize(int *keysize);
extern const struct ltc_cipher_descriptor kasumi_desc;
#endif
 
#ifdef LTC_MULTI2
int multi2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey);
int multi2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey);
int multi2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey);
int multi2_test(void);
void multi2_done(symmetric_key *skey);
int multi2_keysize(int *keysize);
extern const struct ltc_cipher_descriptor multi2_desc;
#endif
#ifdef LTC_ECB_MODE
int ecb_start(int cipher, const unsigned char *key,
int keylen, int num_rounds, symmetric_ECB *ecb);
Loading
Loading
@@ -772,9 +796,9 @@ int cbc_done(symmetric_CBC *cbc);
 
#ifdef LTC_CTR_MODE
 
#define CTR_COUNTER_LITTLE_ENDIAN 0
#define CTR_COUNTER_BIG_ENDIAN 1
#define LTC_CTR_RFC3686 2
#define CTR_COUNTER_LITTLE_ENDIAN 0x0000
#define CTR_COUNTER_BIG_ENDIAN 0x1000
#define LTC_CTR_RFC3686 0x2000
 
int ctr_start( int cipher,
const unsigned char *IV,
Loading
Loading
@@ -824,6 +848,34 @@ int f8_done(symmetric_F8 *f8);
int f8_test_mode(void);
#endif
 
#ifdef LTC_XTS_MODE
typedef struct {
symmetric_key key1, key2;
int cipher;
} symmetric_xts;
int xts_start( int cipher,
const unsigned char *key1,
const unsigned char *key2,
unsigned long keylen,
int num_rounds,
symmetric_xts *xts);
int xts_encrypt(
const unsigned char *pt, unsigned long ptlen,
unsigned char *ct,
const unsigned char *tweak,
symmetric_xts *xts);
int xts_decrypt(
const unsigned char *ct, unsigned long ptlen,
unsigned char *pt,
const unsigned char *tweak,
symmetric_xts *xts);
void xts_done(symmetric_xts *xts);
int xts_test(void);
void xts_mult_x(unsigned char *I);
#endif
 
int find_cipher(const char *name);
int find_cipher_any(const char *name, int blocklen, int keylen);
Loading
Loading
@@ -834,6 +886,6 @@ int cipher_is_valid(int idx);
 
LTC_MUTEX_PROTO(ltc_cipher_mutex)
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cipher.h,v $ */
/* $Revision: 1.46 $ */
/* $Date: 2006/11/13 23:09:38 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -69,6 +69,13 @@
#endif
/* These spit out warnings etc */
#define LTC_NO_ROLC
#ifndef XQSORT
#ifdef qsort
#define LTC_NO_PROTOTYPES
#endif
#define XQSORT qsort
#endif
 
/* Enable self-test test vector checking */
/* Not for dropbear */
Loading
Loading
@@ -91,25 +98,27 @@
 
 
#ifdef DROPBEAR_BLOWFISH
#define BLOWFISH
#define LTC_BLOWFISH
#endif
 
#ifdef DROPBEAR_AES
#define RIJNDAEL
#define LTC_RIJNDAEL
#endif
 
#ifdef DROPBEAR_TWOFISH
#define TWOFISH
#define LTC_TWOFISH
 
/* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format
* (saves 4KB of ram), _ALL_TABLES enables all tables during setup */
/* enabling just TWOFISH_SMALL will make the binary ~1kB smaller, turning on
* TWOFISH_TABLES will make it a few kB bigger, but perhaps reduces runtime
* memory usage? */
#define TWOFISH_SMALL
/*#define TWOFISH_TABLES*/
#define LTC_TWOFISH_SMALL
/*#define LTC_TWOFISH_TABLES*/
#endif
 
#ifdef DROPBEAR_3DES
#define DES
#define LTC_DES
#endif
 
#define LTC_CBC_MODE
Loading
Loading
@@ -118,26 +127,26 @@
#define LTC_CTR_MODE
#endif
 
#define SHA1
#define LTC_SHA1
 
#ifdef DROPBEAR_MD5
#define MD5
#define LTC_MD5
#endif
 
#ifdef DROPBEAR_SHA256
#define SHA256
#define LTC_SHA256
#endif
#ifdef DROPBEAR_SHA384
#define SHA384
#define LTC_SHA384
#endif
#ifdef DROPBEAR_SHA512
#define SHA512
#define LTC_SHA512
#endif
 
#define LTC_HMAC
 
#ifdef DROPBEAR_ECC
#define MECC
#define LTC_MECC
#define LTC_ECC_SHAMIR
#define LTC_ECC_TIMING_RESISTANT
#define MPI
Loading
Loading
@@ -154,7 +163,7 @@
#endif
 
/* Various tidbits of modern neatoness */
#define BASE64
#define LTC_BASE64
 
/* default no pthread functions */
#define LTC_MUTEX_GLOBAL(x)
Loading
Loading
@@ -167,13 +176,13 @@
 
/* Debuggers */
 
/* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and RC4 work (see the code) */
/* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and LTC_RC4 work (see the code) */
/* #define LTC_VALGRIND */
 
#endif
 
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_custom.h,v $ */
/* $Revision: 1.66 $ */
/* $Date: 2006/12/04 02:50:11 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
/* ---- HASH FUNCTIONS ---- */
#ifdef SHA512
#ifdef LTC_SHA512
struct sha512_state {
ulong64 length, state[8];
unsigned long curlen;
Loading
Loading
@@ -7,7 +7,7 @@ struct sha512_state {
};
#endif
 
#ifdef SHA256
#ifdef LTC_SHA256
struct sha256_state {
ulong64 length;
ulong32 state[8], curlen;
Loading
Loading
@@ -15,7 +15,7 @@ struct sha256_state {
};
#endif
 
#ifdef SHA1
#ifdef LTC_SHA1
struct sha1_state {
ulong64 length;
ulong32 state[5], curlen;
Loading
Loading
@@ -23,7 +23,7 @@ struct sha1_state {
};
#endif
 
#ifdef MD5
#ifdef LTC_MD5
struct md5_state {
ulong64 length;
ulong32 state[4], curlen;
Loading
Loading
@@ -31,7 +31,7 @@ struct md5_state {
};
#endif
 
#ifdef MD4
#ifdef LTC_MD4
struct md4_state {
ulong64 length;
ulong32 state[4], curlen;
Loading
Loading
@@ -39,7 +39,7 @@ struct md4_state {
};
#endif
 
#ifdef TIGER
#ifdef LTC_TIGER
struct tiger_state {
ulong64 state[3], length;
unsigned long curlen;
Loading
Loading
@@ -47,14 +47,14 @@ struct tiger_state {
};
#endif
 
#ifdef MD2
#ifdef LTC_MD2
struct md2_state {
unsigned char chksum[16], X[48], buf[16];
unsigned long curlen;
};
#endif
 
#ifdef RIPEMD128
#ifdef LTC_RIPEMD128
struct rmd128_state {
ulong64 length;
unsigned char buf[64];
Loading
Loading
@@ -62,7 +62,7 @@ struct rmd128_state {
};
#endif
 
#ifdef RIPEMD160
#ifdef LTC_RIPEMD160
struct rmd160_state {
ulong64 length;
unsigned char buf[64];
Loading
Loading
@@ -70,7 +70,7 @@ struct rmd160_state {
};
#endif
 
#ifdef RIPEMD256
#ifdef LTC_RIPEMD256
struct rmd256_state {
ulong64 length;
unsigned char buf[64];
Loading
Loading
@@ -78,7 +78,7 @@ struct rmd256_state {
};
#endif
 
#ifdef RIPEMD320
#ifdef LTC_RIPEMD320
struct rmd320_state {
ulong64 length;
unsigned char buf[64];
Loading
Loading
@@ -86,7 +86,7 @@ struct rmd320_state {
};
#endif
 
#ifdef WHIRLPOOL
#ifdef LTC_WHIRLPOOL
struct whirlpool_state {
ulong64 length, state[8];
unsigned char buf[64];
Loading
Loading
@@ -94,7 +94,7 @@ struct whirlpool_state {
};
#endif
 
#ifdef CHC_HASH
#ifdef LTC_CHC_HASH
struct chc_state {
ulong64 length;
unsigned char state[MAXBLOCKSIZE], buf[MAXBLOCKSIZE];
Loading
Loading
@@ -104,43 +104,43 @@ struct chc_state {
 
typedef union Hash_state {
char dummy[1];
#ifdef CHC_HASH
#ifdef LTC_CHC_HASH
struct chc_state chc;
#endif
#ifdef WHIRLPOOL
#ifdef LTC_WHIRLPOOL
struct whirlpool_state whirlpool;
#endif
#ifdef SHA512
#ifdef LTC_SHA512
struct sha512_state sha512;
#endif
#ifdef SHA256
#ifdef LTC_SHA256
struct sha256_state sha256;
#endif
#ifdef SHA1
#ifdef LTC_SHA1
struct sha1_state sha1;
#endif
#ifdef MD5
#ifdef LTC_MD5
struct md5_state md5;
#endif
#ifdef MD4
#ifdef LTC_MD4
struct md4_state md4;
#endif
#ifdef MD2
#ifdef LTC_MD2
struct md2_state md2;
#endif
#ifdef TIGER
#ifdef LTC_TIGER
struct tiger_state tiger;
#endif
#ifdef RIPEMD128
#ifdef LTC_RIPEMD128
struct rmd128_state rmd128;
#endif
#ifdef RIPEMD160
#ifdef LTC_RIPEMD160
struct rmd160_state rmd160;
#endif
#ifdef RIPEMD256
#ifdef LTC_RIPEMD256
struct rmd256_state rmd256;
#endif
#ifdef RIPEMD320
#ifdef LTC_RIPEMD320
struct rmd320_state rmd320;
#endif
void *data;
Loading
Loading
@@ -191,7 +191,7 @@ extern struct ltc_hash_descriptor {
 
} hash_descriptor[];
 
#ifdef CHC_HASH
#ifdef LTC_CHC_HASH
int chc_register(int cipher);
int chc_init(hash_state * md);
int chc_process(hash_state * md, const unsigned char *in, unsigned long inlen);
Loading
Loading
@@ -200,7 +200,7 @@ int chc_test(void);
extern const struct ltc_hash_descriptor chc_desc;
#endif
 
#ifdef WHIRLPOOL
#ifdef LTC_WHIRLPOOL
int whirlpool_init(hash_state * md);
int whirlpool_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int whirlpool_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -208,7 +208,7 @@ int whirlpool_test(void);
extern const struct ltc_hash_descriptor whirlpool_desc;
#endif
 
#ifdef SHA512
#ifdef LTC_SHA512
int sha512_init(hash_state * md);
int sha512_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int sha512_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -216,9 +216,9 @@ int sha512_test(void);
extern const struct ltc_hash_descriptor sha512_desc;
#endif
 
#ifdef SHA384
#ifndef SHA512
#error SHA512 is required for SHA384
#ifdef LTC_SHA384
#ifndef LTC_SHA512
#error LTC_SHA512 is required for LTC_SHA384
#endif
int sha384_init(hash_state * md);
#define sha384_process sha512_process
Loading
Loading
@@ -227,16 +227,16 @@ int sha384_test(void);
extern const struct ltc_hash_descriptor sha384_desc;
#endif
 
#ifdef SHA256
#ifdef LTC_SHA256
int sha256_init(hash_state * md);
int sha256_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int sha256_done(hash_state * md, unsigned char *hash);
int sha256_test(void);
extern const struct ltc_hash_descriptor sha256_desc;
 
#ifdef SHA224
#ifndef SHA256
#error SHA256 is required for SHA224
#ifdef LTC_SHA224
#ifndef LTC_SHA256
#error LTC_SHA256 is required for LTC_SHA224
#endif
int sha224_init(hash_state * md);
#define sha224_process sha256_process
Loading
Loading
@@ -246,7 +246,7 @@ extern const struct ltc_hash_descriptor sha224_desc;
#endif
#endif
 
#ifdef SHA1
#ifdef LTC_SHA1
int sha1_init(hash_state * md);
int sha1_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int sha1_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -254,7 +254,7 @@ int sha1_test(void);
extern const struct ltc_hash_descriptor sha1_desc;
#endif
 
#ifdef MD5
#ifdef LTC_MD5
int md5_init(hash_state * md);
int md5_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int md5_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -262,7 +262,7 @@ int md5_test(void);
extern const struct ltc_hash_descriptor md5_desc;
#endif
 
#ifdef MD4
#ifdef LTC_MD4
int md4_init(hash_state * md);
int md4_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int md4_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -270,7 +270,7 @@ int md4_test(void);
extern const struct ltc_hash_descriptor md4_desc;
#endif
 
#ifdef MD2
#ifdef LTC_MD2
int md2_init(hash_state * md);
int md2_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int md2_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -278,7 +278,7 @@ int md2_test(void);
extern const struct ltc_hash_descriptor md2_desc;
#endif
 
#ifdef TIGER
#ifdef LTC_TIGER
int tiger_init(hash_state * md);
int tiger_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int tiger_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -286,7 +286,7 @@ int tiger_test(void);
extern const struct ltc_hash_descriptor tiger_desc;
#endif
 
#ifdef RIPEMD128
#ifdef LTC_RIPEMD128
int rmd128_init(hash_state * md);
int rmd128_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int rmd128_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -294,7 +294,7 @@ int rmd128_test(void);
extern const struct ltc_hash_descriptor rmd128_desc;
#endif
 
#ifdef RIPEMD160
#ifdef LTC_RIPEMD160
int rmd160_init(hash_state * md);
int rmd160_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int rmd160_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -302,7 +302,7 @@ int rmd160_test(void);
extern const struct ltc_hash_descriptor rmd160_desc;
#endif
 
#ifdef RIPEMD256
#ifdef LTC_RIPEMD256
int rmd256_init(hash_state * md);
int rmd256_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int rmd256_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -310,7 +310,7 @@ int rmd256_test(void);
extern const struct ltc_hash_descriptor rmd256_desc;
#endif
 
#ifdef RIPEMD320
#ifdef LTC_RIPEMD320
int rmd320_init(hash_state * md);
int rmd320_process(hash_state * md, const unsigned char *in, unsigned long inlen);
int rmd320_done(hash_state * md, unsigned char *hash);
Loading
Loading
@@ -374,6 +374,6 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen)
return CRYPT_OK; \
}
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_hash.h,v $ */
/* $Revision: 1.19 $ */
/* $Date: 2006/11/05 01:36:43 $ */
/* $Source$ */
/* $Revision$ */
/* $Date$ */
Loading
Loading
@@ -51,7 +51,7 @@ int omac_file(int cipher,
const char *filename,
unsigned char *out, unsigned long *outlen);
int omac_test(void);
#endif /* OMAC */
#endif /* LTC_OMAC */
 
#ifdef LTC_PMAC
 
Loading
Loading
@@ -96,10 +96,10 @@ void pmac_shift_xor(pmac_state *pmac);
 
#endif /* PMAC */
 
#ifdef EAX_MODE
#ifdef LTC_EAX_MODE
 
#if !(defined(LTC_OMAC) && defined(LTC_CTR_MODE))
#error EAX_MODE requires OMAC and CTR
#error LTC_EAX_MODE requires LTC_OMAC and CTR
#endif
 
typedef struct {
Loading
Loading
@@ -137,7 +137,7 @@ int eax_decrypt_verify_memory(int cipher,
int eax_test(void);
#endif /* EAX MODE */
 
#ifdef OCB_MODE
#ifdef LTC_OCB_MODE
typedef struct {
unsigned char L[MAXBLOCKSIZE], /* L value */
Ls[32][MAXBLOCKSIZE], /* L shifted by i bits to the left */
Loading
Loading
@@ -191,9 +191,9 @@ int ocb_ntz(unsigned long x);
int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen,
unsigned char *ct, unsigned char *tag, unsigned long *taglen, int mode);
 
#endif /* OCB_MODE */
#endif /* LTC_OCB_MODE */
 
#ifdef CCM_MODE
#ifdef LTC_CCM_MODE
 
#define CCM_ENCRYPT 0
#define CCM_DECRYPT 1
Loading
Loading
@@ -210,26 +210,26 @@ int ccm_memory(int cipher,
 
int ccm_test(void);
 
#endif /* CCM_MODE */
#endif /* LTC_CCM_MODE */
 
#if defined(LRW_MODE) || defined(GCM_MODE)
#if defined(LRW_MODE) || defined(LTC_GCM_MODE)
void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c);
#endif
 
 
/* table shared between GCM and LRW */
#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))
extern const unsigned char gcm_shift_table[];
#endif
 
#ifdef GCM_MODE
#ifdef LTC_GCM_MODE
 
#define GCM_ENCRYPT 0
#define GCM_DECRYPT 1
 
#define GCM_MODE_IV 0
#define GCM_MODE_AAD 1
#define GCM_MODE_TEXT 2
#define LTC_GCM_MODE_IV 0
#define LTC_GCM_MODE_AAD 1
#define LTC_GCM_MODE_TEXT 2
 
typedef struct {
symmetric_key K;
Loading
Loading
@@ -247,9 +247,9 @@ typedef struct {
ulong64 totlen, /* 64-bit counter used for IV and AAD */
pttotlen; /* 64-bit counter for the PT */
 
#ifdef GCM_TABLES
#ifdef LTC_GCM_TABLES
unsigned char PC[16][256][16] /* 16 tables of 8x128 */
#ifdef GCM_TABLES_SSE2
#ifdef LTC_GCM_TABLES_SSE2
__attribute__ ((aligned (16)))
#endif
;
Loading
Loading
@@ -287,9 +287,9 @@ int gcm_memory( int cipher,
int direction);
int gcm_test(void);
 
#endif /* GCM_MODE */
#endif /* LTC_GCM_MODE */
 
#ifdef PELICAN
#ifdef LTC_PELICAN
 
typedef struct pelican_state
{
Loading
Loading
@@ -311,6 +311,9 @@ int pelican_memory(const unsigned char *key, unsigned long keylen,
 
#ifdef LTC_XCBC
 
/* add this to "keylen" to xcbc_init to use a pure three-key XCBC MAC */
#define LTC_XCBC_PURE 0x8000UL
typedef struct {
unsigned char K[3][MAXBLOCKSIZE],
IV[MAXBLOCKSIZE];
Loading
Loading
@@ -376,6 +379,6 @@ int f9_test(void);
#endif
 
 
/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_mac.h,v $ */
/* $Revision: 1.20 $ */
/* $Date: 2006/11/08 21:57:04 $ */
/* $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