Add python/system.h to insure python included before any glibc includes.
CVS patchset: 7377
CVS date: 2004/08/02 03:30:10
#include "system.h"
+#include "beecrypt.h"
+#include "aesopt.h"
#include "aes.h"
+#include "mp.h"
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
# if (BYTE_ORDER != BIG_ENDIAN) && (BYTE_ORDER != LITTLE_ENDIAN)
#ifndef _AES_H
#define _AES_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/aesopt.h"
+#include "beecrypt.h"
+#include "aesopt.h"
/*!\brief Holds all the parameters necessary for the AES cipher.
* \ingroup BC_aes_m
#ifndef _AESOPT_H
#define _AESOPT_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/aes.h"
+#include "beecrypt.h"
+#include "aes.h"
#ifdef __cplusplus
extern "C" {
#ifndef _BASE64_H
#define _BASE64_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
/*!\
* Decode white space character set (default).
#include "beecrypt.h"
#include "entropy.h"
-
#include "fips186.h"
-#include "mtprng.h"
-
-#include "md5.h"
-#include "sha1.h"
-#include "sha256.h"
-
#include "hmacmd5.h"
#include "hmacsha1.h"
#include "hmacsha256.h"
+#include "md5.h"
+#include "mp.h"
+#include "mtprng.h"
+#include "sha1.h"
+#include "sha256.h"
#include "aes.h"
#include "blowfish.h"
#ifndef _BEECRYPT_H
#define _BEECRYPT_H
-#include "beecrypt/api.h"
-
-#include "beecrypt/memchunk.h"
-#include "beecrypt/mpnumber.h"
+#include "api.h"
+
+#include "memchunk.h"
+#include "mpnumber.h"
+#include "mp.h"
/*
* Entropy Sources
+++ /dev/null
-/*
- * Copyright (c) 2000, 2001, 2002 Virtual Unlimited B.V.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * 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,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*!\file beecrypt.win.h
- * \brief BeeCrypt API, windows headers.
- * \author Bob Deblier <bob.deblier@pandora.be>
- */
-
-#ifndef _BEECRYPT_WIN_H
-#define _BEECRYPT_WIN_H
-
-#define _REENTRANT
-
-#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x0400
-#endif
-
-#include <windows.h>
-
-#if __MWERKS__
-# if __INTEL__
-# define WORDS_BIGENDIAN 0
-# else
-# error Unknown CPU type in MetroWerks CodeWarrior
-# endif
-#elif defined(_MSC_VER)
-# if defined(_M_IX86)
-# define WORDS_BIGENDIAN 0
-# define ROTL32(x, s) _rotl(x, s)
-# define ROTR32(x, s) _rotr(x, s)
-# else
-# error Unknown CPU type in Microsoft Visual C
-# endif
-#else
-# error Unknown compiler for WIN32
-#endif
-
-#if defined(_MSC_VER) || __MWERKS__
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define HAVE_ERRNO_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_FCNTL_H 1
-#define HAVE_TIME_H 1
-
-#define HAVE_SYS_TYPES_H 0
-#define HAVE_SYS_TIME_H 0
-
-#define HAVE_THREAD_H 0
-#define HAVE_SYNCH_H 0
-#define HAVE_PTHREAD_H 0
-#define HAVE_SEMAPHORE_H 0
-
-#define HAVE_TERMIO_H 0
-#define HAVE_SYS_AUDIOIO_H 0
-#define HAVE_SYS_IOCTL_H 0
-#define HAVE_SYS_SOUNDCARD_H 0
-
-#define HAVE_GETTIMEOFDAY 0
-#define HAVE_GETHRTIME 0
-
-#define HAVE_DEV_TTY 0
-#define HAVE_DEV_AUDIO 0
-#define HAVE_DEV_DSP 0
-#define HAVE_DEV_RANDOM 0
-#define HAVE_DEV_URANDOM 0
-#define HAVE_DEV_TTY 0
-
-#else
-#error Not set up for this compiler
-#endif
-
-#if __MWERKS__
-#define HAVE_SYS_STAT_H 0
-
-#define HAVE_LONG_LONG 1
-#define HAVE_UNSIGNED_LONG_LONG 1
-
-#define HAVE_64_BIT_INT 1
-#define HAVE_64_BIT_UINT 1
-
-typedef char int8_t;
-typedef short int16_t;
-typedef long int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
-typedef unsigned long long uint64_t;
-
-#elif defined(_MSC_VER)
-#define HAVE_SYS_STAT_H 1
-
-#define HAVE_LONG_LONG 0
-#define HAVE_UNSIGNED_LONG_LONG 0
-
-#define HAVE_64_BIT_INT 1
-#define HAVE_64_BIT_UINT 1
-
-typedef __int8 int8_t;
-typedef __int16 int16_t;
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-
-#endif
-
-#define MP_WBITS 32U
-
-#endif
#include "system.h"
#include "blockmode.h"
+#include "mp.h"
#include "debug.h"
#ifndef _BLOCKMODE_H
#define _BLOCKMODE_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#ifdef __cplusplus
extern "C" {
#ifndef _BLOCKPAD_H
#define _BLOCKPAD_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#ifdef __cplusplus
extern "C" {
#include "system.h"
+#include "beecrypt.h"
+#include "blowfishopt.h"
#include "blowfish.h"
#include "endianness.h"
#ifndef _BLOWFISH_H
#define _BLOWFISH_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/blowfishopt.h"
+#include "beecrypt.h"
+#include "blowfishopt.h"
#define BLOWFISHROUNDS 16
#define BLOWFISHPSIZE (BLOWFISHROUNDS+2)
#ifndef _BLOWFISHOPT_H
#define _BLOWFISHOPT_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/blowfish.h"
+#include "beecrypt.h"
+#include "blowfish.h"
#ifdef __cplusplus
extern "C" {
#ifndef _DHAES_H
#define _DHAES_H
-
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/dldp.h"
+#include "beecrypt.h"
+#include "dldp.h"
+
typedef struct
{
const dldp_p* param;
#ifndef _DLDP_H
#define _DLDP_H
-#include "beecrypt/mpbarrett.h"
+#include "mpbarrett.h"
/*
* Discrete Logarithm Domain Parameters - Prime
#ifndef _DLKP_H
#define _DLKP_H
-#include "beecrypt/dlpk.h"
+#include "dlpk.h"
/*!\ingroup DL_m
*/
#include "system.h"
#include "dlpk.h"
+#include "mp.h"
#include "debug.h"
#ifndef _DLPK_H
#define _DLPK_H
-#include "beecrypt/dldp.h"
+#include "dldp.h"
/*!\ingroup DL_m
*/
#ifndef _DLSVDP_DH_H
#define _DLSVDP_DH_H
-#include "beecrypt/dldp.h"
-#include "beecrypt/dlkp.h"
+#include "dldp.h"
+#include "dlkp.h"
#ifdef __cplusplus
extern "C" {
#include "dsa.h"
#include "dldp.h"
+#include "mp.h"
#include "debug.h"
#ifndef _DSA_H
#define _DSA_H
-#include "beecrypt/dlkp.h"
+#include "dlkp.h"
typedef dldp_p dsaparam;
typedef dlpk_p dsapub;
#include "elgamal.h"
#include "dldp.h"
+#include "mp.h"
#include "debug.h"
#ifndef _ELGAMAL_H
#define _ELGAMAL_H
-#include "beecrypt/mpbarrett.h"
+#include "mpbarrett.h"
#ifdef __cplusplus
extern "C" {
#ifndef _ENDIANNESS_H
#define _ENDIANNESS_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#ifdef __cplusplus
inline int16_t swap16(int16_t n)
#ifndef _ENTROPY_H
#define _ENTROPY_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#if WIN32
#include <Windows.h>
#include "system.h"
+#include "beecrypt.h"
#include "fips186.h"
+#include "mpopt.h"
+#include "mp.h"
#include "debug.h"
#ifndef _FIPS186_H
#define _FIPS186_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
+#include "sha1.h"
#ifdef _REENTRANT
# if WIN32
# endif
#endif
-#include "beecrypt.h"
-#include "sha1.h"
-
#if (MP_WBITS == 64)
# define FIPS186_STATE_SIZE 8
#elif (MP_WBITS == 32)
#include "system.h"
#include "hmac.h"
+#include "mp.h"
#include "endianness.h"
#include "debug.h"
#ifndef _HMAC_H
#define _HMAC_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
/*!\ingroup HMAC_m
*/
#ifndef _HMACMD5_H
#define _HMACMD5_H
-#include "beecrypt/hmac.h"
-#include "beecrypt/md5.h"
+#include "hmac.h"
+#include "md5.h"
/*!\ingroup HMAC_md5_m
*/
#ifndef _HMACSHA1_H
#define _HMACSHA1_H
-#include "beecrypt/hmac.h"
-#include "beecrypt/sha1.h"
+#include "hmac.h"
+#include "sha1.h"
/*!\ingroup HMAC_sha1_m
*/
#ifndef _HMACSHA256_H
#define _HMACSHA256_H
-#include "beecrypt/hmac.h"
-#include "beecrypt/sha256.h"
+#include "hmac.h"
+#include "sha256.h"
/*!\ingroup HMAC_sha256_m
*/
#include "system.h"
#include "md5.h"
+#include "mp.h"
#include "endianness.h"
#include "debug.h"
#ifndef _MD5_H
#define _MD5_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
/*!\brief Holds all the parameters necessary for the MD5 algorithm.
* \ingroup HASH_md5_h
#ifndef _MEMCHUNK_H
#define _MEMCHUNK_H
-#include "beecrypt/api.h"
+#include "api.h"
typedef struct
{
#include "system.h"
-#include "mp.h"
+#include "beecrypt.h"
#include "mpopt.h"
+#include "mp.h"
#include "debug.h"
#ifndef _MP_H
#define _MP_H
-#include "beecrypt/api.h"
-#include "beecrypt/mpopt.h"
+#include "api.h"
+#include "mpopt.h"
#define MP_HWBITS (MP_WBITS >> 1)
#define MP_WBYTES (MP_WBITS >> 3)
#include "system.h"
#include "beecrypt.h"
+#include "mp.h"
#include "mpprime.h"
#include "mpnumber.h"
#include "mpbarrett.h"
#ifndef _MPBARRETT_H
#define _MPBARRETT_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/mpnumber.h"
+#include "beecrypt.h"
+#include "mpnumber.h"
#ifdef __cplusplus
# include <iostream>
#include "system.h"
#include "mpnumber.h"
+#include "mp.h"
#include "debug.h"
#ifndef _MPNUMBER_H
#define _MPNUMBER_H
-#include "beecrypt/mp.h"
+#include "mp.h"
#ifdef __cplusplus
# include <iostream>
#include "system.h"
#include "mpprime.h"
+#include "mp.h"
+#include "mpbarrett.h"
#include "debug.h"
#ifndef _MPPRIME_H
#define _MPPRIME_H
-#include "beecrypt/mpbarrett.h"
+#include "mpbarrett.h"
#define SMALL_PRIMES_PRODUCT_MAX 32
#include "system.h"
+#include "beecrypt.h"
#include "mtprng.h"
+#include "mpopt.h"
+#include "mp.h"
#include "debug.h"
#ifndef _MTPRNG_H
#define _MTPRNG_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#ifdef _REENTRANT
# if WIN32
#ifndef _PKCS1_H
#define _PKCS1_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#ifdef __cplusplus
extern "C" {
#ifndef _PKCS12_H
#define _PKCS12_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#ifdef __cplusplus
extern "C" {
#define _REENTRANT 1 /* XXX config.h collides with pyconfig.h */
#include "system.h"
-#include "Python.h"
-#ifdef __LCLINT__
-#undef PyObject_HEAD
-#define PyObject_HEAD int _PyObjectHead;
-#endif
-
#include "mpw-py.h"
#include "rng-py.h"
#include "debug.h"
-#ifdef __LCLINT__
-#undef PyObject_HEAD
-#define PyObject_HEAD int _PyObjectHead
-#endif
-
/**
*/
PyObject * py_bcError;
*/
#define _REENTRANT 1 /* XXX config.h collides with pyconfig.h */
-#define _GNU_SOURCE /* XXX pick up stpcpy et al */
#include "system.h"
-#include "Python.h"
#include "longintrepr.h"
-#ifdef __LCLINT__
-#undef PyObject_HEAD
-#define PyObject_HEAD int _PyObjectHead;
-#endif
-
#include "mpw-py.h"
#include "rng-py.h"
0, /* tp_init */
0, /* tp_alloc */
(newfunc) mpw_new, /* tp_new */
- (destructor) mpw_free, /* tp_free */
+ mpw_free, /* tp_free */
0, /* tp_is_gc */
};
/*@=fullinitblock@*/
/** \ingroup py_c
* \file python/mpw-py.h
*/
-#include "beecrypt/mp.h"
+#include "mp.h"
/**
*/
#include "system.h"
-#include "Python.h"
-#ifdef __LCLINT__
-#undef PyObject_HEAD
-#define PyObject_HEAD int _PyObjectHead;
-#endif
-
#include "rng-py.h"
#include "debug-py.c"
(initproc) rng_init, /* tp_init */
(allocfunc) rng_alloc, /* tp_alloc */
(newfunc) rng_new, /* tp_new */
- (destructor) rng_free, /* tp_free */
+ rng_free, /* tp_free */
0, /* tp_is_gc */
#endif
};
/** \ingroup py_c
* \file python/rng-py.h
*/
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/mpprime.h"
+#include "beecrypt.h"
+#include "mpprime.h"
/**
*/
--- /dev/null
+/** \ingroup py_c
+ * \file python/system.h
+ */
+
+#ifndef H_SYSTEM_PYTHON
+#define H_SYSTEM_PYTHON
+
+#include "Python.h"
+
+#ifdef __LCLINT__
+#undef PyObject_HEAD
+#define PyObject_HEAD int _PyObjectHead;
+#endif
+
+#include "../system.h"
+
+#endif /* H_SYSTEM_PYTHON */
#include "system.h"
#include "rsa.h"
+#include "mp.h"
#include "debug.h"
#ifndef _RSA_H
#define _RSA_H
-#include "beecrypt/rsakp.h"
+#include "rsakp.h"
#ifdef __cplusplus
extern "C" {
#include "rsakp.h"
#include "mpprime.h"
+#include "mp.h"
#include "debug.h"
#ifndef _RSAKP_H
#define _RSAKP_H
-#include "beecrypt/rsapk.h"
+#include "rsapk.h"
/*!\brief RSA keypair.
* \ingroup IF_rsa_m
#ifndef _RSAPK_H
#define _RSAPK_H
-#include "beecrypt/mpbarrett.h"
+#include "mpbarrett.h"
#ifdef __cplusplus
struct BEECRYPTAPI rsapk
#include "system.h"
+#include "beecrypt.h"
+#include "sha1opt.h"
#include "sha1.h"
+#include "mp.h"
#include "endianness.h"
#include "debug.h"
#ifndef _SHA1_H
#define _SHA1_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/sha1opt.h"
+#include "beecrypt.h"
+#include "sha1opt.h"
/*!\brief Holds all the parameters necessary for the SHA-1 algorithm.
* \ingroup HASH_sha1_m
#ifndef _SHA1OPT_H
#define _SHA1OPT_H
-#include "beecrypt/beecrypt.h"
-#include "beecrypt/sha1.h"
+#include "beecrypt.h"
+#include "sha1.h"
#ifdef __cplusplus
extern "C" {
#include "system.h"
#include "sha256.h"
+#include "mp.h"
#include "endianness.h"
#include "debug.h"
#ifndef _SHA256_H
#define _SHA256_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
/*!\brief Holds all the parameters necessary for the SHA-256 algorithm.
* \ingroup HASH_sha256_m
#ifndef _TIMESTAMP_H
#define _TIMESTAMP_H
-#include "beecrypt/beecrypt.h"
+#include "beecrypt.h"
#if HAVE_LONG_LONG
# define ONE_SECOND 1000LL