From 1c49f9e41d460ca1a0a2d10292b4190432609fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Tue, 11 Feb 1997 18:41:48 +0100 Subject: [PATCH] Changed order of arguments to idea_crypt() Rev: src/modules/_Crypto/idea.c:1.7 Rev: src/modules/_Crypto/include/idea.h:1.2 Rev: src/modules/_Crypto/lib/idea.c:1.3 --- src/modules/_Crypto/idea.c | 22 +++------------------- src/modules/_Crypto/include/idea.h | 6 +++--- src/modules/_Crypto/lib/idea.c | 6 +++--- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/modules/_Crypto/idea.c b/src/modules/_Crypto/idea.c index ff535ce9a4..c923594792 100644 --- a/src/modules/_Crypto/idea.c +++ b/src/modules/_Crypto/idea.c @@ -1,5 +1,5 @@ /* - * $Id: idea.c,v 1.6 1997/01/14 18:28:29 nisse Exp $ + * $Id: idea.c,v 1.7 1997/02/11 17:36:51 nisse Exp $ * * IDEA crypto module for Pike * @@ -20,22 +20,6 @@ #include "object.h" #include "error.h" #include "las.h" -#if 0 -#include "constants.h" -#include "macros.h" -#include "threads.h" -#include "stralloc.h" -#include "builtin_functions.h" - -/* System includes */ -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -#endif /* Backend includes */ #include <idea.h> @@ -144,8 +128,8 @@ static void f_crypt_block(INT32 args) s = begin_shared_string(len); for(i = 0; i < len; i += IDEA_BLOCKSIZE) - idea_crypt((unsigned INT8 *) s->str + i, - THIS, + idea_crypt(THIS, + (unsigned INT8 *) s->str + i, (unsigned INT8 *) sp[-1].u.string->str + i); pop_n_elems(args); diff --git a/src/modules/_Crypto/include/idea.h b/src/modules/_Crypto/include/idea.h index 87e6b12524..d06e83acec 100644 --- a/src/modules/_Crypto/include/idea.h +++ b/src/modules/_Crypto/include/idea.h @@ -13,10 +13,10 @@ void idea_expand(unsigned INT16 *ctx, const unsigned INT8 *key); void idea_invert(unsigned INT16 *d, - const unsigned INT16 *e); + const unsigned INT16 *e); -void idea_crypt(unsigned INT8 *dest, - const unsigned INT16 *key, +void idea_crypt(const unsigned INT16 *ctx, + unsigned INT8 *dest, const unsigned INT8 *src); #endif /* IDEA_H_INCLUDED */ diff --git a/src/modules/_Crypto/lib/idea.c b/src/modules/_Crypto/lib/idea.c index acfc900ef9..029e1d88b5 100644 --- a/src/modules/_Crypto/lib/idea.c +++ b/src/modules/_Crypto/lib/idea.c @@ -25,7 +25,7 @@ */ #include "types.h" -#include "idea.h" +#include <idea.h> #include <string.h> @@ -211,8 +211,8 @@ idea_invert(unsigned INT16 *d, /* IDEA encryption/decryption algorithm */ /* Note that in and out can be the same buffer */ void -idea_crypt(unsigned INT8 *dest, - const unsigned INT16 *key, +idea_crypt(const unsigned INT16 *key, + unsigned INT8 *dest, const unsigned INT8 *src) { register unsigned INT16 x1, x2, x3, x4, s2, s3; -- GitLab