Commit c5c15385 authored by Niels Möller's avatar Niels Möller

* Reordered includes in most or all .c-files. All should now include

config.h.

Rev: src/nettle/ChangeLog:1.195
Rev: src/nettle/aes-decrypt-table.c:1.4
Rev: src/nettle/aes-decrypt.c:1.5
Rev: src/nettle/aes-encrypt-table.c:1.4
Rev: src/nettle/aes-encrypt.c:1.5
Rev: src/nettle/aes-meta.c:1.3
Rev: src/nettle/aes-set-decrypt-key.c:1.2
Rev: src/nettle/aes-set-encrypt-key.c:1.2
Rev: src/nettle/aes.c:1.12
Rev: src/nettle/aesdata.c:1.2
Rev: src/nettle/arcfour-meta.c:1.2
Rev: src/nettle/arcfour.c:1.3
Rev: src/nettle/base16-decode.c:1.2
Rev: src/nettle/base16-encode.c:1.2
Rev: src/nettle/base16-meta.c:1.3
Rev: src/nettle/base64-decode.c:1.5
Rev: src/nettle/base64-encode.c:1.3
Rev: src/nettle/base64-meta.c:1.4
Rev: src/nettle/bignum-random.c:1.3
Rev: src/nettle/bignum.c:1.7
Rev: src/nettle/blowfish.c:1.4
Rev: src/nettle/buffer-init.c:1.3
Rev: src/nettle/buffer.c:1.8
Rev: src/nettle/cast128-meta.c:1.3
Rev: src/nettle/cast128.c:1.4
Rev: src/nettle/cbc.c:1.6
Rev: src/nettle/des-compat.c:1.10
Rev: src/nettle/des.c:1.7
Rev: src/nettle/des3.c:1.2
Rev: src/nettle/dsa-keygen.c:1.6
Rev: src/nettle/dsa-sign.c:1.7
Rev: src/nettle/dsa-verify.c:1.4
Rev: src/nettle/dsa.c:1.5
Rev: src/nettle/examples/io.c:1.4
Rev: src/nettle/examples/nettle-benchmark.c:1.8
Rev: src/nettle/examples/nettle-openssl.c:1.2
Rev: src/nettle/examples/rsa-keygen.c:1.10
Rev: src/nettle/examples/rsa-sign.c:1.5
Rev: src/nettle/examples/rsa-verify.c:1.4
Rev: src/nettle/hmac-md5.c:1.5
Rev: src/nettle/hmac-sha1.c:1.2
Rev: src/nettle/hmac-sha256.c:1.2
Rev: src/nettle/hmac.c:1.4
Rev: src/nettle/knuth-lfib.c:1.2
Rev: src/nettle/md5-compat.c:1.3
Rev: src/nettle/md5-meta.c:1.2
Rev: src/nettle/md5.c:1.6
Rev: src/nettle/memxor.c:1.2
Rev: src/nettle/nettle-internal.c:1.3
Rev: src/nettle/pgp-encode.c:1.4
Rev: src/nettle/pkcs1-rsa-md5.c:1.2
Rev: src/nettle/pkcs1-rsa-sha1.c:1.2
Rev: src/nettle/pkcs1.c:1.2
Rev: src/nettle/realloc.c:1.3
Rev: src/nettle/rsa-compat.c:1.8
Rev: src/nettle/rsa-decrypt.c:1.4
Rev: src/nettle/rsa-encrypt.c:1.5
Rev: src/nettle/rsa-keygen.c:1.5
Rev: src/nettle/rsa-md5-sign.c:1.2
Rev: src/nettle/rsa-md5-verify.c:1.2
Rev: src/nettle/rsa-sha1-sign.c:1.2
Rev: src/nettle/rsa-sha1-verify.c:1.2
Rev: src/nettle/rsa-sign.c:1.3
Rev: src/nettle/rsa-verify.c:1.2
Rev: src/nettle/rsa.c:1.12
Rev: src/nettle/rsa2openpgp.c:1.2
Rev: src/nettle/rsa2sexp.c:1.7
Rev: src/nettle/serpent-meta.c:1.2
Rev: src/nettle/serpent.c:1.4
Rev: src/nettle/sexp-format.c:1.9
Rev: src/nettle/sexp-transport-format.c:1.2
Rev: src/nettle/sexp-transport.c:1.4
Rev: src/nettle/sexp.c:1.14
Rev: src/nettle/sexp2bignum.c:1.5
Rev: src/nettle/sexp2dsa.c:1.4
Rev: src/nettle/sexp2rsa.c:1.11
Rev: src/nettle/sha1-meta.c:1.2
Rev: src/nettle/sha1.c:1.8
Rev: src/nettle/sha256-meta.c:1.2
Rev: src/nettle/sha256.c:1.3
Rev: src/nettle/tools/input.c:1.2
Rev: src/nettle/tools/misc.c:1.2
Rev: src/nettle/tools/output.c:1.3
Rev: src/nettle/tools/parse.c:1.2
Rev: src/nettle/tools/sexp-conv.c:1.14
Rev: src/nettle/twofish-meta.c:1.2
Rev: src/nettle/twofish.c:1.6
Rev: src/nettle/yarrow256.c:1.17
Rev: src/nettle/yarrow_key_event.c:1.4
parent f747822a
2003-05-12 Niels Mller <nisse@cuckoo.hack.org>
* Reordered includes in most or all .c-files. All should now
include config.h.
2003-05-12 Niels Mller <niels@s3.kth.se>
* configure.ac: Use LSH_FUNC_ALLOCA.
......
......@@ -23,6 +23,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "aes-internal.h"
const struct aes_table
......
......@@ -23,10 +23,14 @@
* MA 02111-1307, USA.
*/
#include "aes-internal.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "aes-internal.h"
void
aes_decrypt(struct aes_ctx *ctx,
unsigned length, uint8_t *dst,
......
......@@ -23,6 +23,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "aes-internal.h"
/* Tables are assembled using little-endian byte order, including the
......
......@@ -23,10 +23,14 @@
* MA 02111-1307, USA.
*/
#include "aes-internal.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "aes-internal.h"
/* On my sparc, encryption is significantly slower than decryption,
* even though the *only* difference is which table is passed to _aes_crypt.
*
......
......@@ -20,6 +20,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "nettle-meta.h"
#include "aes.h"
......
......@@ -25,9 +25,13 @@
/* Originally written by Rafael R. Sevilla <dido@pacific.net.ph> */
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "aes-internal.h"
/* Tables for comoutations in the AES GF2 field. */
/* Tables for computations in the AES GF2 field. */
static const uint8_t log[0x100] =
{
0x00,0x00,0x19,0x01,0x32,0x02,0x1a,0xc6,
......
......@@ -25,10 +25,14 @@
/* Originally written by Rafael R. Sevilla <dido@pacific.net.ph> */
#include "aes-internal.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "aes-internal.h"
/* Tables for comoutations in the AES GF2 field. */
static const uint8_t log[0x100] =
{
......
......@@ -25,12 +25,16 @@
/* Originally written by Rafael R. Sevilla <dido@pacific.net.ph> */
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "aes-internal.h"
#include "macros.h"
#include <assert.h>
#ifndef AES_DEBUG
# define AES_DEBUG 0
#endif
......
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
......@@ -38,7 +42,7 @@ xtime(unsigned x)
return x;
}
/* Computes the expoenntiatiom and logarithm tables for GF_2, to the
/* Computes the exponentiatiom and logarithm tables for GF_2, to the
* base x+1 (0x03). The unit element is 1 (0x01).*/
static void
compute_log(void)
......
......@@ -20,6 +20,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "nettle-meta.h"
#include "arcfour.h"
......
......@@ -23,10 +23,14 @@
* MA 02111-1307, USA.
*/
#include "arcfour.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "arcfour.h"
#define SWAP(a,b) do { int _t = a; a = b; b = _t; } while(0)
void
......
......@@ -23,11 +23,15 @@
* MA 02111-1307, USA.
*/
#include "base16.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include "base16.h"
void
base16_decode_init(struct base16_decode_ctx *ctx)
{
......
......@@ -23,6 +23,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "base16.h"
......
......@@ -20,6 +20,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "nettle-meta.h"
#include "base16.h"
......
......@@ -22,11 +22,15 @@
* MA 02111-1307, USA.
*/
#include "base64.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include "base64.h"
#define TABLE_INVALID -1
#define TABLE_SPACE -2
#define TABLE_END -3
......
......@@ -22,11 +22,14 @@
* MA 02111-1307, USA.
*/
#include "base64.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include "base64.h"
static const uint8_t encode_table[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
......
......@@ -20,6 +20,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "nettle-meta.h"
#include "base64.h"
......
......@@ -24,15 +24,15 @@
*/
#if HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#if HAVE_LIBGMP
#include "bignum.h"
#include <stdlib.h>
#include "bignum.h"
void
nettle_mpz_random_size(mpz_t x,
void *ctx, nettle_random_func random,
......
......@@ -24,16 +24,16 @@
*/
#if HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#if HAVE_LIBGMP
#include "bignum.h"
#include <assert.h>
#include <string.h>
#include "bignum.h"
/* Two's complement negation means that -x = ~x + 1, ~x = -(x+1),
* and we use that x = ~~x = ~(-x-1).
*
......
......@@ -31,12 +31,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "blowfish.h"
#include "macros.h"
#include <assert.h>
/* Initial keysetup state */
static const struct blowfish_ctx
initial_ctx =
......
......@@ -22,11 +22,15 @@
* MA 02111-1307, USA.
*/
#include "buffer.h"
#include "realloc.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include "buffer.h"
#include "realloc.h"
/* This is in a separate file so that we don't link in realloc in
* programs that don't need it. */
......
......@@ -23,12 +23,16 @@
* MA 02111-1307, USA.
*/
#include "buffer.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "buffer.h"
int
nettle_buffer_grow(struct nettle_buffer *buffer,
unsigned length)
......
......@@ -20,6 +20,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "nettle-meta.h"
#include "cast128.h"
......
......@@ -29,13 +29,17 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "cast128.h"
#include "cast128_sboxes.h"
#include "macros.h"
#include <assert.h>
#define CAST_SMALL_KEY 10
#define CAST_SMALL_ROUNDS 12
#define CAST_FULL_ROUNDS 16
......
......@@ -23,14 +23,18 @@
* MA 02111-1307, USA.
*/
#include "cbc.h"
#include "memxor.h"
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "cbc.h"
#include "memxor.h"
void
cbc_encrypt(void *ctx, void (*f)(void *ctx,
unsigned length, uint8_t *dst,
......
......@@ -23,15 +23,19 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include <assert.h>
#include "des-compat.h"
#include "cbc.h"
#include "macros.h"
#include "memxor.h"
#include <string.h>
#include <assert.h>
struct des_compat_des3 { struct des_ctx *keys[3]; };
typedef void (*cbc_crypt_func)(void *, uint32_t, uint8_t *, const uint8_t *);
......
......@@ -30,12 +30,16 @@
* Please see the file `descore.README' for the complete copyright notice.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "des.h"
#include "desCode.h"
#include <assert.h>
static ENCRYPT(DesSmallFipsEncrypt,TEMPSMALL, LOADFIPS,KEYMAPSMALL,SAVEFIPS)
static DECRYPT(DesSmallFipsDecrypt,TEMPSMALL, LOADFIPS,KEYMAPSMALL,SAVEFIPS)
......
......@@ -23,6 +23,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "des.h"
/* It's possible to make some more general pipe construction, like the
......
......@@ -24,18 +24,18 @@
*/
#if HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#if WITH_PUBLIC_KEY
#include <stdlib.h>
#include "dsa.h"
#include "bignum.h"
#include "memxor.h"
#include <stdlib.h>
/* The (slow) NIST method of generating DSA primes. Algorithm 4.56 of
* Handbook of Applied Cryptography. */
......
......@@ -24,17 +24,17 @@
*/
#if HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#if WITH_PUBLIC_KEY
#include <stdlib.h>
#include "dsa.h"
#include "bignum.h"
#include <stdlib.h>
void
dsa_sign_digest(const struct dsa_public_key *pub,
......
......@@ -24,17 +24,17 @@
*/
#if HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#if WITH_PUBLIC_KEY
#include <stdlib.h>
#include "dsa.h"
#include "bignum.h"
#include <stdlib.h>
int
dsa_verify_digest(const struct dsa_public_key *key,
const uint8_t *digest,
......
......@@ -24,7 +24,7 @@
*/
#if HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif
#if WITH_PUBLIC_KEY
......
......@@ -25,13 +25,13 @@
#if HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#include "io.h"
#endif
#include <stdarg.h>
#include <stdlib.h>
#include "io.h"
#define RANDOM_DEVICE "/dev/urandom"
#define BUFSIZE 1000
......
......@@ -26,7 +26,15 @@
#if HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#endif
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "aes.h"
#include "arcfour.h"
......@@ -41,19 +49,6 @@
#include "cbc.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#if __GNUC__
# define UNUSED __attribute__ ((__unused__))
#else
# define UNUSED
#endif
/* Encrypt 10MB, 1K at a time. */
#define BENCH_BLOCK 1024
......
......@@ -25,19 +25,19 @@
#if HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#endif
/* Openssl glue, for comparative benchmarking only */
#if HAVE_LIBCRYPTO
#include "nettle-internal.h"
#include <assert.h>
#include <openssl/blowfish.h>
#include <openssl/des.h>
#include <openssl/cast.h>
#include <assert.h>
#include "nettle-internal.h"
/* Blowfish */
......
......@@ -22,12 +22,9 @@
* MA 02111-1307, USA.
*/
#include "buffer.h"
#include "rsa.h"
#include "sexp.h"
#include "yarrow.h"
#include "io.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <ctype.h>
#include <errno.h>
......@@ -38,6 +35,13 @@
/* For getopt */
#include <unistd.h>
#include "buffer.h"
#include "rsa.h"
#include "sexp.h"
#include "yarrow.h"
#include "io.h"
#define KEYSIZE 500
#define ESIZE 30
......
......@@ -22,6 +22,10 @@
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <errno.h>
#include <stdlib.h>