beecrypt.h   beecrypt.h 
/* /*
* beecrypt.h * beecrypt.h
* *
* Beecrypt library hooks & stubs, header * Beecrypt library hooks & stubs, header
* *
* Copyright (c) 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 210 skipping to change at line 210
* The following functions can be used to initialize and free a * The following functions can be used to initialize and free a
* randomGeneratorContext. Initializing will allocate a buffer of the size * randomGeneratorContext. Initializing will allocate a buffer of the size
* required by the randomGenerator, freeing will deallocate that buffer. * required by the randomGenerator, freeing will deallocate that buffer.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void randomGeneratorContextInit(randomGeneratorContext*, const randomGenera tor*); int randomGeneratorContextInit(randomGeneratorContext*, const randomGenerat or*);
BEEDLLAPI BEEDLLAPI
void randomGeneratorContextFree(randomGeneratorContext*); int randomGeneratorContextFree(randomGeneratorContext*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* /*
* Hash Functions * Hash Functions
*/ */
typedef void hashFunctionParam; typedef void hashFunctionParam;
skipping to change at line 250 skipping to change at line 250
* int (*update)(hashFunctionParam* param, const byte* data, int size); * int (*update)(hashFunctionParam* param, const byte* data, int size);
* *
* This function updates the hash function with an array of bytes. * This function updates the hash function with an array of bytes.
* Return value is 0 on success, or -1 on failure. * Return value is 0 on success, or -1 on failure.
* *
* int (*digest)(hashFunctionParam* param, uint32* data); * int (*digest)(hashFunctionParam* param, uint32* data);
* *
* This function computes the digest of all the data passed to the hash * This function computes the digest of all the data passed to the hash
* function, and stores the result in data. * function, and stores the result in data.
* Return value is 0 on success, or -1 on failure. * Return value is 0 on success, or -1 on failure.
* NOTE: data must be at least have a bytesize of 'digestsize' as described * NOTE: data MUST have a size (in bytes) of at least 'digestsize' as descr ibed
* in the hashFunction struct. * in the hashFunction struct.
* NOTE: for safety reasons, after calling digest, each specific implementa tion * NOTE: for safety reasons, after calling digest, each specific implementa tion
* MUST reset itself so that previous values in the parameters are erased. * MUST reset itself so that previous values in the parameters are erased.
*/ */
typedef struct typedef struct
{ {
const char* name; const char* name;
const unsigned int paramsize; /* in bytes */ const unsigned int paramsize; /* in bytes */
const unsigned int blocksize; /* in bytes */
const unsigned int digestsize; /* in bytes */ const unsigned int digestsize; /* in bytes */
const hashFunctionReset reset; const hashFunctionReset reset;
const hashFunctionUpdate update; const hashFunctionUpdate update;
const hashFunctionDigest digest; const hashFunctionDigest digest;
} hashFunction; } hashFunction;
/* /*
* You can use the following functions to find hash functions implemented b y * You can use the following functions to find hash functions implemented b y
* the library: * the library:
* *
skipping to change at line 319 skipping to change at line 320
* The following functions can be used to initialize and free a * The following functions can be used to initialize and free a
* hashFunctionContext. Initializing will allocate a buffer of the size * hashFunctionContext. Initializing will allocate a buffer of the size
* required by the hashFunction, freeing will deallocate that buffer. * required by the hashFunction, freeing will deallocate that buffer.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void hashFunctionContextInit(hashFunctionContext*, const hashFunction*); int hashFunctionContextInit(hashFunctionContext*, const hashFunction*);
BEEDLLAPI BEEDLLAPI
void hashFunctionContextFree(hashFunctionContext*); int hashFunctionContextFree(hashFunctionContext*);
BEEDLLAPI BEEDLLAPI
int hashFunctionContextReset(hashFunctionContext*); int hashFunctionContextReset(hashFunctionContext*);
BEEDLLAPI BEEDLLAPI
int hashFunctionContextUpdate(hashFunctionContext*, const byte*, int); int hashFunctionContextUpdate(hashFunctionContext*, const byte*, int);
BEEDLLAPI BEEDLLAPI
int hashFunctionContextUpdateMC(hashFunctionContext*, const memchunk*); int hashFunctionContextUpdateMC(hashFunctionContext*, const memchunk*);
BEEDLLAPI BEEDLLAPI
int hashFunctionContextUpdateMP32(hashFunctionContext*, const mp32number*); int hashFunctionContextUpdateMP32(hashFunctionContext*, const mp32number*);
BEEDLLAPI BEEDLLAPI
int hashFunctionContextDigest(hashFunctionContext*, mp32number*); int hashFunctionContextDigest(hashFunctionContext*, mp32number*);
BEEDLLAPI
int hashFunctionContextDigestMatch(hashFunctionContext*, const mp32number*)
;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* /*
* Keyed Hash Functions, a.k.a. Message Authentication Codes * Keyed Hash Functions, a.k.a. Message Authentication Codes
*/ */
typedef void keyedHashFunctionParam; typedef void keyedHashFunctionParam;
skipping to change at line 392 skipping to change at line 395
* NOTE: data must be at least have a bytesize of 'digestsize' as described * NOTE: data must be at least have a bytesize of 'digestsize' as described
* in the keyedHashFunction struct. * in the keyedHashFunction struct.
* NOTE: for safety reasons, after calling digest, each specific implementa tion * NOTE: for safety reasons, after calling digest, each specific implementa tion
* MUST reset itself so that previous values in the parameters are erased. * MUST reset itself so that previous values in the parameters are erased.
*/ */
typedef struct typedef struct
{ {
const char* name; const char* name;
const unsigned int paramsize; /* i n bytes */ const unsigned int paramsize; /* i n bytes */
const unsigned int blocksize; /* i n bytes */
const unsigned int digestsize; /* i n bytes */ const unsigned int digestsize; /* i n bytes */
const unsigned int keybitsmin; /* i n bits */ const unsigned int keybitsmin; /* i n bits */
const unsigned int keybitsmax; /* i n bits */ const unsigned int keybitsmax; /* i n bits */
const unsigned int keybitsinc; /* i n bits */ const unsigned int keybitsinc; /* i n bits */
const keyedHashFunctionSetup setup; const keyedHashFunctionSetup setup;
const keyedHashFunctionReset reset; const keyedHashFunctionReset reset;
const keyedHashFunctionUpdate update; const keyedHashFunctionUpdate update;
const keyedHashFunctionDigest digest; const keyedHashFunctionDigest digest;
} keyedHashFunction; } keyedHashFunction;
/* /*
* You can use the following functions to find keyed hash functions impleme nted * You can use the following functions to find keyed hash functions impleme nted
* by the library: * by the library:
* *
* keyedHashFunctionCount returns the number of keyed hash functions availa ble. * keyedHashFunctionCount returns the number of keyed hash functions availa ble.
* *
* keyedHashFunctionGet returns the random generator with a given index * keyedHashFunctionGet returns the keyed hash function with a given index
* (starting at zero, up to keyedHashFunctionCount() - 1), or NULL if the i ndex * (starting at zero, up to keyedHashFunctionCount() - 1), or NULL if the i ndex
* was out of bounds. * was out of bounds.
* *
* keyedHashFunctionFind returns the keyed hash function with the given nam e, * keyedHashFunctionFind returns the keyed hash function with the given nam e,
* or NULL if no keyed hash function exists with that name. * or NULL if no keyed hash function exists with that name.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
skipping to change at line 455 skipping to change at line 459
* The following functions can be used to initialize and free a * The following functions can be used to initialize and free a
* keyedHashFunctionContext. Initializing will allocate a buffer of the siz e * keyedHashFunctionContext. Initializing will allocate a buffer of the siz e
* required by the keyedHashFunction, freeing will deallocate that buffer. * required by the keyedHashFunction, freeing will deallocate that buffer.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void keyedHashFunctionContextInit(keyedHashFunctionContext*, const keyedHas hFunction*); int keyedHashFunctionContextInit(keyedHashFunctionContext*, const keyedHash Function*);
BEEDLLAPI BEEDLLAPI
void keyedHashFunctionContextFree(keyedHashFunctionContext*); int keyedHashFunctionContextFree(keyedHashFunctionContext*);
BEEDLLAPI BEEDLLAPI
int keyedHashFunctionContextSetup(keyedHashFunctionContext*, const uint32*, int); int keyedHashFunctionContextSetup(keyedHashFunctionContext*, const uint32*, int);
BEEDLLAPI BEEDLLAPI
int keyedHashFunctionContextReset(keyedHashFunctionContext*); int keyedHashFunctionContextReset(keyedHashFunctionContext*);
BEEDLLAPI BEEDLLAPI
int keyedHashFunctionContextUpdate(keyedHashFunctionContext*, const byte*, int); int keyedHashFunctionContextUpdate(keyedHashFunctionContext*, const byte*, int);
BEEDLLAPI BEEDLLAPI
int keyedHashFunctionContextUpdateMC(keyedHashFunctionContext*, const memch unk*); int keyedHashFunctionContextUpdateMC(keyedHashFunctionContext*, const memch unk*);
BEEDLLAPI BEEDLLAPI
int keyedHashFunctionContextUpdateMP32(keyedHashFunctionContext*, const mp3 2number*); int keyedHashFunctionContextUpdateMP32(keyedHashFunctionContext*, const mp3 2number*);
BEEDLLAPI BEEDLLAPI
int keyedHashFunctionContextDigest(keyedHashFunctionContext*, mp32number*); int keyedHashFunctionContextDigest(keyedHashFunctionContext*, mp32number*);
BEEDLLAPI
int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext*, const mp
32number*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* /*
* Block ciphers * Block ciphers
*/ */
typedef enum typedef enum
skipping to change at line 609 skipping to change at line 615
* The following functions can be used to initialize and free a * The following functions can be used to initialize and free a
* blockCipherContext. Initializing will allocate a buffer of the size * blockCipherContext. Initializing will allocate a buffer of the size
* required by the blockCipher, freeing will deallocate that buffer. * required by the blockCipher, freeing will deallocate that buffer.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void blockCipherContextInit(blockCipherContext*, const blockCipher*); int blockCipherContextInit(blockCipherContext*, const blockCipher*);
BEEDLLAPI BEEDLLAPI
void blockCipherContextSetup(blockCipherContext*, const uint32*, int, ciphe rOperation); int blockCipherContextSetup(blockCipherContext*, const uint32*, int, cipher Operation);
BEEDLLAPI BEEDLLAPI
void blockCipherContextSetIV(blockCipherContext*, const uint32*); int blockCipherContextSetIV(blockCipherContext*, const uint32*);
BEEDLLAPI BEEDLLAPI
void blockCipherContextFree(blockCipherContext*); int blockCipherContextFree(blockCipherContext*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 17 change blocks. 
13 lines changed or deleted 21 lines changed or added


 blowfishopt.h   blowfishopt.h 
skipping to change at line 37 skipping to change at line 37
#define _BLOWFISHOPT_H #define _BLOWFISHOPT_H
#include "beecrypt.h" #include "beecrypt.h"
#include "blowfish.h" #include "blowfish.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if WIN32 #if WIN32
#if __INTEL__ && __MWERKS__ # if defined(_MSC_VER) && defined(_M_IX86)
#define ASM_BLOWFISHENCRYPT # define ASM_BLOWFISHENCRYPT
#define ASM_BLOWFISHDECRYPT # define ASM_BLOWFISHDECRYPT
#endif # elif __INTEL__ && __MWERKS__
# define ASM_BLOWFISHENCRYPT
# define ASM_BLOWFISHDECRYPT
# endif
#endif #endif
#if defined(__GNUC__) #if defined(__GNUC__)
#if defined(i586) || defined(i686) #if defined(OPTIMIZE_I586) || defined(OPTIMIZE_I686)
#define ASM_BLOWFISHENCRYPT #define ASM_BLOWFISHENCRYPT
#define ASM_BLOWFISHDECRYPT #define ASM_BLOWFISHDECRYPT
#endif #endif
#endif #endif
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#if defined(i586) || defined(i686) #if defined(OPTIMIZE_I586) || defined(OPTIMIZE_I686)
#define ASM_BLOWFISHENCRYPT #define ASM_BLOWFISHENCRYPT
#define ASM_BLOWFISHDECRYPT #define ASM_BLOWFISHDECRYPT
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
6 lines changed or deleted 9 lines changed or added


 config.gnu.h   config.gnu.h 
skipping to change at line 53 skipping to change at line 53
#define BEOS 0 #define BEOS 0
#define CYGWIN 0 #define CYGWIN 0
#define DARWIN 0 #define DARWIN 0
#define FREEBSD 0 #define FREEBSD 0
#define HPUX 0 #define HPUX 0
#define LINUX 1 #define LINUX 1
#define MACOSX 0 #define MACOSX 0
#define OPENBSD 0 #define OPENBSD 0
#define OSF 0 #define OSF 0
#define QNX 0 #define QNX 0
#define SCO_UNIX 0
#define SOLARIS 0 #define SOLARIS 0
#define WIN32 0 #define WIN32 0
#define JAVAGLUE 0 #define JAVAGLUE 0
#define LEADING_UNDERSCORE 0 #define LEADING_UNDERSCORE 0
#define WORDS_BIGENDIAN 0 #define WORDS_BIGENDIAN 0
#define HAVE_ERRNO_H 1 #define HAVE_ERRNO_H 1
#define HAVE_STRING_H 1 #define HAVE_STRING_H 1
#define HAVE_STDLIB_H 1 #define HAVE_STDLIB_H 1
#define HAVE_ALLOCA_H 1
#define HAVE_CTYPE_H 1 #define HAVE_CTYPE_H 1
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
#define HAVE_TIME_H 1 #define HAVE_TIME_H 1
#define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1 #define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TIME_H 1
#define HAVE_THREAD_H 0 #define HAVE_THREAD_H 0
#define HAVE_SYNCH_H 0 #define HAVE_SYNCH_H 0
#define HAVE_PTHREAD_H 1 #define HAVE_PTHREAD_H 1
#define HAVE_SEMAPHORE_H 1 #define HAVE_SEMAPHORE_H 1
#define HAVE_TERMIO_H 1 #define HAVE_TERMIO_H 1
#define HAVE_TERMIOS_H 1 #define HAVE_TERMIOS_H 1
#define HAVE_SYS_AUDIOIO_H 0 #define HAVE_SYS_AUDIOIO_H 0
#define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_SOUNDCARD_H 1 #define HAVE_SYS_SOUNDCARD_H 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 0
#define HAVE_GETTIMEOFDAY 1 #define HAVE_GETTIMEOFDAY 1
#define HAVE_GETHRTIME 0 #define HAVE_GETHRTIME 0
#define HAVE_DEV_AUDIO 0 #define HAVE_DEV_AUDIO 0
#define HAVE_DEV_DSP 1 #define HAVE_DEV_DSP 1
#define HAVE_DEV_RANDOM 1 #define HAVE_DEV_RANDOM 1
#define HAVE_DEV_URANDOM 1 #define HAVE_DEV_URANDOM 1
#define HAVE_DEV_TTY 1 #define HAVE_DEV_TTY 1
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added


 config.h   config.h 
skipping to change at line 33 skipping to change at line 33
* *
*/ */
#ifndef _CONFIG_H #ifndef _CONFIG_H
#define _CONFIG_H #define _CONFIG_H
#if defined(_WIN32) && !defined(WIN32) #if defined(_WIN32) && !defined(WIN32)
# define WIN32 1 # define WIN32 1
#endif #endif
#if WIN32 #if WIN32 && !__CYGWIN32__
# include <win32/config.win.h> # include <win32/config.win.h>
# ifdef BEECRYPT_DLL_EXPORT # ifdef BEECRYPT_DLL_EXPORT
# define BEEDLLAPI # define BEEDLLAPI
# else # else
# define BEEDLLAPI __declspec(dllimport) # define BEEDLLAPI __declspec(dllimport)
# endif # endif
/*typedef UINT8_TYPE byte;*/ /*typedef UINT8_TYPE byte;*/
#else #else
# include <gnu/config.gnu.h> # include <gnu/config.gnu.h>
# define BEEDLLAPI # define BEEDLLAPI
typedef UINT8_TYPE byte; typedef UINT8_TYPE byte;
#endif #endif
#ifndef ROTL32
# define ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))
#endif
#ifndef ROTR32
# define ROTR32(x, s) (((x) >> (s)) | ((x) << (32 - (s))))
#endif
typedef INT8_TYPE int8; typedef INT8_TYPE int8;
typedef INT16_TYPE int16; typedef INT16_TYPE int16;
typedef INT32_TYPE int32; typedef INT32_TYPE int32;
typedef INT64_TYPE int64; typedef INT64_TYPE int64;
typedef UINT8_TYPE uint8; typedef UINT8_TYPE uint8;
typedef UINT16_TYPE uint16; typedef UINT16_TYPE uint16;
typedef UINT32_TYPE uint32; typedef UINT32_TYPE uint32;
typedef UINT64_TYPE uint64; typedef UINT64_TYPE uint64;
 End of changes. 2 change blocks. 
1 lines changed or deleted 8 lines changed or added


 dldp.h   dldp.h 
/* /*
* dldp.h * dldp.h
* *
* Discrete Logarithm Domain Parameters, header * Discrete Logarithm Domain Parameters, header
* *
* <conformance statement for IEEE P1363 needed here> * <conformance statement for IEEE P1363 needed here>
* *
* Copyright (c) 2000 Virtual Unlimited B.V. * Copyright (c) 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 37 skipping to change at line 37
#ifndef _DLDP_H #ifndef _DLDP_H
#define _DLDP_H #define _DLDP_H
#include "beecrypt.h" #include "beecrypt.h"
#include "mp32barrett.h" #include "mp32barrett.h"
/* /*
* Discrete Logarithm Domain Parameters - Prime * Discrete Logarithm Domain Parameters - Prime
* *
* Standard definition where p = 2qr+1; in case where p=2q+1, r=1 * Standard definition where p = qr+1; in case where p=2q+1, r=2
* *
* IEEE P1363 definition is p = rk+1 * In IEEE P1363 naming is p = rk+1
* *
* Hence, IEEE r = q and IEEE cofactor k = 2 or k = 2r * Hence, IEEE prime r = q and cofactor k = r
* *
* Make sure q is large enough to foil Pohlig-Hellman attacks * Make sure q is large enough to foil Pohlig-Hellman attacks
* See: "Handbook of Applied Cryptography", Chapter 3.6.4 * See: "Handbook of Applied Cryptography", Chapter 3.6.4
* *
* g is either a generator of a subgroup of order q, or a generator of orde r * g is either a generator of a subgroup of order q, or a generator of orde r
* n = (p-1) * n = (p-1)
*/ */
typedef struct typedef struct
{ {
skipping to change at line 68 skipping to change at line 68
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Functions for setting up and copying * Functions for setting up and copying
*/ */
BEEDLLAPI BEEDLLAPI
void dldp_pInit(dldp_p*); int dldp_pInit(dldp_p*);
BEEDLLAPI BEEDLLAPI
void dldp_pFree(dldp_p*); int dldp_pFree(dldp_p*);
BEEDLLAPI BEEDLLAPI
void dldp_pCopy(dldp_p*, const dldp_p*); int dldp_pCopy(dldp_p*, const dldp_p*);
/* /*
* Functions for generating keys * Functions for generating keys
*/ */
BEEDLLAPI BEEDLLAPI
void dldp_pPrivate(const dldp_p*, randomGeneratorContext*, mp32number*); int dldp_pPrivate(const dldp_p*, randomGeneratorContext*, mp32number*);
BEEDLLAPI BEEDLLAPI
void dldp_pPublic (const dldp_p*, const mp32number*, mp32number*); int dldp_pPublic (const dldp_p*, const mp32number*, mp32number*);
BEEDLLAPI BEEDLLAPI
void dldp_pPair (const dldp_p*, randomGeneratorContext*, mp32number*, mp3 2number*); int dldp_pPair (const dldp_p*, randomGeneratorContext*, mp32number*, mp32 number*);
/* /*
* Function for comparing domain parameters * Function for comparing domain parameters
*/ */
BEEDLLAPI BEEDLLAPI
int dldp_pEqual (const dldp_p*, const dldp_p*); int dldp_pEqual (const dldp_p*, const dldp_p*);
/* /*
* Functions for generating and validating dldp_pgoq variant domain paramet ers * Functions for generating and validating dldp_pgoq variant domain paramet ers
*/ */
BEEDLLAPI BEEDLLAPI
void dldp_pgoqMake (dldp_p*, randomGeneratorContext*, uint32, uint32, i nt); int dldp_pgoqMake (dldp_p*, randomGeneratorContext*, uint32, uint32, in t);
BEEDLLAPI BEEDLLAPI
void dldp_pgoqMakeSafe (dldp_p*, randomGeneratorContext*, uint32); int dldp_pgoqMakeSafe (dldp_p*, randomGeneratorContext*, uint32);
BEEDLLAPI BEEDLLAPI
void dldp_pgoqGenerator(dldp_p*, randomGeneratorContext*); int dldp_pgoqGenerator(dldp_p*, randomGeneratorContext*);
BEEDLLAPI BEEDLLAPI
int dldp_pgoqValidate (const dldp_p*, randomGeneratorContext*, int); int dldp_pgoqValidate (const dldp_p*, randomGeneratorContext*, int);
/* /*
* Functions for generating and validating dldp_pgon variant domain paramet ers * Functions for generating and validating dldp_pgon variant domain paramet ers
*/ */
BEEDLLAPI BEEDLLAPI
void dldp_pgonMake (dldp_p*, randomGeneratorContext*, uint32, uint32); int dldp_pgonMake (dldp_p*, randomGeneratorContext*, uint32, uint32);
BEEDLLAPI BEEDLLAPI
void dldp_pgonMakeSafe (dldp_p*, randomGeneratorContext*, uint32); int dldp_pgonMakeSafe (dldp_p*, randomGeneratorContext*, uint32);
BEEDLLAPI BEEDLLAPI
void dldp_pgonGenerator(dldp_p*, randomGeneratorContext*); int dldp_pgonGenerator(dldp_p*, randomGeneratorContext*);
BEEDLLAPI BEEDLLAPI
int dldp_pgonValidate (const dldp_p*, randomGeneratorContext*); int dldp_pgonValidate (const dldp_p*, randomGeneratorContext*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 16 change blocks. 
16 lines changed or deleted 16 lines changed or added


 dlkp.h   dlkp.h 
/* /*
* dlkp.h * dlkp.h
* *
* Discrete Logarithm Keypair, header * Discrete Logarithm Keypair, header
* *
* <conformance statement for IEEE P1363 needed here> * <conformance statement for IEEE P1363 needed here>
* *
* Copyright (c) 2000 Virtual Unlimited B.V. * Copyright (c) 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 45 skipping to change at line 45
dldp_p param; dldp_p param;
mp32number y; mp32number y;
mp32number x; mp32number x;
} dlkp_p; } dlkp_p;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void dlkp_pPair(dlkp_p*, randomGeneratorContext*, const dldp_p*); int dlkp_pPair(dlkp_p*, randomGeneratorContext*, const dldp_p*);
BEEDLLAPI BEEDLLAPI
void dlkp_pFree(dlkp_p*); int dlkp_pInit(dlkp_p*);
BEEDLLAPI BEEDLLAPI
void dlkp_pCopy(dlkp_p*, const dlkp_p*); int dlkp_pFree(dlkp_p*);
BEEDLLAPI
int dlkp_pCopy(dlkp_p*, const dlkp_p*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added


 dlpk.h   dlpk.h 
skipping to change at line 42 skipping to change at line 42
{ {
dldp_p param; dldp_p param;
mp32number y; mp32number y;
} dlpk_p; } dlpk_p;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void dlpk_pFree(dlpk_p*); int dlpk_pInit(dlpk_p*);
BEEDLLAPI BEEDLLAPI
void dlpk_pCopy(dlpk_p*, const dlpk_p*); int dlpk_pFree(dlpk_p*);
BEEDLLAPI
int dlpk_pCopy(dlpk_p*, const dlpk_p*);
BEEDLLAPI BEEDLLAPI
int dlpk_pEqual(const dlpk_p*, const dlpk_p*); int dlpk_pEqual(const dlpk_p*, const dlpk_p*);
BEEDLLAPI BEEDLLAPI
int dlpk_pgoqValidate(const dlpk_p*, randomGeneratorContext*, int cofactor ); int dlpk_pgoqValidate(const dlpk_p*, randomGeneratorContext*, int cofactor );
BEEDLLAPI BEEDLLAPI
int dlpk_pgonValidate(const dlpk_p*, randomGeneratorContext*); int dlpk_pgonValidate(const dlpk_p*, randomGeneratorContext*);
#ifdef __cplusplus #ifdef __cplusplus
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 dlsvdp-dh.h   dlsvdp-dh.h 
skipping to change at line 36 skipping to change at line 36
#ifndef _DLSVDP_DH_H #ifndef _DLSVDP_DH_H
#define _DLSVDP_DH_H #define _DLSVDP_DH_H
#include "dldp.h" #include "dldp.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void dlsvdp_pDHSecret(const dldp_p*, const mp32number*, const mp32number*, mp32number*); int dlsvdp_pDHSecret(const dldp_p*, const mp32number*, const mp32number*, m p32number*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 elgamal.h   elgamal.h 
/* /*
* elgamal.h * elgamal.h
* *
* ElGamal signature scheme, header * ElGamal signature scheme, header
* *
* Copyright (c) 2000 Virtual Unlimited B.V. * Copyright (c) 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 29 skipping to change at line 29
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
* *
*/ */
#ifndef _ELGAMAL_H #ifndef _ELGAMAL_H
#define _ELGAMAL_H #define _ELGAMAL_H
#include "mp32number.h"
#include "mp32barrett.h" #include "mp32barrett.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void elgv1sign(const mp32barrett* p, const mp32barrett* n, const mp32number * g, randomGeneratorContext*, const mp32number* hm, const mp32number* x, mp 32number* r, mp32number* s); int elgv1sign(const mp32barrett* p, const mp32barrett* n, const mp32number* g, randomGeneratorContext*, const mp32number* hm, const mp32number* x, mp3 2number* r, mp32number* s);
BEEDLLAPI BEEDLLAPI
void elgv3sign(const mp32barrett* p, const mp32barrett* n, const mp32number * g, randomGeneratorContext*, const mp32number* hm, const mp32number* x, mp 32number* r, mp32number* s); int elgv3sign(const mp32barrett* p, const mp32barrett* n, const mp32number* g, randomGeneratorContext*, const mp32number* hm, const mp32number* x, mp3 2number* r, mp32number* s);
BEEDLLAPI BEEDLLAPI
int elgv1vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, const mp32number* hm, const mp32number* y, const mp32number* r, const m p32number* s); int elgv1vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, const mp32number* hm, const mp32number* y, const mp32number* r, const m p32number* s);
BEEDLLAPI BEEDLLAPI
int elgv3vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, const mp32number* hm, const mp32number* y, const mp32number* r, const m p32number* s); int elgv3vrfy(const mp32barrett* p, const mp32barrett* n, const mp32number* g, const mp32number* hm, const mp32number* y, const mp32number* r, const m p32number* s);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added


 endianness.h   endianness.h 
/* /*
* endianness.h * endianness.h
* *
* Endian-dependant encoding/decoding, header * Endian-dependant encoding/decoding, header
* *
* Copyright (c) 1998, 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1998, 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 78 skipping to change at line 78
#else #else
return ( ((n & 0xffUL) << 24) | return ( ((n & 0xffUL) << 24) |
((n & 0xff00UL) << 8) | ((n & 0xff00UL) << 8) |
((n & 0xff0000UL) >> 8) | ((n & 0xff0000UL) >> 8) |
((n & 0xff000000UL) >> 24) ); ((n & 0xff000000UL) >> 24) );
#endif #endif
} }
inline int64 swap64(int64 n) inline int64 swap64(int64 n)
{ {
#if (SIZEOF_LONG == 4) #if HAVE_LONG_LONG
return ( ((n & 0xffLL) << 56) | return ( ((n & 0xffLL) << 56) |
((n & 0xff00LL) << 40) | ((n & 0xff00LL) << 40) |
((n & 0xff0000LL) << 24) | ((n & 0xff0000LL) << 24) |
((n & 0xff000000LL) << 8) | ((n & 0xff000000LL) << 8) |
((n & 0xff00000000LL) >> 8) | ((n & 0xff00000000LL) >> 8) |
((n & 0xff0000000000LL) >> 24) | ((n & 0xff0000000000LL) >> 24) |
((n & 0xff000000000000LL) >> 40) | ((n & 0xff000000000000LL) >> 40) |
((n & 0xff00000000000000LL) >> 56) ); ((n & 0xff00000000000000LL) >> 56) );
#else #else
return ( ((n & 0xffL) << 56) | return ( ((n & 0xffL) << 56) |
skipping to change at line 129 skipping to change at line 129
BEEDLLAPI BEEDLLAPI
int encodeChar(javachar, byte*); int encodeChar(javachar, byte*);
BEEDLLAPI BEEDLLAPI
int encodeFloat(javafloat, byte*); int encodeFloat(javafloat, byte*);
BEEDLLAPI BEEDLLAPI
int encodeDouble(javadouble, byte*); int encodeDouble(javadouble, byte*);
BEEDLLAPI BEEDLLAPI
int encodeInts(const javaint*, byte*, int); int encodeInts(const javaint*, byte*, int);
BEEDLLAPI BEEDLLAPI
int encodeIntsPartial(const javaint*, byte*, int);
BEEDLLAPI
int encodeChars(const javachar*, byte*, int); int encodeChars(const javachar*, byte*, int);
BEEDLLAPI BEEDLLAPI
int decodeByte(javabyte*, const byte*); int decodeByte(javabyte*, const byte*);
BEEDLLAPI BEEDLLAPI
int decodeShort(javashort*, const byte*); int decodeShort(javashort*, const byte*);
BEEDLLAPI BEEDLLAPI
int decodeInt(javaint*, const byte*); int decodeInt(javaint*, const byte*);
BEEDLLAPI BEEDLLAPI
int decodeLong(javalong*, const byte*); int decodeLong(javalong*, const byte*);
 End of changes. 3 change blocks. 
2 lines changed or deleted 4 lines changed or added


 entropy.h   entropy.h 
/* /*
* entropy.h * entropy.h
* *
* Entropy gathering routine(s) for pseudo-random generator initialization, header * Entropy gathering routine(s) for pseudo-random generator initialization, header
* *
* Copyright (c) 1998, 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1998, 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 31 skipping to change at line 31
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
* *
*/ */
#ifndef _ENTROPY_H #ifndef _ENTROPY_H
#define _ENTROPY_H #define _ENTROPY_H
#include "beecrypt.h" #include "beecrypt.h"
#if WIN32
#include <Windows.h>
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if WIN32 #if WIN32
BEEDLLAPI BEEDLLAPI
int entropy_provider_setup(HINSTANCE); int entropy_provider_setup(HINSTANCE);
BEEDLLAPI BEEDLLAPI
int entropy_provider_cleanup(); int entropy_provider_cleanup();
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 fips180.h   fips180.h 
/* /*
* fips180.h * fips180.h
* *
* SHA-1 hash function, header * SHA-1 hash function, header
* *
* Copyright (c) 1997, 1998, 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1997, 1998, 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 fips180opt.h   fips180opt.h 
skipping to change at line 37 skipping to change at line 37
#define _FIPS180OPT_H #define _FIPS180OPT_H
#include "beecrypt.h" #include "beecrypt.h"
#include "fips180.h" #include "fips180.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if WIN32 #if WIN32
#if __INTEL__ && __MWERKS__ # if defined(_MSC_VER) && defined(_M_IX86)
#define ASM_SHA1PROCESS # define ASM_SHA1PROCESS
#endif # elif __INTEL__ && __MWERKS__
# define ASM_SHA1PROCESS
# endif
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#if defined(i586) || defined(i686) #if defined(OPTIMIZE_I586) || defined(OPTIMIZE_I686)
#define ASM_SHA1PROCESS #define ASM_SHA1PROCESS
#endif #endif
#endif #endif
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#if defined(i586) || defined(i686) #if defined(OPTIMIZE_I586) || defined(OPTIMIZE_I686)
#define ASM_SHA1PROCESS #define ASM_SHA1PROCESS
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
5 lines changed or deleted 7 lines changed or added


 fips186.h   fips186.h 
/* /*
* fips186.h * fips186.h
* *
* FIPS186 pseudo-random generator, with SHA-1 as H function, header * FIPS186 pseudo-random generator, with SHA-1 as H function, header
* *
* Copyright (c) 1998, 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1998, 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 md5.h   md5.h 
skipping to change at line 30 skipping to change at line 30
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
* *
*/ */
#ifndef _MD5_H #ifndef _MD5_H
#define _MD5_H #define _MD5_H
#include "beecrypt.h" #include "beecrypt.h"
/*#include "md5opt.h"*/
typedef struct typedef struct
{ {
uint32 h[4]; uint32 h[4];
uint32 data[16]; uint32 data[16];
uint64 length; uint64 length;
uint8 offset; uint8 offset;
} md5Param; } md5Param;
#ifdef __cplusplus #ifdef __cplusplus
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 mp32.h   mp32.h 
skipping to change at line 97 skipping to change at line 97
BEEDLLAPI BEEDLLAPI
int mp32ltx(uint32, const uint32*, uint32, const uint32*); int mp32ltx(uint32, const uint32*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32gex(uint32, const uint32*, uint32, const uint32*); int mp32gex(uint32, const uint32*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32lex(uint32, const uint32*, uint32, const uint32*); int mp32lex(uint32, const uint32*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32isone(uint32, const uint32*); int mp32isone(uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32istwo(uint32, const uint32*);
BEEDLLAPI
int mp32leone(uint32, const uint32*); int mp32leone(uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32eqmone(uint32, const uint32*, const uint32*); int mp32eqmone(uint32, const uint32*, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32msbset(uint32, const uint32*); int mp32msbset(uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32lsbset(uint32, const uint32*); int mp32lsbset(uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
skipping to change at line 181 skipping to change at line 183
uint32 mp32addmul (uint32, uint32*, const uint32*, uint32); uint32 mp32addmul (uint32, uint32*, const uint32*, uint32);
BEEDLLAPI BEEDLLAPI
uint32 mp32addsqrtrc(uint32, uint32*, const uint32*); uint32 mp32addsqrtrc(uint32, uint32*, const uint32*);
BEEDLLAPI BEEDLLAPI
void mp32mul(uint32*, uint32, const uint32*, uint32, const uint32*); void mp32mul(uint32*, uint32, const uint32*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
void mp32sqr(uint32*, uint32, const uint32*); void mp32sqr(uint32*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
void mp32gcd(uint32*, uint32, const uint32*, const uint32*, uint32*); void mp32gcd_w(uint32, const uint32*, const uint32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
uint32 mp32nmodw(uint32*, uint32, const uint32*, uint32, uint32*); uint32 mp32nmodw(uint32*, uint32, const uint32*, uint32, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32nmod(uint32*, uint32, const uint32*, uint32, const uint32*, uint32 *); void mp32nmod(uint32*, uint32, const uint32*, uint32, const uint32*, uint32 *);
BEEDLLAPI BEEDLLAPI
void mp32ndivmod(uint32*, uint32, const uint32*, uint32, const uint32*, uin t32*); void mp32ndivmod(uint32*, uint32, const uint32*, uint32, const uint32*, uin t32*);
BEEDLLAPI BEEDLLAPI
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added


 mp32barrett.h   mp32barrett.h 
/* /*
* mp32barrett.h * mp32barrett.h
* *
* Barrett modular reduction, header * Barrett modular reduction, header
* *
* Copyright (c) 1997, 1998, 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1997, 1998, 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 35 skipping to change at line 35
#ifndef _MP32BARRETT_H #ifndef _MP32BARRETT_H
#define _MP32BARRETT_H #define _MP32BARRETT_H
#include "beecrypt.h" #include "beecrypt.h"
#include "mp32number.h" #include "mp32number.h"
typedef struct typedef struct
{ {
uint32 size; uint32 size;
uint32* data; /* (size) words / allocated on one block of 9*size+5 uint32* modl; /* (size) words */
words and set the other pointers appropriately */
uint32* modl; /* (size+1) words */
uint32* mu; /* (size+1) words */ uint32* mu; /* (size+1) words */
uint32* wksp; /* (6*size+4) words */
} mp32barrett; } mp32barrett;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
void mp32bzero (mp32barrett*); void mp32bzero(mp32barrett*);
BEEDLLAPI BEEDLLAPI
void mp32binit (mp32barrett*, uint32); void mp32binit(mp32barrett*, uint32);
BEEDLLAPI BEEDLLAPI
void mp32bfree (mp32barrett*); void mp32bfree(mp32barrett*);
BEEDLLAPI BEEDLLAPI
void mp32bset (mp32barrett*, uint32, const uint32*); void mp32bcopy(mp32barrett*, const mp32barrett*);
BEEDLLAPI BEEDLLAPI
void mp32bmu (mp32barrett*); void mp32bset(mp32barrett*, uint32, const uint32*);
BEEDLLAPI
void mp32bsethex(mp32barrett*, const char*);
BEEDLLAPI BEEDLLAPI
void mp32brnd (const mp32barrett*, randomGeneratorContext*); void mp32bsubone(const mp32barrett*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32brndres (const mp32barrett*, uint32*, randomGeneratorContext*); void mp32bmu_w(mp32barrett*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32brndoddres(const mp32barrett*, uint32*, randomGeneratorContext*); void mp32brnd_w (const mp32barrett*, randomGeneratorContext*, uint32*, ui nt32*);
BEEDLLAPI BEEDLLAPI
void mp32brndinvres(const mp32barrett*, uint32*, randomGeneratorContext*); void mp32brndodd_w(const mp32barrett*, randomGeneratorContext*, uint32*, ui
nt32*);
BEEDLLAPI
void mp32brndinv_w(const mp32barrett*, randomGeneratorContext*, uint32*, ui
nt32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bmodsubone(const mp32barrett*); void mp32bneg_w(const mp32barrett*, const uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bneg (const mp32barrett*); void mp32bmod_w(const mp32barrett*, const uint32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bmod (const mp32barrett*, uint32, const uint32*); void mp32baddmod_w(const mp32barrett*, uint32, const uint32*, uint32, const uint32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32baddmod (const mp32barrett*, uint32, const uint32*, uint32, cons t uint32*); void mp32bsubmod_w(const mp32barrett*, uint32, const uint32*, uint32, const uint32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bsubmod (const mp32barrett*, uint32, const uint32*, uint32, cons void mp32bmulmod_w(const mp32barrett*, uint32, const uint32*, uint32, const
t uint32*); uint32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bmulmodres(const mp32barrett*, uint32*, uint32, const uint32*, uin t32, const uint32*); void mp32bsqrmod_w(const mp32barrett*, uint32, const uint32*, uint32*, uint 32*);
BEEDLLAPI BEEDLLAPI
void mp32bsqrmodres(const mp32barrett*, uint32*, uint32, const uint32*); void mp32bpowmod_w(const mp32barrett*, uint32, const uint32*, uint32, const
uint32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bmulmod (const mp32barrett*, uint32, const uint32*, uint32, cons t uint32*); void mp32bpowmodsld_w(const mp32barrett*, const uint32*, uint32, const uint 32*, uint32*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bsqrmod (const mp32barrett*, uint32, const uint32*); void mp32btwopowmod_w(const mp32barrett*, uint32, const uint32*, uint32*, u int32*);
BEEDLLAPI BEEDLLAPI
void mp32bpowmod (const mp32barrett*, uint32, const uint32*, uint32, cons int mp32binv_w(const mp32barrett*, uint32, const uint32*, uint32*, uint32*
t uint32*); );
BEEDLLAPI
void mp32btwopowmod(const mp32barrett*, uint32, const uint32*);
/* simultaneous multiple exponentiation, for use in dsa and elgamal signatu
re verification */
/* To be added:
* simultaneous multiple exponentiation, for use in dsa and elgamal signatu
re verification
*/
BEEDLLAPI BEEDLLAPI
void mp32bsm2powmod(const mp32barrett*, const uint32*, const uint32*, const uint32*, const uint32*); void mp32bsm2powmod(const mp32barrett*, const uint32*, const uint32*, const uint32*, const uint32*);
BEEDLLAPI BEEDLLAPI
void mp32bsm3powmod(const mp32barrett*, const uint32*, const uint32*, const uint32*, const uint32*, const uint32*, const uint32*); void mp32bsm3powmod(const mp32barrett*, const uint32*, const uint32*, const uint32*, const uint32*, const uint32*, const uint32*);
BEEDLLAPI BEEDLLAPI
int mp32binv (const mp32barrett*, uint32, const uint32*); int mp32bpprime_w(const mp32barrett*, randomGeneratorContext*, int, uint32
*);
BEEDLLAPI
int mp32bpprime (const mp32barrett*, randomGeneratorContext*, int);
/* the next routines take mp32numbers as parameters */ /* the next routines take mp32numbers as parameters */
BEEDLLAPI BEEDLLAPI
void mp32bnmulmodres(const mp32barrett*, uint32*, const mp32number*, const void mp32bnrnd(const mp32barrett*, randomGeneratorContext*, mp32number*);
mp32number*);
BEEDLLAPI BEEDLLAPI
void mp32bnsqrmodres(const mp32barrett*, uint32*, const mp32number*); void mp32bnmulmod(const mp32barrett*, const mp32number*, const mp32number*,
mp32number*);
BEEDLLAPI
void mp32bnsqrmod(const mp32barrett*, const mp32number*, mp32number*);
BEEDLLAPI BEEDLLAPI
void mp32bnpowmod (const mp32barrett*, const mp32number*, const mp32numbe r*); void mp32bnpowmod (const mp32barrett*, const mp32number*, const mp32numbe r*, mp32number*);
BEEDLLAPI BEEDLLAPI
void mp32bnsqrmod (const mp32barrett*, const mp32number*); void mp32bnpowmodsld(const mp32barrett*, const uint32*, const mp32number*, mp32number*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 28 change blocks. 
42 lines changed or deleted 46 lines changed or added


 mp32number.h   mp32number.h 
/* /*
* mp32number.h * mp32number.h
* *
* Multiprecision numbers, header * Multiprecision numbers, header
* *
* Copyright (c) 1997, 1998, 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1997, 1998, 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 51 skipping to change at line 51
#endif #endif
BEEDLLAPI BEEDLLAPI
void mp32nzero(mp32number*); void mp32nzero(mp32number*);
BEEDLLAPI BEEDLLAPI
void mp32nsize(mp32number*, uint32); void mp32nsize(mp32number*, uint32);
BEEDLLAPI BEEDLLAPI
void mp32ninit(mp32number*, uint32, const uint32*); void mp32ninit(mp32number*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
void mp32nfree(mp32number*); void mp32nfree(mp32number*);
BEEDLLAPI
void mp32ncopy(mp32number*, const mp32number*);
BEEDLLAPI
void mp32nwipe(mp32number*);
BEEDLLAPI BEEDLLAPI
void mp32nset (mp32number*, uint32, const uint32*); void mp32nset (mp32number*, uint32, const uint32*);
BEEDLLAPI BEEDLLAPI
void mp32nsetw (mp32number*, uint32); void mp32nsetw (mp32number*, uint32);
BEEDLLAPI BEEDLLAPI
void mp32nsethex(mp32number*, const char*); void mp32nsethex(mp32number*, const char*);
#ifdef __cplusplus #ifdef __cplusplus
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 mp32opt.h   mp32opt.h 
/* /*
* mp32opt.h * mp32opt.h
* *
* Multiprecision integer assembler-optimized routined for 32 bit cpu, head er * Multiprecision integer assembler-optimized routined for 32 bit cpu, head er
* *
* Copyright (c) 1999, 2000 Virtual Unlimited B.V. * Copyright (c) 1999, 2000, 2001 Virtual Unlimited B.V.
* *
* Author: Bob Deblier <bob@virtualunlimited.com> * Author: Bob Deblier <bob@virtualunlimited.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 36 skipping to change at line 36
#ifndef _MP32OPT_H #ifndef _MP32OPT_H
#define _MP32OPT_H #define _MP32OPT_H
#include "beecrypt.h" #include "beecrypt.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if WIN32 #if WIN32
#if __INTEL__ && __MWERKS__ # if defined(_MSC_VER) && defined(_M_IX86)
#define ASM_MP32ADDW # define ASM_MP32ADDW
#define ASM_MP32ADD # define ASM_MP32ADD
#define ASM_MP32SUBW # define ASM_MP32SUBW
#define ASM_MP32SUB # define ASM_MP32SUB
#define ASM_MP32MULTWO # define ASM_MP32MULTWO
#define ASM_MP32SETMUL # define ASM_MP32SETMUL
#define ASM_MP32ADDMUL # define ASM_MP32ADDMUL
#define ASM_MP32ADDSQRTRC # define ASM_MP32ADDSQRTRC
#endif # elif __INTEL__ && __MWERKS__
# define ASM_MP32ADDW
# define ASM_MP32ADD
# define ASM_MP32SUBW
# define ASM_MP32SUB
# define ASM_MP32MULTWO
# define ASM_MP32SETMUL
# define ASM_MP32ADDMUL
# define ASM_MP32ADDSQRTRC
# endif
#endif #endif
#if defined(__GNUC__) #if defined(__GNUC__)
#if defined(i386) || defined(i486) || defined(i586) || defined(i686) # if defined(OPTIMIZE_I386) || defined(OPTIMIZE_I486) || defined(OPTIMIZE_I
#define ASM_MP32ADDW 586) || defined(OPTIMIZE_I686)
#define ASM_MP32ADD # define ASM_MP32ADDW
#define ASM_MP32SUBW # define ASM_MP32ADD
#define ASM_MP32SUB # define ASM_MP32SUBW
#define ASM_MP32MULTWO # define ASM_MP32SUB
#define ASM_MP32SETMUL # define ASM_MP32MULTWO
#define ASM_MP32ADDMUL # define ASM_MP32SETMUL
#define ASM_MP32ADDSQRTRC # define ASM_MP32ADDMUL
#endif # define ASM_MP32ADDSQRTRC
#if defined(ia64) # endif
#define ASM_MP32ZERO # if defined(OPTIMIZE_IA64)
#define ASM_MP32COPY # define ASM_MP32ZERO
#define ASM_MP32ADD # define ASM_MP32COPY
#define ASM_MP32SUB # define ASM_MP32ADD
#define ASM_MP32SETMUL # define ASM_MP32SUB
#define ASM_MP32ADDMUL # undef ASM_MP32SETMUL
#endif # undef ASM_MP32ADDMUL
#if defined(powerpc) # endif
#define ASM_MP32ADDW # if defined(OPTIMIZE_POWERPC)
#define ASM_MP32ADD # define ASM_MP32ADDW
#define ASM_MP32SUBW # define ASM_MP32ADD
#define ASM_MP32SUB # define ASM_MP32SUBW
#define ASM_MP32SETMUL # define ASM_MP32SUB
#define ASM_MP32ADDMUL # define ASM_MP32SETMUL
#define ASM_MP32ADDSQRTRC # define ASM_MP32ADDMUL
#endif # define ASM_MP32ADDSQRTRC
#if defined(sparcv9) || defined(sparcv8plus) # endif
#define ASM_MP32ADDW # if defined(OPTIMIZE_SPARCV8PLUS) || defined(OPTIMIZE_SPARCV9)
#define ASM_MP32ADD # define ASM_MP32ADDW
#define ASM_MP32SUBW # define ASM_MP32ADD
#define ASM_MP32SUB # define ASM_MP32SUBW
#define ASM_MP32SETMUL # define ASM_MP32SUB
#define ASM_MP32ADDMUL # define ASM_MP32SETMUL
#define ASM_MP32ADDSQRTRC # define ASM_MP32ADDMUL
#endif # define ASM_MP32ADDSQRTRC
# endif
#endif #endif
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#if defined(sparcv9) || defined(sparcv8plus) # if defined(OPTIMIZE_SPARCV8PLUS) /* || defined(OPTIMIZE_SPARCV9) */
#define ASM_MP32ADDW # define ASM_MP32ADDW
#define ASM_MP32ADD # define ASM_MP32ADD
#define ASM_MP32SUBW # define ASM_MP32SUBW
#define ASM_MP32SUB # define ASM_MP32SUB
#define ASM_MP32SETMUL # define ASM_MP32SETMUL
#define ASM_MP32ADDMUL # define ASM_MP32ADDMUL
#define ASM_MP32ADDSQRTRC # define ASM_MP32ADDSQRTRC
#endif # endif
#if defined(i386) || defined(i486) || defined(i586) || defined(i686) # if defined(OPTIMIZE_I386) || defined(OPTIMIZE_I486) || defined(OPTIMIZE_I
#define ASM_MP32ADDW 586) || defined(OPTIMIZE_I686)
#define ASM_MP32ADD # define ASM_MP32ADDW
#define ASM_MP32SUBW # define ASM_MP32ADD
#define ASM_MP32SUB # define ASM_MP32SUBW
#define ASM_MP32MULTWO # define ASM_MP32SUB
#define ASM_MP32SETMUL # define ASM_MP32MULTWO
#define ASM_MP32ADDMUL # define ASM_MP32SETMUL
#define ASM_MP32ADDSQRTRC # define ASM_MP32ADDMUL
#endif # define ASM_MP32ADDSQRTRC
# endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
66 lines changed or deleted 77 lines changed or added


 mp32prime.h   mp32prime.h 
skipping to change at line 40 skipping to change at line 40
#define SMALL_PRIMES_PRODUCT_MAX 64 #define SMALL_PRIMES_PRODUCT_MAX 64
extern uint32* mp32spprod[SMALL_PRIMES_PRODUCT_MAX]; extern uint32* mp32spprod[SMALL_PRIMES_PRODUCT_MAX];
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
int mp32ptrials (uint32); int mp32ptrials (uint32);
BEEDLLAPI BEEDLLAPI
int mp32pmilrab (const mp32barrett*, randomGeneratorContext*, int); int mp32pmilrab_w (const mp32barrett*, randomGeneratorContext*, int, uin t32*);
BEEDLLAPI BEEDLLAPI
void mp32prnd (mp32barrett*, randomGeneratorContext*, uint32, int, con st mp32number*); void mp32prnd_w (mp32barrett*, randomGeneratorContext*, uint32, int, c onst mp32number*, uint32*);
BEEDLLAPI BEEDLLAPI
void mp32prndsafe (mp32barrett*, randomGeneratorContext*, uint32, int); void mp32prndsafe_w (mp32barrett*, randomGeneratorContext*, uint32, int, u int32*);
BEEDLLAPI BEEDLLAPI
void mp32prndcon (mp32barrett*, randomGeneratorContext*, uint32, int, con st mp32number*, const mp32number*, const mp32number*, mp32number*); void mp32prndcon_w (mp32barrett*, randomGeneratorContext*, uint32, int, c onst mp32number*, const mp32number*, const mp32number*, mp32number*, uint32 *);
BEEDLLAPI BEEDLLAPI
void mp32prndconone(mp32barrett*, randomGeneratorContext*, uint32, int, con st mp32barrett*, const mp32number*, mp32number*, int); void mp32prndconone_w(mp32barrett*, randomGeneratorContext*, uint32, int, c onst mp32barrett*, const mp32number*, mp32number*, int, uint32*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added


 timestamp.h   timestamp.h 
skipping to change at line 31 skipping to change at line 31
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
* *
*/ */
#ifndef _TIMESTAMP_H #ifndef _TIMESTAMP_H
#define _TIMESTAMP_H #define _TIMESTAMP_H
#include "beecrypt.h" #include "beecrypt.h"
#define ONE_SECOND 1000LL #if HAVE_LONG_LONG
#define ONE_MINUTE 60000LL # define ONE_SECOND 1000LL
#define ONE_HOUR 3600000LL # define ONE_MINUTE 60000LL
#define ONE_DAY 86400000LL # define ONE_HOUR 3600000LL
# define ONE_DAY 86400000LL
# define ONE_WEEK 604800000LL
#else
# define ONE_SECOND 1000L
# define ONE_MINUTE 60000L
# define ONE_HOUR 3600000L
# define ONE_DAY 86400000L
# define ONE_WEEK 604800000L
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
BEEDLLAPI BEEDLLAPI
javalong timestamp(); javalong timestamp();
#ifdef __cplusplus #ifdef __cplusplus
} }
 End of changes. 1 change blocks. 
4 lines changed or deleted 13 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/