Fast scrambling courtesy of a C function.