From dfb3bbb04d94823319ed33948543d57305b48efb Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 23 Jul 2007 09:51:53 +0000 Subject: Having some consts in the code never hurts... --- include/aes.h | 6 +++--- include/des.h | 15 +++++++-------- include/md5.h | 2 +- include/rc4.h | 2 +- include/sha1.h | 2 +- include/sha256.h | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/aes.h b/include/aes.h index 8f9c64f..49f14d8 100644 --- a/include/aes.h +++ b/include/aes.h @@ -21,9 +21,9 @@ aes_context; extern "C" { #endif -int aes_set_key( aes_context *ctx, uint8 *key, int nbits ); -void aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] ); -void aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] ); +int aes_set_key( aes_context *ctx, const uint8 *key, int nbits ); +void aes_encrypt( aes_context *ctx, const uint8 input[16], uint8 output[16] ); +void aes_decrypt( aes_context *ctx, const uint8 input[16], uint8 output[16] ); #ifdef __cplusplus } diff --git a/include/des.h b/include/des.h index 27619aa..a6702be 100644 --- a/include/des.h +++ b/include/des.h @@ -27,16 +27,15 @@ des3_context; extern "C" { #endif -int des_set_key( des_context *ctx, uint8 key[8] ); -void des_encrypt( des_context *ctx, uint8 input[8], uint8 output[8] ); -void des_decrypt( des_context *ctx, uint8 input[8], uint8 output[8] ); +int des_set_key( des_context *ctx, const uint8 key[8] ); +void des_encrypt( des_context *ctx, const uint8 input[8], uint8 output[8] ); +void des_decrypt( des_context *ctx, const uint8 input[8], uint8 output[8] ); -int des3_set_2keys( des3_context *ctx, uint8 key1[8], uint8 key2[8] ); -int des3_set_3keys( des3_context *ctx, uint8 key1[8], uint8 key2[8], - uint8 key3[8] ); +int des3_set_2keys( des3_context *ctx, const uint8 key1[8], const uint8 key2[8] ); +int des3_set_3keys( des3_context *ctx, const uint8 key1[8], const uint8 key2[8], const uint8 key3[8] ); -void des3_encrypt( des3_context *ctx, uint8 input[8], uint8 output[8] ); -void des3_decrypt( des3_context *ctx, uint8 input[8], uint8 output[8] ); +void des3_encrypt( des3_context *ctx, const uint8 input[8], uint8 output[8] ); +void des3_decrypt( des3_context *ctx, const uint8 input[8], uint8 output[8] ); #ifdef __cplusplus } diff --git a/include/md5.h b/include/md5.h index 53d54b9..620e439 100644 --- a/include/md5.h +++ b/include/md5.h @@ -22,7 +22,7 @@ extern "C" { #endif void md5_starts( md5_context *ctx ); -void md5_update( md5_context *ctx, uint8 *input, uint32 length ); +void md5_update( md5_context *ctx, const uint8 *input, uint32 length ); void md5_finish( md5_context *ctx, uint8 digest[16] ); #ifdef __cplusplus diff --git a/include/rc4.h b/include/rc4.h index 45b3e1e..ac34bf1 100644 --- a/include/rc4.h +++ b/include/rc4.h @@ -10,7 +10,7 @@ struct rc4_state extern "C" { #endif -void rc4_setup( struct rc4_state *s, unsigned char *key, int length ); +void rc4_setup( struct rc4_state *s, const unsigned char *key, int length ); void rc4_crypt( struct rc4_state *s, unsigned char *data, int length ); #ifdef __cplusplus diff --git a/include/sha1.h b/include/sha1.h index 11b3cbd..dd5d1e1 100644 --- a/include/sha1.h +++ b/include/sha1.h @@ -22,7 +22,7 @@ extern "C" { #endif void sha1_starts( sha1_context *ctx ); -void sha1_update( sha1_context *ctx, uint8 *input, uint32 length ); +void sha1_update( sha1_context *ctx, const uint8 *input, uint32 length ); void sha1_finish( sha1_context *ctx, uint8 digest[20] ); #ifdef __cplusplus diff --git a/include/sha256.h b/include/sha256.h index 91b5adc..60f5542 100644 --- a/include/sha256.h +++ b/include/sha256.h @@ -22,7 +22,7 @@ extern "C" { #endif void sha256_starts( sha256_context *ctx ); -void sha256_update( sha256_context *ctx, uint8 *input, uint32 length ); +void sha256_update( sha256_context *ctx, const uint8 *input, uint32 length ); void sha256_finish( sha256_context *ctx, uint8 digest[32] ); #ifdef __cplusplus -- cgit v1.2.3