X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Farctwo.c;h=baf3c615e5376e4f6a1d1d33b3d1ddc4ab79b156;hb=159eae9ff30acac95b6d397f053df8cd6fca62a3;hp=2c37471a159679025ad82c58b7c210f5e5565f68;hpb=8df4dfe1cb7f07141fcaeccfc5a1fa93e0c76303;p=gnulib.git diff --git a/lib/arctwo.c b/lib/arctwo.c index 2c37471a1..baf3c615e 100644 --- a/lib/arctwo.c +++ b/lib/arctwo.c @@ -1,5 +1,5 @@ /* arctwo.c --- The RC2 cipher as described in RFC 2268. - * Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + * Copyright (C) 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published @@ -27,12 +27,12 @@ * The implementation here is based on Peter Gutmann's RRC.2 paper. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "arctwo.h" +#include "bitrotate.h" + static const uint8_t arctwo_sbox[] = { 217, 120, 249, 196, 25, 221, 181, 237, 40, 233, 253, 121, 74, 160, 216, 157, @@ -68,9 +68,6 @@ static const uint8_t arctwo_sbox[] = { 10, 166, 32, 104, 254, 127, 193, 173 }; -#define rotl16(x,n) (((x) << ((uint16_t)(n))) | ((x) >> (16 - (uint16_t)(n)))) -#define rotr16(x,n) (((x) >> ((uint16_t)(n))) | ((x) << (16 - (uint16_t)(n)))) - /* C89 compliant way to cast 'char' to 'unsigned char'. */ static inline unsigned char to_uchar (char ch)