added libtomcrypt-1.11

This commit is contained in:
Tom St Denis
2006-04-06 19:48:32 +00:00
committed by Steffen Jaeckel
parent 99b6d03203
commit 64d7ebe166
281 changed files with 1434 additions and 479 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ extern "C" {
#endif
/* version */
#define CRYPT 0x0110
#define SCRYPT "1.10"
#define CRYPT 0x0111
#define SCRYPT "1.11"
/* max size of either a cipher/hash block or symmetric key [largest of the two] */
#define MAXBLOCKSIZE 128
+4 -4
View File
@@ -37,7 +37,7 @@ void *XMEMSET(void *s, int c, size_t n);
*/
/* detect x86-32 machines somewhat */
#if defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))
#if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__))))
#define ENDIAN_LITTLE
#define ENDIAN_32BITWORD
#define LTC_FAST
@@ -51,7 +51,7 @@ void *XMEMSET(void *s, int c, size_t n);
#endif
/* detect amd64 */
#if defined(__x86_64__)
#if !defined(__STRICT_ANSI__) && defined(__x86_64__)
#define ENDIAN_LITTLE
#define ENDIAN_64BITWORD
#define LTC_FAST
@@ -59,7 +59,7 @@ void *XMEMSET(void *s, int c, size_t n);
#endif
/* detect PPC32 */
#if defined(LTC_PPC32)
#if !defined(__STRICT_ANSI__) && defined(LTC_PPC32)
#define ENDIAN_BIG
#define ENDIAN_32BITWORD
#define LTC_FAST
@@ -102,7 +102,7 @@ void *XMEMSET(void *s, int c, size_t n);
/* #define ENDIAN_64BITWORD */
#if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD))
#error You must specify a word size as well as endianess in mycrypt_cfg.h
#error You must specify a word size as well as endianess in tomcrypt_cfg.h
#endif
#if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE))
+1
View File
@@ -702,6 +702,7 @@ int lrw_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, s
int lrw_getiv(unsigned char *IV, unsigned long *len, symmetric_LRW *lrw);
int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw);
int lrw_done(symmetric_LRW *lrw);
int lrw_test(void);
/* don't call */
int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, int mode, symmetric_LRW *lrw);
+5 -1
View File
@@ -257,7 +257,7 @@
#define MRSA
/* Include Katja (a Rabin variant like RSA) */
// #define MKAT
/* #define MKAT */
/* Digital Signature Algorithm */
#define MDSA
@@ -265,6 +265,10 @@
/* ECC */
#define MECC
#if defined(TFM_DESC) && defined(MECC)
#define MECC_ACCEL
#endif
/* Timing Resistant? */
/* #define LTC_ECC_TIMING_RESISTANT */
+3 -3
View File
@@ -242,7 +242,7 @@ asm __volatile__ ( \
#define RORc(x,n) _lrotr(x,n)
#define ROLc(x,n) _lrotl(x,n)
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
#elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM)
static inline unsigned ROL(unsigned word, int i)
{
@@ -285,7 +285,7 @@ static inline unsigned RORc(unsigned word, const int i)
#endif
#elif defined(LTC_PPC32)
#elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32)
static inline unsigned ROL(unsigned word, int i)
{
@@ -341,7 +341,7 @@ static inline unsigned RORc(unsigned word, const int i)
/* 64-bit Rotates */
#if defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
static inline unsigned long ROL64(unsigned long word, int i)
{
+15 -1
View File
@@ -339,12 +339,22 @@ typedef struct {
*/
int (*ecc_ptadd)(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp);
/** ECC GF(p) point double
@param P The first point
@param R The destination of 2P
@param modulus The modulus
@param mp The "b" value from montgomery_setup()
@return CRYPT_OK on success
*/
int (*ecc_ptdbl)(ecc_point *P, ecc_point *R, void *modulus, void *mp);
/** ECC mapping from projective to affine, currently uses (x,y,z) => (x/z^2, y/z^3, 1)
@param P The point to map
@param modulus The modulus
@param mp The "b" value from montgomery_setup()
@return CRYPT_OK on success
@remark The mapping can be different but keep in mind a ecc_point only has three integers (x,y,z) so if you use a different mapping you have to make it fit.
@remark The mapping can be different but keep in mind a ecc_point only has three
integers (x,y,z) so if you use a different mapping you have to make it fit.
*/
int (*ecc_map)(ecc_point *P, void *modulus, void *mp);
@@ -388,6 +398,10 @@ extern const ltc_math_descriptor ltm_desc;
extern const ltc_math_descriptor tfm_desc;
#endif
#ifdef GMP_DESC
extern const ltc_math_descriptor gmp_desc;
#endif
#if !defined(DESC_DEF_ONLY) && defined(LTC_SOURCE)
#define MP_DIGIT_BIT ltc_mp.bits_per_digit
+2
View File
@@ -228,11 +228,13 @@ int ltc_ecc_is_valid_idx(int n);
/* point ops (mp == montgomery digit) */
#ifndef MECC_ACCEL
/* R = 2P */
int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *mp);
/* R = P + Q */
int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp);
#endif
/* R = kG */
int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map);