Commit 077695fe authored by Niels Möller's avatar Niels Möller

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
parent 2d429c0f
/*
* 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; \
......
/*
* 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;
......
/*
* 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.
*
* $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,7 +128,8 @@ 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[])() = {
/* static void (*funcs[])() = { */
static DesFunc *funcs[] = {
DesQuickCoreEncrypt, DesQuickFipsEncrypt,
DesSmallCoreEncrypt, DesSmallFipsEncrypt,
DesQuickCoreDecrypt, DesQuickFipsDecrypt,
......
/*
* 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment