]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Constified.
authorNiels Möller <nisse@lysator.liu.se>
Thu, 31 Dec 1998 04:34:24 +0000 (05:34 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 31 Dec 1998 04:34:24 +0000 (05:34 +0100)
Rev: src/symmetric/desCode.h:1.4
Rev: src/symmetric/desKerb.c:1.3
Rev: src/symmetric/desTest.c:1.6
Rev: src/symmetric/desUtil.c:1.3

desCode.h
desKerb.c
desTest.c
desUtil.c

index e8ae4bb1dbcda5484fdc8eedbe95bc78465ac2f9..2334628f09dacb3863386ad73ab22df87e4963d0 100644 (file)
--- a/desCode.h
+++ b/desCode.h
@@ -1,11 +1,12 @@
-/*
- *     des - fast & portable DES encryption & decryption.
+/* desCode.h
+ *
+ * $Id$ */
+
+/*     des - fast & portable DES encryption & decryption.
  *     Copyright (C) 1992  Dana L. How
- *     Please see the file `README' for the complete copyright notice.
+ *     Please see the file `descore.README' for the complete copyright notice.
  */
 
-
-
 #include "des.h"
 
 #include "RCSID.h"
@@ -344,7 +345,7 @@ extern UINT32 des_keymap[], des_bigmap[];
                                                \
 void                                           \
 NAME(REGISTER BYTE *D,                         \
-     REGISTER UINT32 *r,                       \
+     REGISTER const UINT32 *r,                 \
      REGISTER const UINT8 *s)                  \
 {                                              \
        register UINT32 x, y, z;                \
@@ -380,7 +381,7 @@ NAME(REGISTER BYTE *D,                              \
                                                \
 void                                           \
 NAME(REGISTER BYTE *D,                         \
-     REGISTER UINT32 *r,                       \
+     REGISTER const UINT32 *r,                 \
      REGISTER const UINT8 *s)                  \
 {                                              \
        register UINT32 x, y, z;                \
index eaf2ec03e3be483e0632b3aa7d847c905627e06c..f66c6dcd3f1b296120cf8901cdc03fe8d3630dce 100644 (file)
--- a/desKerb.c
+++ b/desKerb.c
@@ -1,7 +1,7 @@
 /*
  *     des - fast & portable DES encryption & decryption.
  *     Copyright (C) 1992  Dana L. How
- *     Please see the file `README' for the complete copyright notice.
+ *     Please see the file `descore.README' for the complete copyright notice.
  */
 
 #include "des.h"
@@ -16,7 +16,7 @@ DesFunc *DesCryptFuncs[2] = { DesSmallFipsDecrypt, DesSmallFipsEncrypt };
 /* kerberos-compatible key schedule function */
 
 int
-des_key_sched(UINT8 *k, UINT32 *s)
+des_key_sched(const UINT8 *k, UINT32 *s)
 {
        return DesMethod(s, k);
 }
@@ -24,7 +24,7 @@ des_key_sched(UINT8 *k, UINT32 *s)
 /* kerberos-compatible des coding function */
 
 int
-des_ecb_encrypt(UINT8 *s, UINT8 *d, UINT32 *r, int e)
+des_ecb_encrypt(const UINT8 *s, UINT8 *d, const UINT32 *r, int e)
 {
        (*DesCryptFuncs[e])(d, r, s);
        return 0;
index 31b9ca6f87e977381297072c7b38ca600bb15811..2f8e29cdef2e78e05960c78b0456308b8abf2add 100644 (file)
--- a/desTest.c
+++ b/desTest.c
@@ -1,9 +1,12 @@
-/*
- *     des - fast & portable DES encryption & decryption.
- *     Copyright (C) 1992  Dana L. How
- *     Please see the file `README' for the complete copyright notice.
+/* desTest.c
+ *
+ * Exercise the DES routines and collect performance statistics.
  *
- *     Exercise the DES routines and collect performance statistics.
+ * $ID:$ */
+
+/*     des - fast & portable DES encryption & decryption.
+ *     Copyright (C) 1992  Dana L. How
+ *     Please see the file `descore.README' for the complete copyright notice.
  */
 
 #ifndef        lint
@@ -15,15 +18,16 @@ char desTest_cRcs[] = "$Id$";
 
 /* define now(w) to be the elapsed time in hundredths of a second */
 
+#if 1
+/* FIXME: Let autoconf look for getrusage */
+#define now(w) 0;
+#else /* false */
+
 #ifndef __NT__
 #include       <sys/time.h>
 #include       <sys/resource.h>
 #include       <unistd.h>
 
-#if 1
-/* FIXME: Let autoconf look for getrusage */
-#define now(w) 0;
-#else /* false */
 /* extern getrusage(); */
 static struct rusage usage;
 #define        now(w)  (                                               \
@@ -59,9 +63,7 @@ UINT8 cipher[8], output[8];
 
 /* noisy interfaces to the routines under test */
 
-static void
-method(key)
-UINT8 *key;
+static void method(const UINT8 *key)
 {
        int j;
 
@@ -74,8 +76,7 @@ UINT8 *key;
 }
 
 static void
-encode(src, dst)
-UINT8 *src, *dst;
+encode(const UINT8 *src, UINT8 *dst)
 {
        int j;
 
@@ -92,8 +93,7 @@ UINT8 *src, *dst;
 }
 
 static void
-decode(src, dst, check)
-UINT8 *src, *dst, *check;
+decode(const UINT8 *src, UINT8 *dst, const UINT8 *check)
 {
        int j;
 
@@ -116,9 +116,11 @@ UINT8 *src, *dst, *check;
 /* run the tests */
 
 int
-main(int argc, char **argv)
+main(int argc UNUSED, char **argv UNUSED)
 {
        int j, m, e, n;
+
+       /* FIXME: Don't use this untyped function pointer. */ 
        void (*f)();
        static char * expect[] = {
                "57 99 F7 2A D2 3F AE 4C", "9C C6 2D F4 3B 6E ED 74",
@@ -126,14 +128,15 @@ main(int argc, char **argv)
                "43 5C FF C5 68 B3 70 1D", "25 DD AC 3E 96 17 64 67",
                "80 B5 07 E1 E6 A7 47 3D", "3F A4 0E 8A 98 4D 48 15",
        };
-       static void (*funcs[])() = {
-               DesQuickCoreEncrypt, DesQuickFipsEncrypt,
-               DesSmallCoreEncrypt, DesSmallFipsEncrypt,
-               DesQuickCoreDecrypt, DesQuickFipsDecrypt,
-               DesSmallCoreDecrypt, DesSmallFipsDecrypt };
+       /* static void (*funcs[])() = { */
+       static DesFunc *funcs[] = {
+         DesQuickCoreEncrypt, DesQuickFipsEncrypt,
+         DesSmallCoreEncrypt, DesSmallFipsEncrypt,
+         DesQuickCoreDecrypt, DesQuickFipsDecrypt,
+         DesSmallCoreDecrypt, DesSmallFipsDecrypt };
        static char * names[] = {
-               "QuickCore", "QuickFips",
-               "SmallCore", "SmallFips" };
+         "QuickCore", "QuickFips",
+         "SmallCore", "SmallFips" };
 
        n = 0;
        DesQuickInit();
index f359dd0e4870d04b377b3a799faf2707372cec4b..abc164183c13c9803f05031590d6595389033a9f 100644 (file)
--- a/desUtil.c
+++ b/desUtil.c
@@ -1,7 +1,10 @@
-/*
- *     des - fast & portable DES encryption & decryption.
+/* desUtil.c
+ *
+ * $id:$ */
+
+/*     des - fast & portable DES encryption & decryption.
  *     Copyright (C) 1992  Dana L. How
- *     Please see the file `README' for the complete copyright notice.
+ *     Please see the file `descore.README' for the complete copyright notice.
  */
 
 #include       "desCode.h"
@@ -28,7 +31,7 @@ RCSID2(ego, "\n\nFast DES Library Copyright (c) 1991 Dana L. How\n\n");
 /* set up the method list from the key */
 
 int
-DesMethod(UINT32 *method, UINT8 *k)
+DesMethod(UINT32 *method, const UINT8 *k)
 {
        register UINT32 n, w;
        register char * b0, * b1;