Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // 1 dep-chain (assuming state words in reg) to result.
  2. // DON'T USE ME UNLESS YOUR PARINOID AND
  3. // USING SOMETHING MORE EXPENSIVE
  4.  
  5. // smallcrush: passes
  6. // crush: 1 systematic failure = 72 LinearComp, r = 29
  7.  
  8. static inline uint32_t rng_u32(rng_state_t* s)
  9. {
  10. uint32_t x = s->s[1];
  11. uint32_t r = s->s[0] + x;
  12.  
  13. s->s[0] = x * 1597334677;
  14. x ^= (x << 13);
  15. x ^= (x >> 17);
  16. x ^= (x << 5);
  17. s->s[1] = x;
  18.  
  19. return r;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement