Skip to content

Instantly share code, notes, and snippets.

@azet
Created August 6, 2017 13:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azet/b180eccdcb69d7a81d2e7f0dfe0f6e03 to your computer and use it in GitHub Desktop.
Save azet/b180eccdcb69d7a81d2e7f0dfe0f6e03 to your computer and use it in GitHub Desktop.
Splevin ARX
static void fast_mix(struct fast_pool *f)
{
__u32 a = f->pool[0], b = f->pool[1];
__u32 c = f->pool[2], d = f->pool[3];
a += b; c += d;
b = rol32(b, 6); d = rol32(d, 27);
d ^= a; b ^= c;
a += b; c += d;
b = rol32(b, 16); d = rol32(d, 14);
d ^= a; b ^= c;
a += b; c += d;
b = rol32(b, 6); d = rol32(d, 27);
d ^= a; b ^= c;
a += b; c += d;
b = rol32(b, 16); d = rol32(d, 14);
d ^= a; b ^= c;
f->pool[0] = a; f->pool[1] = b;
f->pool[2] = c; f->pool[3] = d;
f->count++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment