summaryrefslogtreecommitdiffstats
path: root/botan/build/botan/rotate.h
diff options
context:
space:
mode:
Diffstat (limited to 'botan/build/botan/rotate.h')
-rw-r--r--botan/build/botan/rotate.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/botan/build/botan/rotate.h b/botan/build/botan/rotate.h
new file mode 100644
index 0000000..c8f8d4a
--- /dev/null
+++ b/botan/build/botan/rotate.h
@@ -0,0 +1,30 @@
+/*
+* Word Rotation Operations
+* (C) 1999-2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_WORD_ROTATE_H__
+#define BOTAN_WORD_ROTATE_H__
+
+#include <botan/types.h>
+
+namespace Botan {
+
+/*
+* Word Rotation Functions
+*/
+template<typename T> inline T rotate_left(T input, u32bit rot)
+ {
+ return static_cast<T>((input << rot) | (input >> (8*sizeof(T)-rot)));;
+ }
+
+template<typename T> inline T rotate_right(T input, u32bit rot)
+ {
+ return static_cast<T>((input >> rot) | (input << (8*sizeof(T)-rot)));
+ }
+
+}
+
+#endif