00001
00002
00003
00004
00005
00006
00007
00008 #ifndef BOTAN_WORD_ROTATE_H__
00009 #define BOTAN_WORD_ROTATE_H__
00010
00011 #include <botan/types.h>
00012
00013 namespace Botan {
00014
00015
00016
00017
00018 template<typename T> inline T rotate_left(T input, u32bit rot)
00019 {
00020 return static_cast<T>((input << rot) | (input >> (8*sizeof(T)-rot)));;
00021 }
00022
00023 template<typename T> inline T rotate_right(T input, u32bit rot)
00024 {
00025 return static_cast<T>((input >> rot) | (input << (8*sizeof(T)-rot)));
00026 }
00027
00028 }
00029
00030 #endif