diff options
author | David Shaw <[email protected]> | 2004-10-12 17:35:50 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-10-12 17:35:50 +0000 |
commit | b15cc684b8a6fe6edc89370d359849eeab05089b (patch) | |
tree | 0f05ea572a2c18dd2924c6b7e0ebd18836f97ce6 /cipher/twofish.c | |
parent | (read_parameter_file): Changed to use iobuf based file (diff) | |
download | gnupg-b15cc684b8a6fe6edc89370d359849eeab05089b.tar.gz gnupg-b15cc684b8a6fe6edc89370d359849eeab05089b.zip |
* algorithms.h, cast5.c, cipher.c, idea-stub.c, twofish.c, blowfish.c,
des.c, rijndael.c: Consistently use const for input buffers.
Diffstat (limited to '')
-rw-r--r-- | cipher/twofish.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/cipher/twofish.c b/cipher/twofish.c index 5026f0305..2feccdf61 100644 --- a/cipher/twofish.c +++ b/cipher/twofish.c @@ -696,7 +696,7 @@ do_twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) } static int -twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) +twofish_setkey (void *ctx, const byte *key, unsigned int keylen) { int rc = do_twofish_setkey (ctx, key, keylen); burn_stack (23+6*sizeof(void*)); @@ -798,7 +798,7 @@ do_twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) } static void -twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) +twofish_encrypt (void *ctx, byte *out, const byte *in) { do_twofish_encrypt (ctx, out, in); burn_stack (24+3*sizeof (void*)); @@ -839,7 +839,7 @@ do_twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) } static void -twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) +twofish_decrypt (void *ctx, byte *out, const byte *in) { do_twofish_decrypt (ctx, out, in); burn_stack (24+3*sizeof (void*)); @@ -1008,25 +1008,22 @@ main() } #endif /* TEST */ - + const char * -twofish_get_info (int algo, size_t *keylen, - size_t *blocksize, size_t *contextsize, - int (**r_setkey) (void *c, byte *key, unsigned keylen), - void (**r_encrypt) (void *c, byte *outbuf, byte *inbuf), - void (**r_decrypt) (void *c, byte *outbuf, byte *inbuf) +twofish_get_info(int algo, size_t *keylen, + size_t *blocksize, size_t *contextsize, + int (**r_setkey) (void *c, const byte *key, unsigned keylen), + void (**r_encrypt) (void *c, byte *outbuf, const byte *inbuf), + void (**r_decrypt) (void *c, byte *outbuf, const byte *inbuf) ) { *keylen = algo==10? 256 : 128; *blocksize = 16; *contextsize = sizeof (TWOFISH_context); - *(int (**)(TWOFISH_context*, const byte*, const unsigned))r_setkey - = twofish_setkey; - *(void (**)(const TWOFISH_context*, byte*, const byte*))r_encrypt - = twofish_encrypt; - *(void (**)(const TWOFISH_context*, byte*, const byte*))r_decrypt - = twofish_decrypt; + *r_setkey = twofish_setkey; + *r_encrypt = twofish_encrypt; + *r_decrypt = twofish_decrypt; if( algo == 10 ) return "TWOFISH"; |