aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rijndael.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-10-12 17:35:50 +0000
committerDavid Shaw <[email protected]>2004-10-12 17:35:50 +0000
commitb15cc684b8a6fe6edc89370d359849eeab05089b (patch)
tree0f05ea572a2c18dd2924c6b7e0ebd18836f97ce6 /cipher/rijndael.c
parent(read_parameter_file): Changed to use iobuf based file (diff)
downloadgnupg-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/rijndael.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index f7b678f4d..083b10399 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -1824,7 +1824,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
}
static int
-rijndael_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
+rijndael_setkey (void *ctx, const byte *key, const unsigned keylen)
{
int rc = do_setkey (ctx, key, keylen);
burn_stack ( 100 + 16*sizeof(int));
@@ -1948,7 +1948,7 @@ do_encrypt (const RIJNDAEL_context *ctx, byte *b, const byte *a)
}
static void
-rijndael_encrypt (const RIJNDAEL_context *ctx, byte *b, const byte *a)
+rijndael_encrypt (void *ctx, byte *b, const byte *a)
{
do_encrypt (ctx, b, a);
burn_stack (16 + 2*sizeof(int));
@@ -2042,7 +2042,7 @@ do_decrypt (RIJNDAEL_context *ctx, byte *b, const byte *a)
}
static void
-rijndael_decrypt (RIJNDAEL_context *ctx, byte *b, const byte *a)
+rijndael_decrypt (void *ctx, byte *b, const byte *a)
{
do_decrypt (ctx, b, a);
burn_stack (16+2*sizeof(int));
@@ -2127,25 +2127,22 @@ selftest (void)
return NULL;
}
-
+
const char *
-rijndael_get_info (int algo, size_t *keylen,
+rijndael_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)
- )
+ 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==7? 128 : algo==8? 192 : 256;
*blocksize = 16;
*contextsize = sizeof (RIJNDAEL_context);
- *(int (**)(RIJNDAEL_context*, const byte*, const unsigned))r_setkey
- = rijndael_setkey;
- *(void (**)(const RIJNDAEL_context*, byte*, const byte*))r_encrypt
- = rijndael_encrypt;
- *(void (**)(RIJNDAEL_context*, byte*, const byte*))r_decrypt
- = rijndael_decrypt;
+ *r_setkey = rijndael_setkey;
+ *r_encrypt = rijndael_encrypt;
+ *r_decrypt = rijndael_decrypt;
if( algo == 7 )
return "AES";