diff options
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 8 | ||||
-rw-r--r-- | cipher/blowfish.c | 8 | ||||
-rw-r--r-- | cipher/rndriscos.c | 5 | ||||
-rw-r--r-- | cipher/twofish.c | 27 |
4 files changed, 10 insertions, 38 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index a82966200..beda87731 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,11 @@ +2003-12-28 Stefan Bellon <[email protected]> + + * rndriscos.c (rndriscos_gather_random) [__riscos__]: Declare + variable outside loop. + + * blowfish.c, twofish.c [__riscos__]: Removal of unnecessary + #ifdef __riscos__ sections. + 2003-12-17 David Shaw <[email protected]> * dsa.h, dsa.c (dsa_verify), elgamal.h, elgamal.c (elg_verify), diff --git a/cipher/blowfish.c b/cipher/blowfish.c index 409194c52..063fbc910 100644 --- a/cipher/blowfish.c +++ b/cipher/blowfish.c @@ -502,10 +502,6 @@ selftest(void) return NULL; } -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) */ -#pragma no_optimise_cse -#endif /* __riscos__ */ static int do_bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) @@ -590,10 +586,6 @@ do_bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) return 0; } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static int bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) { diff --git a/cipher/rndriscos.c b/cipher/rndriscos.c index ee35beadd..a0fbbc228 100644 --- a/cipher/rndriscos.c +++ b/cipher/rndriscos.c @@ -27,7 +27,6 @@ #include <swis.h> #include "util.h" -#define CryptRandom_Byte 0x51980 static const char * const cryptrandom_path[] = { "GnuPG:CryptRandom", @@ -47,7 +46,7 @@ rndriscos_gather_random(void (*add)(const void*, size_t, int), int requester, size_t length, int level) { static int rndriscos_initialized = 0; - int n; + int n, nbytes; byte buffer[768]; if (!rndriscos_initialized) @@ -55,7 +54,7 @@ rndriscos_gather_random(void (*add)(const void*, size_t, int), int requester, cryptrandom_path, 1); while (length) { - int nbytes = length < sizeof(buffer) ? length : sizeof(buffer); + nbytes = length < sizeof(buffer) ? length : sizeof(buffer); for (n = 0; n < nbytes; ++n) if (_swix(CryptRandom_Byte, _OUT(0), &buffer[n])) diff --git a/cipher/twofish.c b/cipher/twofish.c index a6a571ff0..554b4aa3e 100644 --- a/cipher/twofish.c +++ b/cipher/twofish.c @@ -561,11 +561,6 @@ burn_stack (int bytes) /* Perform the key setup. Note that this works only with 128- and 256-bit * keys, despite the API that looks like it might support other sizes. */ -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) */ -#pragma no_optimise_cse -#endif /* __riscos__ */ - static int do_twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) { @@ -701,10 +696,6 @@ do_twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) return 0; } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static int twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) { @@ -775,11 +766,6 @@ twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) /* Encrypt one block. in and out may be the same. */ -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) */ -#pragma no_optimise_cse -#endif /* __riscos__ */ - static void do_twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { @@ -812,10 +798,6 @@ do_twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) OUTUNPACK (3, b, 7); } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static void twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { @@ -825,11 +807,6 @@ twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) /* Decrypt one block. in and out may be the same. */ -#ifdef __riscos__ -/* need to switch off CSE optimisation for Norcroft C (Acorn/Pace) - bug */ -#pragma no_optimise_cse -#endif /* __riscos__ */ - static void do_twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { @@ -862,10 +839,6 @@ do_twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) OUTUNPACK (3, d, 3); } -#ifdef __riscos__ -#pragma optimise_cse -#endif /* __riscos__ */ - static void twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { |