Guest User

Cryptol implementation of LCG

a guest
Dec 11th, 2014
234
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lcg : {n,b} (fin n) => [b] -> [b] -> [b/2] -> [b] -> [n][b/2]
  2. lcg seed inc ex mult = [rand | (_,rand) <- take`{n} (drop`{1} seq) ]
  3.   where
  4.     succ st = st * mult + inc
  5.     out  st = (take`{b/2} (st * mult + inc)) ^ ex
  6.     seq = [(seed,0)] # [(succ st, out st) | (st,_) <- seq]
RAW Paste Data