-/*
- * 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"
\
void \
NAME(REGISTER BYTE *D, \
- REGISTER UINT32 *r, \
+ REGISTER const UINT32 *r, \
REGISTER const UINT8 *s) \
{ \
register UINT32 x, y, z; \
\
void \
NAME(REGISTER BYTE *D, \
- REGISTER UINT32 *r, \
+ REGISTER const UINT32 *r, \
REGISTER const UINT8 *s) \
{ \
register UINT32 x, y, z; \
/*
* 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"
/* 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);
}
/* 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;
-/*
- * 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
/* 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) ( \
/* noisy interfaces to the routines under test */
-static void
-method(key)
-UINT8 *key;
+static void method(const UINT8 *key)
{
int j;
}
static void
-encode(src, dst)
-UINT8 *src, *dst;
+encode(const UINT8 *src, UINT8 *dst)
{
int j;
}
static void
-decode(src, dst, check)
-UINT8 *src, *dst, *check;
+decode(const UINT8 *src, UINT8 *dst, const UINT8 *check)
{
int j;
/* 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",
"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();
-/*
- * 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"
/* 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;