cryptopals

Matasano's cryptopals challenges (cryptopals.com).
git clone git://git.jtobin.io/cryptopals.git
Log | Files | Refs | README | LICENSE

Mode.hs (307B)


      1 module Cryptopals.AES.Mode where
      2 
      3 import Control.Monad
      4 import Control.Monad.Primitive
      5 import qualified Data.ByteString as BS
      6 import qualified System.Random.MWC as MWC
      7 
      8 genKeyAES128 :: PrimMonad m => MWC.Gen (PrimState m) -> m BS.ByteString
      9 genKeyAES128 gen = fmap BS.pack $ replicateM 16 (MWC.uniform gen)
     10