aboutsummaryrefslogtreecommitdiff
path: root/src/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto.c')
-rw-r--r--src/crypto.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/crypto.c b/src/crypto.c
index 8070eee..4985e0d 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -1,5 +1,13 @@
#include "crypto.h"
+uint8_t rotl8(uint8_t y, uint8_t offset){
+ return ( y << offset ) | ( y >> (8 - offset));
+}
+
+uint16_t rotl16(uint16_t y, uint16_t offset){
+ return ( y << offset ) | ( y >> (16 - offset));
+}
+
unsigned rotl32(unsigned y, unsigned offset){
return ( y << offset ) | ( y >> (32 - offset));
}