Created
April 22, 2016 19:29
-
-
Save extremecoders-re/499d461753b50998f81c9011895f10fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static uint16_t rotl(uint16_t value, uint16_t shift) | |
{ | |
return (value << shift) | (value >> (32 - shift)); | |
} | |
static void s20_quarterround(uint16_t *y0, uint16_t *y1, uint16_t *y2, uint16_t *y3) | |
{ | |
*y1 = *y1 ^ rotl(*y0 + *y3, 7); | |
*y2 = *y2 ^ rotl(*y1 + *y0, 9); | |
*y3 = *y3 ^ rotl(*y2 + *y1, 13); | |
*y0 = *y0 ^ rotl(*y3 + *y2, 18); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment