From b15cc684b8a6fe6edc89370d359849eeab05089b Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 12 Oct 2004 17:35:50 +0000 Subject: * algorithms.h, cast5.c, cipher.c, idea-stub.c, twofish.c, blowfish.c, des.c, rijndael.c: Consistently use const for input buffers. --- cipher/cipher.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'cipher/cipher.c') 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 ) { -- cgit v1.2.3