chiark / gitweb /
Socket address stuff. Sockid is broken still.
[chiark-tcl.git] / crypto / bcmode.c
index a40aff077f4101e2c1821d0fb2f2fd1d92a486b7..f7c808d55410796b4589220e28554b2669109b06 100644 (file)
@@ -3,10 +3,10 @@
   
 #include "hbytes.h"
 
-const char *mode_cbc_encrypt(Byte *data, int blocks,
-                            const Byte *iv, Byte *chain,
-                            const BlockCipherAlgInfo *alg, int encr,
-                            int blocksize, const void *sch) {
+static const char *mode_cbc_encrypt(Byte *data, int blocks,
+                                   const Byte *iv, Byte *chain,
+                                   const BlockCipherAlgInfo *alg, int encr,
+                                   int blocksize, const void *sch) {
   memcpy(chain,iv,blocksize);
   alg->byteswap(chain);
   
@@ -23,10 +23,10 @@ const char *mode_cbc_encrypt(Byte *data, int blocks,
   return 0;
 }
 
-const char *mode_cbc_decrypt(Byte *data, int blocks,
-                            const Byte *iv, Byte *chain,
-                            const BlockCipherAlgInfo *alg, int encr,
-                            int blocksize, const void *sch) {
+static const char *mode_cbc_decrypt(Byte *data, int blocks,
+                                   const Byte *iv, Byte *chain,
+                                   const BlockCipherAlgInfo *alg, int encr,
+                                   int blocksize, const void *sch) {
   int cchain= 0;
 
   memcpy(chain,iv,blocksize);
@@ -46,10 +46,10 @@ const char *mode_cbc_decrypt(Byte *data, int blocks,
   return 0;
 }
 
-const char *mode_ecb(Byte *data, int blocks,
-                    const Byte *iv, Byte *chain,
-                    const BlockCipherAlgInfo *alg, int encr,
-                    int blocksize, const void *sch) {
+static const char *mode_ecb(Byte *data, int blocks,
+                           const Byte *iv, Byte *chain,
+                           const BlockCipherAlgInfo *alg, int encr,
+                           int blocksize, const void *sch) {
   while (blocks > 0) {
     alg->byteswap(data);
     (encr ? &alg->encrypt : &alg->decrypt)->crypt(sch, data, data);