packages feed

cprng-aes-effect (empty) → 0.1.0

raw patch · 5 files changed

+81/−0 lines, 5 filesdep +basedep +cprng-aesdep +crypto-randomsetup-changed

Dependencies added: base, cprng-aes, crypto-random, crypto-random-effect, extensible-effects

Files

+ Changelog.md view
@@ -0,0 +1,5 @@+# Changelog++## Version 0.1++* targets `crypto-random-effect` 0.2 and later.
+ LICENSE view
@@ -0,0 +1,21 @@+The MIT License (MIT)++Copyright (c) 2014 Tobias Florek (me@ibotty.net)++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ cprng-aes-effect.cabal view
@@ -0,0 +1,29 @@+-- Initial crypto-random-effect.cabal generated by cabal init.  For further+--  documentation, see http://haskell.org/cabal/users-guide/++name:                cprng-aes-effect+version:             0.1.0+synopsis:            Run random effect using cprng-aes, a crypto pseudo number generator.+description:         Any help (especially documentation) is welcome+homepage:            https://github.com/ibotty/crypto-random-effect+license:             MIT+license-file:        LICENSE+author:              Tobias Florek+maintainer:          tob@butter.sh+-- copyright:           +category:            Effect, Crypto+build-type:          Simple+extra-source-files:  Changelog.md+cabal-version:       >=1.10++library+  exposed-modules:     Crypto.Random.Effect.AES+  -- other-modules:       +  -- other-extensions:    +  build-depends:       base >=4.6 && <5+                     , cprng-aes >=0.5 && <0.6+                     , crypto-random >=0.0.7 && <0.1+                     , crypto-random-effect ==0.2.*+                     , extensible-effects ==1.2.*+  hs-source-dirs:      src+  default-language:    Haskell2010
+ src/Crypto/Random/Effect/AES.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE StandaloneDeriving #-}+module Crypto.Random.Effect.AES+  ( runAESRNG+  ) where++import Control.Eff (Eff, SetMember, (:>))+import Control.Eff.Lift (Lift)+import Control.Eff.Reader.Strict (Reader)+import Control.Eff.State.Strict (State)+import Crypto.Random (EntropyPool)+import Crypto.Random.AESCtr (AESRNG)+import Crypto.Random.Effect (runRNG)+import Data.Typeable (Typeable)++deriving instance Typeable AESRNG++-- | Run the effect using an AES counter mode pseudo random number generator.+runAESRNG+  :: SetMember Lift (Lift IO) r+  => Eff (State AESRNG :> Reader EntropyPool :> r) a -> Eff r a+runAESRNG = runRNG