diff options
author | Niels Möller <nisse@lysator.liu.se> | 1998-12-31 05:34:24 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 1998-12-31 05:34:24 +0100 |
commit | 077695fe763a3c58564fc6ad0da04ad71773d772 (patch) | |
tree | f60c15f6596bc2843f2e13ea769be9359a7e1713 | |
parent | 2d429c0f1b5a0258979660151b99eefe320b625e (diff) | |
download | nettle-077695fe763a3c58564fc6ad0da04ad71773d772.tar.gz |
Constified.
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
-rw-r--r-- | desCode.h | 15 | ||||
-rw-r--r-- | desKerb.c | 6 | ||||
-rw-r--r-- | desTest.c | 51 | ||||
-rw-r--r-- | desUtil.c | 11 |
4 files changed, 45 insertions, 38 deletions
@@ -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; \ @@ -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; @@ -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(); @@ -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; |