[riot-notifications] [RIOT] add mersene twister (#168)

René Kijewski notifications at github.com
Wed Aug 21 23:20:44 CEST 2013


> +    for (; k; k--) {
> +        mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525UL))
> +                + init_key[j] + j; /* non linear */
> +        mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
> +        i++;
> +        j++;
> +        if (i >= N) {
> +            mt[0] = mt[N - 1];
> +            i = 1;
> +        }
> +        if (j >= key_length)
> +            j = 0;
> +    }
> +    for (k = N - 1; k; k--) {
> +        mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1566083941UL)) - i; /* non linear */
> +        mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */

Same as line 91.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/168/files#r5909588
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20130821/ad0bfab4/attachment.html>


More information about the notifications mailing list