diff options
author | David Shaw <dshaw@jabberwocky.com> | 2004-10-12 19:35:50 +0200 |
---|---|---|
committer | David Shaw <dshaw@jabberwocky.com> | 2004-10-12 19:35:50 +0200 |
commit | b15cc684b8a6fe6edc89370d359849eeab05089b (patch) | |
tree | 0f05ea572a2c18dd2924c6b7e0ebd18836f97ce6 /cipher/cipher.c | |
parent | (read_parameter_file): Changed to use iobuf based file (diff) | |
download | gnupg2-b15cc684b8a6fe6edc89370d359849eeab05089b.tar.xz gnupg2-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 'cipher/cipher.c')
-rw-r--r-- | cipher/cipher.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c index 34d008fa3..b3bd6688f 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -43,9 +43,9 @@ struct cipher_table_s { size_t blocksize; size_t keylen; size_t contextsize; /* allocate this amount of context */ - int (*setkey)( void *c, byte *key, unsigned keylen ); - void (*encrypt)( void *c, byte *outbuf, byte *inbuf ); - void (*decrypt)( void *c, byte *outbuf, byte *inbuf ); + int (*setkey)( void *c, const byte *key, unsigned keylen ); + void (*encrypt)( void *c, byte *outbuf, const byte *inbuf ); + void (*decrypt)( void *c, byte *outbuf, const byte *inbuf ); }; static struct cipher_table_s cipher_table[TABLE_SIZE]; @@ -59,9 +59,9 @@ struct cipher_handle_s { byte iv[MAX_BLOCKSIZE]; /* (this should be ulong aligned) */ byte lastiv[MAX_BLOCKSIZE]; int unused; /* in IV */ - int (*setkey)( void *c, byte *key, unsigned keylen ); - void (*encrypt)( void *c, byte *outbuf, byte *inbuf ); - void (*decrypt)( void *c, byte *outbuf, byte *inbuf ); + int (*setkey)( void *c, const byte *key, unsigned keylen ); + void (*encrypt)( void *c, byte *outbuf, const byte *inbuf ); + void (*decrypt)( void *c, byte *outbuf, const byte *inbuf ); PROPERLY_ALIGNED_TYPE context; }; @@ -431,7 +431,6 @@ cipher_setkey( CIPHER_HANDLE c, byte *key, unsigned keylen ) } - void cipher_setiv( CIPHER_HANDLE c, const byte *iv, unsigned ivlen ) { @@ -447,8 +446,6 @@ cipher_setiv( CIPHER_HANDLE c, const byte *iv, unsigned ivlen ) c->unused = 0; } - - static void do_ecb_encrypt( CIPHER_HANDLE c, byte *outbuf, byte *inbuf, unsigned nblocks ) { |