[PATCH 12/25] serpent: const-correct

Ian Jackson ijackson at chiark.greenend.org.uk
Sat Jul 20 00:38:56 BST 2013


Decorate serpent_encrypt, serpent_decrypt and serpent_makekey with
appropriate consts in their arguments.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
 serpent.c |    6 +++---
 serpent.h |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

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 */
-- 
1.7.2.5




More information about the sgo-software-discuss mailing list