aboutsummaryrefslogtreecommitdiff
path: root/src/crypto.c
blob: bddb2e6a93b3da255de8c981d6d016179282af63 (plain)
1
2
3
4
5
6
7
8
9
#include "crypto.h"

unsigned i_lr(unsigned y, unsigned offset){
    return ( y << offset ) | ( y >> (32 - offset));
}

unsigned i_rr(unsigned x, unsigned n) {
    return (x >> n % 32) | (x << (32-n) % 32);
}