41 return ((X) << ((R)&31)) | ((X) >> (32 - ((R)&31)));
45 return ((X) >> ((R)&31)) | ((X) << (32 - ((R)&31)));
52 for (
int i = 0; i < ROUNDS; i++) {
58 x[0] = rotl(x[0], x[1]);
60 x[1] = rotr(x[1], x[0]);
71 uint32_t dk[2] = {k[1] - CONST * (ROUNDS + 1), k[0] + CONST * (ROUNDS + 1)};
void decrypt(uint32_t *x, const uint32_t *k)
Decrypts the given data using the RedPike algorithm.
uint32_t rotl(uint32_t X, int R)
Performs left rotation on the given value.
void encrypt(uint32_t *x, const uint32_t *k)
Encrypts the given data using the RedPike algorithm.
uint32_t rotr(uint32_t X, int R)
Performs right rotation on the given value.