serpent: const-correct
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:47 +0000 (18:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:47 +0000 (18:30 +0100)
Decorate serpent_encrypt, serpent_decrypt and serpent_makekey with
appropriate consts in their arguments.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
serpent.c
serpent.h

index ce91854..34ef6aa 100644 (file)
--- 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;
index 07176d7..19c01fe 100644 (file)
--- 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 */