Add system.h and debug.h, remove internal include path structure.
authorjbj <devnull@localhost>
Mon, 2 Aug 2004 02:23:27 +0000 (02:23 +0000)
committerjbj <devnull@localhost>
Mon, 2 Aug 2004 02:23:27 +0000 (02:23 +0000)
CVS patchset: 7376
CVS date: 2004/08/02 02:23:27

59 files changed:
beecrypt/aes.c
beecrypt/base64.c
beecrypt/beecrypt.c
beecrypt/blockmode.c
beecrypt/blockpad.c
beecrypt/blowfish.c
beecrypt/debug.h [new file with mode: 0644]
beecrypt/dhaes.c
beecrypt/dldp.c
beecrypt/dlkp.c
beecrypt/dlpk.c
beecrypt/dlsvdp-dh.c
beecrypt/dsa.c
beecrypt/elgamal.c
beecrypt/endianness.c
beecrypt/entropy.c
beecrypt/fips186.c
beecrypt/hmac.c
beecrypt/hmacmd5.c
beecrypt/hmacsha1.c
beecrypt/hmacsha256.c
beecrypt/java/javaglue.c
beecrypt/md5.c
beecrypt/memchunk.c
beecrypt/mp.c
beecrypt/mpbarrett.c
beecrypt/mpnumber.c
beecrypt/mpprime.c
beecrypt/mtprng.c
beecrypt/pkcs1.c
beecrypt/pkcs12.c
beecrypt/python/_bc-py.c
beecrypt/python/debug-py.c
beecrypt/python/mpw-py.c
beecrypt/python/rng-py.c
beecrypt/rsa.c
beecrypt/rsakp.c
beecrypt/rsapk.c
beecrypt/sha1.c
beecrypt/sha256.c
beecrypt/system.h [new file with mode: 0644]
beecrypt/tests/benchbc.c
beecrypt/tests/benchhf.c
beecrypt/tests/benchme.c
beecrypt/tests/testaes.c
beecrypt/tests/testblowfish.c
beecrypt/tests/testconv.c
beecrypt/tests/testdldp.c
beecrypt/tests/testdsa.c
beecrypt/tests/testhmacmd5.c
beecrypt/tests/testhmacsha1.c
beecrypt/tests/testmd5.c
beecrypt/tests/testmp.c
beecrypt/tests/testmpinv.c
beecrypt/tests/testrsa.c
beecrypt/tests/testsha1.c
beecrypt/tests/testsha256.c
beecrypt/tests/testutil.c
beecrypt/timestamp.c

index 2d73776..959f0fc 100644 (file)
  * \ingroup BC_aes_m BC_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "beecrypt/aes.h"
+#include "aes.h"
 
 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
 # if (BYTE_ORDER != BIG_ENDIAN) && (BYTE_ORDER != LITTLE_ENDIAN)
 #endif
 
 #if WORDS_BIGENDIAN
-# include "beecrypt/aes_be.h"
+# include "aes_be.h"
 #else
-#  include "beecrypt/aes_le.h"
+#  include "aes_le.h"
 #endif
 
+#include "debug.h"
+
 #ifdef ASM_AESENCRYPTECB
 extern int aesEncryptECB(aesParam*, uint32_t*, const uint32_t*, unsigned int);
 #endif
index 789eba1..3f99d0a 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "base64.h"
+#include "endianness.h"
 
-#include "beecrypt/base64.h"
-#include "beecrypt/endianness.h"
-
-#if HAVE_CTYPE_H
-# include <ctype.h>
-#endif
+#include "debug.h"
 
 static const char* to_b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
index b8bc974..1a7a1b3 100644 (file)
  * \ingroup ES_m PRNG_m HASH_m HMAC_m BC_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "beecrypt.h"
 
-#include "beecrypt/beecrypt.h"
+#include "entropy.h"
 
-#include "beecrypt/entropy.h"
+#include "fips186.h"
+#include "mtprng.h"
 
-#include "beecrypt/fips186.h"
-#include "beecrypt/mtprng.h"
+#include "md5.h"
+#include "sha1.h"
+#include "sha256.h"
 
-#include "beecrypt/md5.h"
-#include "beecrypt/sha1.h"
-#include "beecrypt/sha256.h"
+#include "hmacmd5.h"
+#include "hmacsha1.h"
+#include "hmacsha256.h"
 
-#include "beecrypt/hmacmd5.h"
-#include "beecrypt/hmacsha1.h"
-#include "beecrypt/hmacsha256.h"
+#include "aes.h"
+#include "blowfish.h"
+#include "blockmode.h"
 
-#include "beecrypt/aes.h"
-#include "beecrypt/blowfish.h"
-#include "beecrypt/blockmode.h"
+#include "debug.h"
 
 static entropySource entropySourceList[] =
 {
index 6a19ed5..6ec12c9 100644 (file)
  * \ingroup BC_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "blockmode.h"
 
-#include "beecrypt/blockmode.h"
+#include "debug.h"
 
 int blockEncryptECB(const blockCipher* bc, blockCipherParam* bp, uint32_t* dst, const uint32_t* src, unsigned int nblocks)
 {
index 9bc73f1..c5e4c6b 100644 (file)
  * \ingroup BC_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "blockpad.h"
 
-#include "beecrypt/blockpad.h"
+#include "debug.h"
 
 memchunk* pkcs5Pad(size_t blockbytes, memchunk* tmp)
 {
index 47eca2a..6611d13 100644 (file)
  * \ingroup BC_m BC_blowfish_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "blowfish.h"
+#include "endianness.h"
 
-#include "beecrypt/blowfish.h"
-#include "beecrypt/endianness.h"
+#include "debug.h"
 
 #ifdef ASM_BLOWFISHENCRYPTECB
 extern int blowfishEncryptECB(blowfishparam*, uint32_t*, const uint32_t*, unsigned int);
diff --git a/beecrypt/debug.h b/beecrypt/debug.h
new file mode 100644 (file)
index 0000000..19376c0
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * To be included after all other includes.
+ */
+#ifndef        H_DEBUG
+#define        H_DEBUG
+
+#include <assert.h>
+
+#ifdef DMALLOC
+#include <dmalloc.h>
+#endif
+
+#endif /* H_DEBUG */
index 994cd6f..1c84f6b 100644 (file)
  * \ingroup DL_m DL_dh_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "dhaes.h"
+#include "dlsvdp-dh.h"
+#include "blockmode.h"
+#include "blockpad.h"
 
-#include "beecrypt/dhaes.h"
-#include "beecrypt/dlsvdp-dh.h"
-#include "beecrypt/blockmode.h"
-#include "beecrypt/blockpad.h"
+#include "debug.h"
 
 /*
  * Good combinations will be:
index 51f32e6..e32e346 100644 (file)
  * \ingroup DL_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "dldp.h"
+#include "mp.h"
+#include "mpprime.h"
 
-#include "beecrypt/dldp.h"
-#include "beecrypt/mp.h"
-#include "beecrypt/mpprime.h"
+#include "debug.h"
 
 /*!\addtogroup DL_m
  * \{
index 65dc185..6ff3102 100644 (file)
  * \ingroup DL_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "dlkp.h"
 
-#include "beecrypt/dlkp.h"
+#include "debug.h"
 
 int dlkp_pPair(dlkp_p* kp, randomGeneratorContext* rgc, const dldp_p* param)
 {
index 02dc622..2efc83a 100644 (file)
  * \ingroup DL_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "dlpk.h"
 
-#include "beecrypt/dlpk.h"
+#include "debug.h"
 
 /*!\addtogroup DL_m
  * \{
index 9f1cb68..5f56364 100644 (file)
  * \ingroup DL_m DL_dh_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "dlsvdp-dh.h"
 
-#include "beecrypt/dlsvdp-dh.h"
+#include "debug.h"
 
 /*!\addtogroup DL_dh_m
  * \{
index 291392f..4772a27 100644 (file)
  * \ingroup DL_m DL_dsa_m
  */
  
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "dsa.h"
+#include "dldp.h"
 
-#include "beecrypt/dsa.h"
-#include "beecrypt/dldp.h"
+#include "debug.h"
 
 int dsasign(const mpbarrett* p, const mpbarrett* q, const mpnumber* g, randomGeneratorContext* rgc, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s)
 {
index 73d824e..d9ddf42 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "elgamal.h"
+#include "dldp.h"
 
-#include "beecrypt/elgamal.h"
-#include "beecrypt/dldp.h"
+#include "debug.h"
 
 int elgv1sign(const mpbarrett* p, const mpbarrett* n, const mpnumber* g, randomGeneratorContext* rgc, const mpnumber* hm, const mpnumber* x, mpnumber* r, mpnumber* s)
 {
index 750403d..bd1342b 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "endianness.h"
 
-#include "beecrypt/endianness.h"
+#include "debug.h"
 
 int16_t swap16(int16_t n)
 {
index 958c8c4..9e972e6 100644 (file)
  * \ingroup ES_m ES_audio_m ES_dsp_m ES_random_m ES_urandom_m ES_tty_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "beecrypt/entropy.h"
-#include "beecrypt/endianness.h"
+#include "entropy.h"
+#include "endianness.h"
 
 #if WIN32
 # include <mmsystem.h>
 # if HAVE_SYS_IOCTL_H
 #  include <sys/ioctl.h>
 # endif
-# if HAVE_SYS_STAT_H
-#  include <sys/types.h>
-#  include <sys/stat.h>
-# endif
-# if TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-# else
-#  if HAVE_SYS_TIME_H
-#   include <sys/time.h>
-#  elif HAVE_TIME_H
-#   include <time.h>
-#  endif
-# endif
 # if HAVE_SYS_AUDIOIO_H
 #   include <sys/audioio.h>
 # endif
 #  include <aio.h>
 # endif
 #endif
-#if HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-#if HAVE_ERRNO_H
-# include <errno.h>
-#endif
+
+#include "debug.h"
 
 #if WIN32
 static HINSTANCE       entropy_instance = (HINSTANCE) 0;
index 0fc1385..d5e244c 100644 (file)
  * \ingroup PRNG_m PRNG_fips186_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "fips186.h"
 
-#include "beecrypt/fips186.h"
+#include "debug.h"
 
 /*!\addtogroup PRNG_fips186_m
  * \{
index c28770a..7d47231 100644 (file)
  * \ingroup HMAC_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "hmac.h"
+#include "endianness.h"
 
-#include "beecrypt/hmac.h"
-#include "beecrypt/endianness.h"
+#include "debug.h"
 
 /*!\addtogroup HMAC_m
  * \{
index 8977ef4..33de1b5 100644 (file)
  * \ingroup HMAC_m HMAC_md5_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "hmacmd5.h"
 
-#include "beecrypt/hmacmd5.h"
+#include "debug.h"
 
 /*!\addtogroup HMAC_md5_m
  * \{
index f201a45..031d708 100644 (file)
  * \ingroup HMAC_m HMAC_sha1_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "hmacsha1.h"
 
-#include "beecrypt/hmacsha1.h"
+#include "debug.h"
 
 /*!\addtogroup HMAC_sha1_m
  * \{
index c20b95c..5bf2da7 100644 (file)
  * \ingroup HMAC_m HMAC_sha256_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "hmacsha256.h"
 
-#include "beecrypt/hmacsha256.h"
+#include "debug.h"
 
 /*!\addtogroup HMAC_sha256_m
  * \{
index 316550e..0a2a31c 100644 (file)
@@ -1,25 +1,16 @@
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/blockmode.h"
-#include "beecrypt/mpnumber.h"
-#include "beecrypt/mpbarrett.h"
+#include "beecrypt.h"
+#include "blockmode.h"
+#include "mpnumber.h"
+#include "mpbarrett.h"
 
 #if JAVAGLUE
 
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#if HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
 #include "javaglue.h"
 
+#include "debug.h"
+
 static const char* JAVA_OUT_OF_MEMORY_ERROR = "java/lang/OutOfMemoryError";
 static const char* JAVA_PROVIDER_EXCEPTION = "java/security/ProviderException";
 static const char* JAVA_INVALID_KEY_EXCEPTION = "java/security/InvalidKeyException";
index dd76607..7159c1a 100644 (file)
  * \ingroup HASH_m HASH_md5_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "md5.h"
+#include "endianness.h"
 
-#include "beecrypt/md5.h"
-#include "beecrypt/endianness.h"
+#include "debug.h"
 
 /*!\addtogroup HASH_md5_m
  * \{
index c182957..325c1ca 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "memchunk.h"
 
-#include "beecrypt/memchunk.h"
+#include "debug.h"
 
 memchunk* memchunkAlloc(size_t size)
 {
index 82d272c..6ae4e88 100644 (file)
  * \ingroup MP_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "mp.h"
+#include "mpopt.h"
 
-#include "beecrypt/mp.h"
-#include "beecrypt/mpopt.h"
+#include "debug.h"
 
 #ifndef ASM_MPZERO
 void mpzero(size_t size, mpw* data)
index 6a92b23..90668a0 100644 (file)
  * \ingroup MP__m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "beecrypt.h"
+#include "mpprime.h"
+#include "mpnumber.h"
+#include "mpbarrett.h"
 
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/mpprime.h"
-#include "beecrypt/mpnumber.h"
-#include "beecrypt/mpbarrett.h"
+#include "debug.h"
 
 /*
  * mpbzero
index 94c0378..e35bf3c 100644 (file)
  * \ingroup MP_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "mpnumber.h"
 
-#include "beecrypt/mpnumber.h"
+#include "debug.h"
 
 void mpnzero(mpnumber* n)
 {
index c21287a..3a31727 100644 (file)
  * \ingroup MP_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "mpprime.h"
 
-#include "beecrypt/mpprime.h"
+#include "debug.h"
 
 /*
  * A word of explanation here on what this table accomplishes:
index 2f4c0a8..d5fc06c 100644 (file)
  * \ingroup PRNG_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "mtprng.h"
 
-#include "beecrypt/mtprng.h"
+#include "debug.h"
 
 #define hiBit(a)               ((a) & 0x80000000U)
 #define loBit(a)               ((a) & 0x1U)
index d680425..40900b5 100644 (file)
@@ -1,6 +1,8 @@
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#include "beecrypt/pkcs1.h"
+#include "pkcs1.h"
+
+#include "debug.h"
 
 const byte EMSA_MD5_DIGESTINFO[18] = {
        0x30,0x20,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,
index b11fe1c..95a0cc9 100644 (file)
@@ -1,6 +1,8 @@
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#include "beecrypt/pkcs12.h"
+#include "pkcs12.h"
+
+#include "debug.h"
 
 int pkcs12_derive_key(const hashFunction* h, byte id, const byte* pdata, size_t psize, const byte* sdata, size_t ssize, size_t iterationcount, byte* ndata, size_t nsize)
 {
index d0aadb7..2074d1c 100644 (file)
@@ -3,7 +3,7 @@
  */
 
 #define        _REENTRANT      1       /* XXX config.h collides with pyconfig.h */
-#include "config.h"
+#include "system.h"
 
 #include "Python.h"
 #ifdef __LCLINT__
 #define PyObject_HEAD   int _PyObjectHead;
 #endif
 
-#include "beecrypt/python/mpw-py.h"
-#include "beecrypt/python/rng-py.h"
+#include "mpw-py.h"
+#include "rng-py.h"
+
+#include "debug.h"
 
 #ifdef __LCLINT__
 #undef PyObject_HEAD
index ce2f8e6..62c322b 100644 (file)
@@ -6,8 +6,10 @@ extern PyTypeObject PyDictIter_Type;
 /*@unchecked@*/
 extern PyTypeObject PyFrame_Type;
 
-#include "beecrypt/python/mpw-py.h"    /* XXX debug only */
-#include "beecrypt/python/rng-py.h"    /* XXX debug only */
+#include "mpw-py.h"    /* XXX debug only */
+#include "rng-py.h"    /* XXX debug only */
+
+#include "debug.h"
 
 /**
  */
index ec2443c..998fbcb 100644 (file)
@@ -4,7 +4,8 @@
 
 #define        _REENTRANT      1       /* XXX config.h collides with pyconfig.h */
 #define        _GNU_SOURCE             /* XXX pick up stpcpy et al */
-#include "config.h"
+
+#include "system.h"
 
 #include "Python.h"
 #include "longintrepr.h"
 #define PyObject_HEAD   int _PyObjectHead;
 #endif
 
-#include "beecrypt/python/mpw-py.h"
-#include "beecrypt/python/rng-py.h"
+#include "mpw-py.h"
+#include "rng-py.h"
 
 #include "debug-py.c"
 
+#include "debug.h"
+
 #define ABS(_x)                ((_x) < 0 ? -(_x) : (_x))
 #if !defined(MAX)
 #define MAX(x, y) ((x) < (y) ? (y) : (x))
index 6252ede..1b46516 100644 (file)
@@ -3,7 +3,8 @@
  */
 
 #define        _REENTRANT      1       /* XXX config.h collides with pyconfig.h */
-#include "config.h"
+
+#include "system.h"
 
 #include "Python.h"
 #ifdef __LCLINT__
 #define PyObject_HEAD   int _PyObjectHead;
 #endif
 
-#include "beecrypt/python/rng-py.h"
+#include "rng-py.h"
 
 #include "debug-py.c"
 
+#include "debug.h"
+
 /*@unchecked@*/
 static int _rng_debug = 0;
 
index 9674be1..bcf64fc 100644 (file)
  * \ingroup IF_m IF_rsa_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "rsa.h"
 
-#include "beecrypt/rsa.h"
+#include "debug.h"
 
 int rsapub(const mpbarrett* n, const mpnumber* e,
            const mpnumber* m, mpnumber* c)
index a00fac3..a752c4a 100644 (file)
  * \ingroup IF_m IF_rsa_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "rsakp.h"
+#include "mpprime.h"
 
-#include "beecrypt/rsakp.h"
-#include "beecrypt/mpprime.h"
+#include "debug.h"
 
 /*!\addtogroup IF_rsa_m
  * \{
index 570db18..922e06e 100644 (file)
  * \ingroup IF_m IF_rsa_m
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "rsapk.h"
 
-#include "beecrypt/rsapk.h"
+#include "debug.h"
 
 /*!\addtogroup IF_rsa_m
  * \{
index a0265fd..2659468 100644 (file)
  * \ingroup HASH_m HASH_sha1_m
  */
  
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "sha1.h"
+#include "endianness.h"
 
-#include "beecrypt/sha1.h"
-#include "beecrypt/endianness.h"
+#include "debug.h"
 
 /*!\addtogroup HASH_sha1_m
  * \{
index a3ee355..55aa614 100644 (file)
  * \ingroup HASH_m HASH_sha256_m
  */
  
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "sha256.h"
+#include "endianness.h"
 
-#include "beecrypt/sha256.h"
-#include "beecrypt/endianness.h"
+#include "debug.h"
 
 /*!\addtogroup HASH_sha256_m
  * \{
diff --git a/beecrypt/system.h b/beecrypt/system.h
new file mode 100644 (file)
index 0000000..6255796
--- /dev/null
@@ -0,0 +1,89 @@
+/**
+ * \file beecrypt/system.h
+ */
+
+#ifndef        H_SYSTEM
+#define        H_SYSTEM
+
+#define BEECRYPT_DLL_EXPORT
+
+#if defined(_WIN32) && !defined(WIN32)
+# define WIN32 1
+#endif
+
+#if WIN32 && !__CYGWIN32__
+# include "win.h"
+#else
+# ifdef HAVE_CONFIG_H
+#  include "config.h"
+# endif
+#endif
+
+#if defined(__LCLINT__)
+/* XXX from /usr/include/bits/sigset.h in glibc-2.2.4 */
+/*@-sizeoftype@*/
+# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
+/*@-redef@*/
+typedef struct
+  {
+    unsigned long int __val[_SIGSET_NWORDS];
+  } __sigset_t;
+/*@=redef@*/
+/*@=sizeoftype@*/
+#endif
+
+#include "gnu.h"
+
+#if HAVE_SYS_STAT_H
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+#if HAVE_TIME_H
+# include <time.h>
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+#if HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#else
+# include <sys/file.h>
+#endif
+
+#if HAVE_CTYPE_H
+# include <ctype.h>
+#endif
+
+#if HAVE_MALLOC_H && !defined(__LCLINT__)
+# include <malloc.h>
+#endif
+
+#endif /* H_SYSTEM */
index f0191e1..9554831 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
+#include "system.h"
+
 #include "beecrypt.h"
 #include "timestamp.h"
 
-#include <stdio.h>
+#include "debug.h"
 
 #define SECONDS        10
 
index 8a3fb76..29adcc2 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
+#include "system.h"
+
 #include "beecrypt.h"
 #include "timestamp.h"
 
-#include <stdio.h>
+#include "debug.h"
 
 #define SECONDS        10
 
index b32ed0c..4439c49 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
+#include "system.h"
+
 #include "beecrypt.h"
 #include "dldp.h"
 #include "timestamp.h"
 
-#include <stdio.h>
+#include "debug.h"
 
 #define SECONDS        10
 
index 04b706b..303095a 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "aes.h"
 
+#include "debug.h"
+
 extern int fromhex(byte*, const char*);
 
 struct vector
index f5bc73d..bd2fa41 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "blowfish.h"
 
+#include "debug.h"
+
 extern int fromhex(byte*, const char*);
 
 struct vector
index c8f8914..9f806ef 100644 (file)
@@ -1,5 +1,9 @@
+#include "system.h"
+
 #include "mp.h"
 
+#include "debug.h"
+
 void hexdump(byte* b, int count)
 {
        int i;
index 1fce545..027956f 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "beecrypt.h"
 #include "dldp.h"
 
+#include "debug.h"
+
 int main()
 {
        int failures = 0;
index b8f9045..7834d42 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "beecrypt.h"
 #include "dlkp.h"
 #include "dsa.h"
 
+#include "debug.h"
+
 struct vector
 {
        const char* p;
index 3b2d0a0..1db1a97 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "hmacmd5.h"
 
+#include "debug.h"
+
 struct vector
 {
        int             keybits;
index 93d80b5..fe8e84d 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "hmacsha1.h"
 
+#include "debug.h"
+
 struct vector
 {
        int             keybits;
index 1fe29d8..5137912 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "md5.h"
 
+#include "debug.h"
+
 struct vector
 {
        int             input_size;
index a4d1d82..0a6bb52 100644 (file)
@@ -1,8 +1,10 @@
-#include <stdio.h>
+#include "system.h"
 
 #include "beecrypt.h"
 #include "mp.h"
 
+#include "debug.h"
+
 #define INIT   0xdeadbeefU;
 
 static const mpw Z[4] = { 0U, 0U, 0U, 0U };
index f1c10af..5389333 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "beecrypt.h"
 #include "mpnumber.h"
 
+#include "debug.h"
+
 struct vector
 {
        const char* m;
index c5e756f..63a436f 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "beecrypt.h"
 #include "rsa.h"
 
+#include "debug.h"
+
 static const char* rsa_n  = "bbf82f090682ce9c2338ac2b9da871f7368d07eed41043a440d6b6f07454f51fb8dfbaaf035c02ab61ea48ceeb6fcd4876ed520d60e1ec4619719d8a5b8b807fafb8e0a3dfc737723ee6b4b7d93a2584ee6a649d060953748834b2454598394ee0aab12d7b61a51f527a9a41f6c1687fe2537298ca2a8f5946f8e5fd091dbdcb";
 static const char* rsa_e  = "11";
 static const char* rsa_p  = "eecfae81b1b9b3c908810b10a1b5600199eb9f44aef4fda493b81a9e3d84f632124ef0236e5d1e3b7e28fae7aa040a2d5b252176459d1f397541ba2a58fb6599";
index d65e7eb..33c1f60 100644 (file)
  * \ingroup UNIT_m
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "sha1.h"
 #include "memchunk.h"
 
+#include "debug.h"
+
 struct vector
 {
        int input_size;
index da3670d..1b60959 100644 (file)
  *
  */
 
-#include <stdio.h>
+#include "system.h"
 
 #include "sha256.h"
 
+#include "debug.h"
+
 struct vector
 {
        int             input_size;
index 4fe5ac9..8754744 100644 (file)
  *
  */
 
+#include "system.h"
+
 #include "beecrypt.h"
 
-#include <string.h>
+#include "debug.h"
 
 int fromhex(byte* data, const char* hexdata)
 {
index 093e221..258922b 100644 (file)
  * \author Bob Deblier <bob.deblier@pandora.be>
  */
 
-#define BEECRYPT_DLL_EXPORT
+#include "system.h"
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "timestamp.h"
 
-#include "beecrypt/timestamp.h"
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# elif HAVE_TIME_H
-#  include <time.h>
-# endif
-#endif
+#include "debug.h"
 
 javalong timestamp()
 {