diff options
author | lloyd <[email protected]> | 2010-12-28 17:23:51 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-12-28 17:23:51 +0000 |
commit | d8281274cc8bdae4f5c786590261440eec8b3049 (patch) | |
tree | 2eead33de613392248164e7e11f3cf61eeb03c93 /src/utils/simd_32/simd_32.h | |
parent | cfda815f55d5ad28374198a9c1e76fc07f519431 (diff) |
Use size_t for shift and rotate values. Also define rotate_left and
rotate_right for SIMD types as a template specialization to avoid
problems in the amalgamation.
Diffstat (limited to 'src/utils/simd_32/simd_32.h')
-rw-r--r-- | src/utils/simd_32/simd_32.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/utils/simd_32/simd_32.h b/src/utils/simd_32/simd_32.h index 9ea565402..e2c483d20 100644 --- a/src/utils/simd_32/simd_32.h +++ b/src/utils/simd_32/simd_32.h @@ -9,6 +9,7 @@ #define BOTAN_SIMD_32_H__ #include <botan/types.h> +#include <botan/rotate.h> #if defined(BOTAN_TARGET_CPU_HAS_SSE2) && !defined(BOTAN_NO_SSE_INTRINSICS) @@ -29,16 +30,18 @@ namespace Botan { -inline SIMD_32 rotate_left(const SIMD_32& x, u32bit rot) +template<> +inline SIMD_32 rotate_left(SIMD_32 x, size_t rot) { - SIMD_32 y = x; - y.rotate_left(rot); - return y; + x.rotate_left(rot); + return x; } -inline SIMD_32 rotate_right(const SIMD_32& x, u32bit rot) +template<> +inline SIMD_32 rotate_right(SIMD_32 x, size_t rot) { - return rotate_left(x, 32 - rot); + x.rotate_right(rot); + return x; } } |