From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyUhW-000728-Cu for guix-patches@gnu.org; Tue, 20 Mar 2018 23:46:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyUhV-0003F9-Cw for guix-patches@gnu.org; Tue, 20 Mar 2018 23:46:10 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eyUhV-0003F3-9H for guix-patches@gnu.org; Tue, 20 Mar 2018 23:46:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eyUhV-0006UQ-0P for guix-patches@gnu.org; Tue, 20 Mar 2018 23:46:09 -0400 Subject: [bug#30892] [PATCH 13/37] gnu: Add ghc-cprng-aes. Resent-Message-ID: From: rsiddharth Date: Wed, 21 Mar 2018 03:44:51 +0000 Message-Id: <20180321034515.3664-14-s@ricketyspace.net> In-Reply-To: <20180321034005.2975-1-s@ricketyspace.net> References: <20180321034005.2975-1-s@ricketyspace.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30892@debbugs.gnu.org Cc: rsiddharth * gnu/packages/haskell-crypto.scm (ghc-cprng-aes): New variable. --- gnu/packages/haskell-crypto.scm | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gnu/packages/haskell-crypto.scm b/gnu/packages/haskell-crypto.scm index 9dff57546..e9c380f97 100644 --- a/gnu/packages/haskell-crypto.scm +++ b/gnu/packages/haskell-crypto.scm @@ -613,3 +613,49 @@ AES-NI available, or you'll need to use a different implementation.") (description "Simple cryptographic random related types: a safe abstraction for CPRNGs.") (license license:bsd-3))) + +(define-public ghc-cprng-aes + (package + (name "ghc-cprng-aes") + (version "0.6.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://hackage.haskell.org/package/" + "cprng-aes-" version "/" + "cprng-aes-" version ".tar.gz")) + (sha256 + (base32 + "1wr15kbmk1g3l8a75n0iwbzqg24ixv78slwzwb2q6rlcvq0jlnb4")))) + (build-system haskell-build-system) + (inputs `(("ghc-byteable" ,ghc-byteable) + ("ghc-crypto-random" ,ghc-crypto-random) + ("ghc-cipher-aes" ,ghc-cipher-aes))) + (home-page "https://github.com/vincenthz/hs-cprng-aes") + (synopsis "Crypto Pseudo Random Number Generator using AES in counter mode +in Haskell") + (description "Simple crypto pseudo-random-number-generator with really +good randomness property. + +Using ent, a randomness property maker on one 1Mb sample: + +@itemize +@item Entropy = 7.999837 bits per byte. +@item Optimum compression would reduce the size of this 1048576 byte file by 0 +percent. +@item Chi square distribution for 1048576 samples is 237.02. +@item Arithmbetic mean value of data bytes is 127.3422 (127.5 = random). +@item Monte Carlo value for Pi is 3.143589568 (error 0.06 percent). +@end itemize + +Compared to urandom with the same sampling: + +@itemize +@item Entropy = 7.999831 bits per byte. +@item Optimum compression would reduce the size of this 1048576 byte file by 0 +percent. +@item Chi square distribution for 1048576 samples is 246.63. +@item Arithmetic mean value of data bytes is 127.6347 (127.5 = random). +@item Monte Carlo value for Pi is 3.132465868 (error 0.29 percent). +@end itemize") + (license license:bsd-3))) -- 2.16.2