diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-11 15:07:59 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-11 15:07:59 +0000 |
| commit | e997758cb67526549b56a89658f7a42104716cf0 (patch) | |
| tree | 25704e6e929bc209281b1859917be9935e4007b0 /contrib/pgcrypto/rijndael.c | |
| parent | 3c52d17fa66ab1ac447fcc052df9dde470d5b195 (diff) | |
| download | postgresql-e997758cb67526549b56a89658f7a42104716cf0.tar.gz | |
More pgcrypto fixes: avoid bogus alignment assumptions in sha2,
be more wary about having a value for BYTE_ORDER, clean up randomly-
chosen ways of including Postgres core headers.
Marko Kreen and Tom Lane
Diffstat (limited to 'contrib/pgcrypto/rijndael.c')
| -rw-r--r-- | contrib/pgcrypto/rijndael.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/contrib/pgcrypto/rijndael.c b/contrib/pgcrypto/rijndael.c index 8a68e3f166..fbf74cabe9 100644 --- a/contrib/pgcrypto/rijndael.c +++ b/contrib/pgcrypto/rijndael.c @@ -1,5 +1,7 @@ /* $OpenBSD: rijndael.c,v 1.6 2000/12/09 18:51:34 markus Exp $ */ +/* $PostgreSQL: pgsql/contrib/pgcrypto/rijndael.c,v 1.11 2005/07/11 15:07:59 tgl Exp $ */ + /* This is an independent implementation of the encryption algorithm: */ /* */ /* RIJNDAEL by Joan Daemen and Vincent Rijmen */ @@ -38,11 +40,19 @@ Mean: 500 cycles = 51.2 mbits/sec */ -#include <postgres.h> -#include "px.h" +#include "postgres.h" +#include <sys/param.h> + +#include "px.h" #include "rijndael.h" +/* sanity check */ +#if !defined(BYTE_ORDER) || (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) +#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN +#endif + + #define PRE_CALC_TABLES #define LARGE_TABLES |
