aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/cast/cast128.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/block/cast/cast128.cpp')
-rw-r--r--src/lib/block/cast/cast128.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/block/cast/cast128.cpp b/src/lib/block/cast/cast128.cpp
index d6ded8cd2..d54d0614e 100644
--- a/src/lib/block/cast/cast128.cpp
+++ b/src/lib/block/cast/cast128.cpp
@@ -18,7 +18,7 @@ namespace {
*/
inline uint32_t R1(uint32_t R, uint32_t MK, uint8_t RK)
{
- uint32_t T = rotate_left(MK + R, RK);
+ const uint32_t T = rotl_var(MK + R, RK);
return (CAST_SBOX1[get_byte(0, T)] ^ CAST_SBOX2[get_byte(1, T)]) -
CAST_SBOX3[get_byte(2, T)] + CAST_SBOX4[get_byte(3, T)];
}
@@ -28,7 +28,7 @@ inline uint32_t R1(uint32_t R, uint32_t MK, uint8_t RK)
*/
inline uint32_t R2(uint32_t R, uint32_t MK, uint8_t RK)
{
- uint32_t T = rotate_left(MK ^ R, RK);
+ const uint32_t T = rotl_var(MK ^ R, RK);
return (CAST_SBOX1[get_byte(0, T)] - CAST_SBOX2[get_byte(1, T)] +
CAST_SBOX3[get_byte(2, T)]) ^ CAST_SBOX4[get_byte(3, T)];
}
@@ -38,7 +38,7 @@ inline uint32_t R2(uint32_t R, uint32_t MK, uint8_t RK)
*/
inline uint32_t R3(uint32_t R, uint32_t MK, uint8_t RK)
{
- uint32_t T = rotate_left(MK - R, RK);
+ const uint32_t T = rotl_var(MK - R, RK);
return ((CAST_SBOX1[get_byte(0, T)] + CAST_SBOX2[get_byte(1, T)]) ^
CAST_SBOX3[get_byte(2, T)]) - CAST_SBOX4[get_byte(3, T)];
}