autoupdate
[gnulib.git] / lib / arctwo.c
index 2c37471..baf3c61 100644 (file)
@@ -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
  * The implementation here is based on Peter Gutmann's RRC.2 paper.
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 #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)