From: Ian Jackson Date: Thu, 25 Jul 2013 17:30:47 +0000 (+0100) Subject: serpent: const-correct X-Git-Tag: debian/0.3.0_beta2~34 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=d357bccb2ab22037e2b3415ffdd85212112a90a6 serpent: const-correct Decorate serpent_encrypt, serpent_decrypt and serpent_makekey with appropriate consts in their arguments. Signed-off-by: Ian Jackson --- diff --git a/serpent.c b/serpent.c index ce91854..34ef6aa 100644 --- a/serpent.c +++ b/serpent.c @@ -26,7 +26,7 @@ #include "serpentsboxes.h" void serpent_makekey(struct keyInstance *key, int keyLen, - uint8_t *keyMaterial) + const uint8_t *keyMaterial) { int i; uint32_t j; @@ -86,7 +86,7 @@ void serpent_makekey(struct keyInstance *key, int keyLen, } void serpent_encrypt(struct keyInstance *key, - uint8_t plaintext[16], + const uint8_t plaintext[16], uint8_t ciphertext[16]) { register uint32_t x0, x1, x2, x3; @@ -204,7 +204,7 @@ void serpent_encrypt(struct keyInstance *key, } void serpent_decrypt(struct keyInstance *key, - uint8_t ciphertext[16], + const uint8_t ciphertext[16], uint8_t plaintext[16]) { register uint32_t x0, x1, x2, x3; diff --git a/serpent.h b/serpent.h index 07176d7..19c01fe 100644 --- a/serpent.h +++ b/serpent.h @@ -8,12 +8,12 @@ struct keyInstance { /* Function protoypes */ void serpent_makekey(struct keyInstance *key, int keyLen, - uint8_t *keyMaterial); + const uint8_t *keyMaterial); -void serpent_encrypt(struct keyInstance *key, uint8_t plaintext[16], +void serpent_encrypt(struct keyInstance *key, const uint8_t plaintext[16], uint8_t ciphertext[16]); -void serpent_decrypt(struct keyInstance *key, uint8_t ciphertext[16], +void serpent_decrypt(struct keyInstance *key, const uint8_t ciphertext[16], uint8_t plaintext[16]); #endif /* serpent_h */