chiark / gitweb /
serpent: const-correct
[secnet.git] / serpent.c
index e41f3ceb19c6cad35a7286693bbf24be5f7c16c1..34ef6aa4d2a689b5a9282c9ee351088ee48186e9 100644 (file)
--- a/serpent.c
+++ b/serpent.c
 #include "serpentsboxes.h"
 
 void serpent_makekey(struct keyInstance *key, int keyLen,
-           uint8_t *keyMaterial)
+           const uint8_t *keyMaterial)
 {
-    uint32_t i,j;
+    int i;
+    uint32_t j;
     uint32_t w[132],k[132];
 
     for(i=0; i<keyLen/32; i++)
@@ -85,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;
@@ -203,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;