This file is indexed.

/usr/share/doc/libghc-crypto-api-doc/html/Crypto-Classes.html is in libghc-crypto-api-doc 0.13.2-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Crypto.Classes</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Crypto-Classes.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Crypto-Classes.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">crypto-api-0.13.2: A generic interface for cryptographic operations</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Maintainer</th><td>Thomas.DuBuisson@gmail.com</td></tr><tr><th>Stability</th><td>beta</td></tr><tr><th>Portability</th><td>portable </td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Crypto.Classes</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Hash class and helper functions</a></li><li><a href="#g:2">Cipher classes and helper functions</a></li><li><a href="#g:3">Misc helper functions</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This is the heart of the crypto-api package.  By making (or having) 
an instance of Hash, AsymCipher, BlockCipher or StreamCipher you provide (or obtain)
access to any infrastructure built on these primitives include block cipher modes
of operation, hashing, hmac, signing, etc.  These classes allow users to build
routines that are agnostic to the algorithm used so changing algorithms is as simple
as changing a type signature.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span> (<a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> d) =&gt; <a href="#t:Hash">Hash</a> ctx d | d -&gt; ctx, ctx -&gt; d <span class="keyword">where</span><ul class="subs"><li><a href="#v:outputLength">outputLength</a> :: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> d <a href="Crypto-Types.html#t:BitLength">BitLength</a></li><li><a href="#v:blockLength">blockLength</a> :: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> d <a href="Crypto-Types.html#t:BitLength">BitLength</a></li><li><a href="#v:initialCtx">initialCtx</a> :: ctx</li><li><a href="#v:updateCtx">updateCtx</a> :: ctx -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; ctx</li><li><a href="#v:finalize">finalize</a> :: ctx -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d</li><li><a href="#v:hash">hash</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> ctx d =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; d</li><li><a href="#v:hash-39-">hash'</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> ctx d =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d</li></ul></li><li class="src short"><a href="#v:hashFunc-39-">hashFunc'</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> c d =&gt; d -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d</li><li class="src short"><a href="#v:hashFunc">hashFunc</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> c d =&gt; d -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; d</li><li class="src short"><span class="keyword">class</span> <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> k =&gt; <a href="#t:BlockCipher">BlockCipher</a> k <span class="keyword">where</span><ul class="subs"><li><a href="#v:blockSize">blockSize</a> :: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:BitLength">BitLength</a></li><li><a href="#v:encryptBlock">encryptBlock</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li><a href="#v:decryptBlock">decryptBlock</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li><a href="#v:buildKey">buildKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> k</li><li><a href="#v:keyLength">keyLength</a> :: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:BitLength">BitLength</a></li><li><a href="#v:ecb">ecb</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li><a href="#v:unEcb">unEcb</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li><a href="#v:cbc">cbc</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unCbc">unCbc</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:ctr">ctr</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unCtr">unCtr</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:ctrLazy">ctrLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unCtrLazy">unCtrLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:cfb">cfb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unCfb">unCfb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:ofb">ofb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unOfb">unOfb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:cbcLazy">cbcLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unCbcLazy">unCbcLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:sivLazy">sivLazy</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></li><li><a href="#v:unSivLazy">unSivLazy</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></li><li><a href="#v:siv">siv</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li><a href="#v:unSiv">unSiv</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li><a href="#v:ecbLazy">ecbLazy</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></li><li><a href="#v:unEcbLazy">unEcbLazy</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></li><li><a href="#v:cfbLazy">cfbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unCfbLazy">unCfbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:ofbLazy">ofbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li><li><a href="#v:unOfbLazy">unOfbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k)</li></ul></li><li class="src short"><a href="#v:blockSizeBytes">blockSizeBytes</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:ByteLength">ByteLength</a></li><li class="src short"><a href="#v:keyLengthBytes">keyLengthBytes</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:ByteLength">ByteLength</a></li><li class="src short"><a href="#v:buildKeyIO">buildKeyIO</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> k</li><li class="src short"><a href="#v:buildKeyGen">buildKeyGen</a> :: (<a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (k, g)</li><li class="src short"><span class="keyword">class</span> <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> k =&gt; <a href="#t:StreamCipher">StreamCipher</a> k iv | k -&gt; iv <span class="keyword">where</span><ul class="subs"><li><a href="#v:buildStreamKey">buildStreamKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> k</li><li><a href="#v:encryptStream">encryptStream</a> :: k -&gt; iv -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, iv)</li><li><a href="#v:decryptStream">decryptStream</a> :: k -&gt; iv -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, iv)</li><li><a href="#v:streamKeyLength">streamKeyLength</a> :: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:BitLength">BitLength</a></li></ul></li><li class="src short"><a href="#v:buildStreamKeyIO">buildStreamKeyIO</a> :: <a href="Crypto-Classes.html#t:StreamCipher">StreamCipher</a> k iv =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> k</li><li class="src short"><a href="#v:buildStreamKeyGen">buildStreamKeyGen</a> :: (<a href="Crypto-Classes.html#t:StreamCipher">StreamCipher</a> k iv, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (k, g)</li><li class="src short"><span class="keyword">class</span> <a href="#t:AsymCipher">AsymCipher</a> p v | p -&gt; v, v -&gt; p <span class="keyword">where</span><ul class="subs"><li><a href="#v:buildKeyPair">buildKeyPair</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g)</li><li><a href="#v:encryptAsym">encryptAsym</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; p -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, g)</li><li><a href="#v:decryptAsym">decryptAsym</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, g)</li><li><a href="#v:publicKeyLength">publicKeyLength</a> :: p -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a></li><li><a href="#v:privateKeyLength">privateKeyLength</a> :: v -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a></li></ul></li><li class="src short"><a href="#v:buildKeyPairIO">buildKeyPairIO</a> :: <a href="Crypto-Classes.html#t:AsymCipher">AsymCipher</a> p v =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (p, v))</li><li class="src short"><a href="#v:buildKeyPairGen">buildKeyPairGen</a> :: (<a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g, <a href="Crypto-Classes.html#t:AsymCipher">AsymCipher</a> p v) =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g)</li><li class="src short"><span class="keyword">class</span> (<a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> p, <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> v) =&gt; <a href="#t:Signing">Signing</a> p v | p -&gt; v, v -&gt; p <span class="keyword">where</span><ul class="subs"><li><a href="#v:sign">sign</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, g)</li><li><a href="#v:verify">verify</a> :: p -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:buildSigningPair">buildSigningPair</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g)</li><li><a href="#v:signingKeyLength">signingKeyLength</a> :: v -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a></li><li><a href="#v:verifyingKeyLength">verifyingKeyLength</a> :: p -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a></li></ul></li><li class="src short"><a href="#v:buildSigningKeyPairIO">buildSigningKeyPairIO</a> :: <a href="Crypto-Classes.html#t:Signing">Signing</a> p v =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (p, v))</li><li class="src short"><a href="#v:buildSigningKeyPairGen">buildSigningKeyPairGen</a> :: (<a href="Crypto-Classes.html#t:Signing">Signing</a> p v, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g)</li><li class="src short"><a href="#v:encode">encode</a> :: <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> a =&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:zeroIV">zeroIV</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="Crypto-Types.html#t:IV">IV</a> k</li><li class="src short"><a href="#v:incIV">incIV</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k</li><li class="src short"><a href="#v:getIV">getIV</a> :: (<a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="Crypto-Types.html#t:IV">IV</a> k, g)</li><li class="src short"><a href="#v:getIVIO">getIVIO</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="Crypto-Types.html#t:IV">IV</a> k)</li><li class="src short"><a href="#v:chunkFor">chunkFor</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>]</li><li class="src short"><a href="#v:chunkFor-39-">chunkFor'</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>]</li><li class="src short">module <a href="Crypto-Util.html">Crypto.Util</a></li><li class="src short">module <a href="Crypto-Types.html">Crypto.Types</a></li></ul></div><div id="interface"><h1 id="g:1">Hash class and helper functions</h1><div class="top"><p class="src"><span class="keyword">class</span> (<a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> d) =&gt; <a name="t:Hash" class="def">Hash</a> ctx d | d -&gt; ctx, ctx -&gt; d <span class="keyword">where</span> <a href="src/Crypto-Classes.html#Hash" class="link">Source</a></p><div class="doc"><p>The Hash class is intended as the generic interface
 targeted by maintainers of Haskell digest implementations.
 Using this generic interface, higher level functions
 such as <code><a href="Crypto-Classes.html#v:hash">hash</a></code> and <code><a href="Crypto-Classes.html#v:hash-39-">hash'</a></code> provide a useful API
 for comsumers of hash implementations.</p><p>Any instantiated implementation must handle unaligned data.</p><p>Minimum complete definition: <code><a href="Crypto-Classes.html#v:outputLength">outputLength</a></code>, <code><a href="Crypto-Classes.html#v:blockLength">blockLength</a></code>, <code><a href="Crypto-Classes.html#v:initialCtx">initialCtx</a></code>,
 <code><a href="Crypto-Classes.html#v:updateCtx">updateCtx</a></code>, and <code><a href="Crypto-Classes.html#v:finalize">finalize</a></code>.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Crypto-Classes.html#v:outputLength">outputLength</a>, <a href="Crypto-Classes.html#v:blockLength">blockLength</a>, <a href="Crypto-Classes.html#v:initialCtx">initialCtx</a>, <a href="Crypto-Classes.html#v:updateCtx">updateCtx</a>, <a href="Crypto-Classes.html#v:finalize">finalize</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:outputLength" class="def">outputLength</a> <a href="src/Crypto-Classes.html#outputLength" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> d <a href="Crypto-Types.html#t:BitLength">BitLength</a></td><td class="doc"><p>The size of the digest when encoded</p></td></tr></table></div><p class="src"><a name="v:blockLength" class="def">blockLength</a> <a href="src/Crypto-Classes.html#blockLength" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> d <a href="Crypto-Types.html#t:BitLength">BitLength</a></td><td class="doc"><p>The amount of data operated on in each round of the digest computation</p></td></tr></table></div><p class="src"><a name="v:initialCtx" class="def">initialCtx</a> <a href="src/Crypto-Classes.html#initialCtx" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: ctx</td><td class="doc"><p>An initial context, provided with the first call to <code><a href="Crypto-Classes.html#v:updateCtx">updateCtx</a></code></p></td></tr></table></div><p class="src"><a name="v:updateCtx" class="def">updateCtx</a> <a href="src/Crypto-Classes.html#updateCtx" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: ctx</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; ctx</td><td class="doc"><p>Used to update a context, repeatedly called until all data is exhausted
   must operate correctly for imputs of <code>n*blockLength</code> bytes for <code>n <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:elem">elem</a></code> [0..]</code></p></td></tr></table></div><p class="src"><a name="v:finalize" class="def">finalize</a> <a href="src/Crypto-Classes.html#finalize" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: ctx</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; d</td><td class="doc"><p>Finializing a context, plus any message data less than the block size, into a digest</p></td></tr></table></div><p class="src"><a name="v:hash" class="def">hash</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> ctx d =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hash" class="link">Source</a></p><div class="doc"><p>Hash a lazy ByteString, creating a digest</p></div><p class="src"><a name="v:hash-39-" class="def">hash'</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> ctx d =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hash%27" class="link">Source</a></p><div class="doc"><p>Hash a strict ByteString, creating a digest</p></div></div></div><div class="top"><p class="src"><a name="v:hashFunc-39-" class="def">hashFunc'</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> c d =&gt; d -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hashFunc%27" class="link">Source</a></p><div class="doc"><p>Obtain a strict hash function whose result is the same type
 as the given digest, which is discarded.  If the type is already inferred then
 consider using the <code><a href="Crypto-Classes.html#v:hash-39-">hash'</a></code> function instead.</p></div></div><div class="top"><p class="src"><a name="v:hashFunc" class="def">hashFunc</a> :: <a href="Crypto-Classes.html#t:Hash">Hash</a> c d =&gt; d -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hashFunc" class="link">Source</a></p><div class="doc"><p>Obtain a lazy hash function whose result is the same type
 as the given digest, which is discarded.  If the type is already inferred then
 consider using the <code><a href="Crypto-Classes.html#v:hash">hash</a></code> function instead.</p></div></div><h1 id="g:2">Cipher classes and helper functions</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> k =&gt; <a name="t:BlockCipher" class="def">BlockCipher</a> k <span class="keyword">where</span> <a href="src/Crypto-Classes.html#BlockCipher" class="link">Source</a></p><div class="doc"><p>The BlockCipher class is intended as the generic interface
 targeted by maintainers of Haskell cipher implementations.</p><p>Minimum complete definition: blockSize, encryptBlock, decryptBlock,
 buildKey, and keyLength.</p><p>Instances must handle unaligned data</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Crypto-Classes.html#v:blockSize">blockSize</a>, <a href="Crypto-Classes.html#v:encryptBlock">encryptBlock</a>, <a href="Crypto-Classes.html#v:decryptBlock">decryptBlock</a>, <a href="Crypto-Classes.html#v:buildKey">buildKey</a>, <a href="Crypto-Classes.html#v:keyLength">keyLength</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:blockSize" class="def">blockSize</a> <a href="src/Crypto-Classes.html#blockSize" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:BitLength">BitLength</a></td><td class="doc"><p>The size of a single block; the smallest unit on which the cipher operates.</p></td></tr></table></div><p class="src"><a name="v:encryptBlock" class="def">encryptBlock</a> <a href="src/Crypto-Classes.html#encryptBlock" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: k</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>encrypt data of size <code>n*blockSize</code> where <code>n <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:elem">elem</a></code> [0..]</code>  (ecb encryption)</p></td></tr></table></div><p class="src"><a name="v:decryptBlock" class="def">decryptBlock</a> <a href="src/Crypto-Classes.html#decryptBlock" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: k</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>decrypt data of size <code>n*blockSize</code> where <code>n <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Foldable.html#v:elem">elem</a></code> [0..]</code>  (ecb decryption)</p></td></tr></table></div><p class="src"><a name="v:buildKey" class="def">buildKey</a> <a href="src/Crypto-Classes.html#buildKey" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> k</td><td class="doc"><p>smart constructor for keys from a bytestring.</p></td></tr></table></div><p class="src"><a name="v:keyLength" class="def">keyLength</a> <a href="src/Crypto-Classes.html#keyLength" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:BitLength">BitLength</a></td><td class="doc"><p>length of the cryptographic key</p></td></tr></table></div><p class="src"><a name="v:ecb" class="def">ecb</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#ecb" class="link">Source</a></p><div class="doc"><p>Electronic Cookbook (encryption)</p></div><p class="src"><a name="v:unEcb" class="def">unEcb</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unEcb" class="link">Source</a></p><div class="doc"><p>Electronic Cookbook (decryption)</p></div><p class="src"><a name="v:cbc" class="def">cbc</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#cbc" class="link">Source</a></p><div class="doc"><p>Cipherblock Chaining (encryption)</p></div><p class="src"><a name="v:unCbc" class="def">unCbc</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unCbc" class="link">Source</a></p><div class="doc"><p>Cipherblock Chaining (decryption)</p></div><p class="src"><a name="v:ctr" class="def">ctr</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#ctr" class="link">Source</a></p><div class="doc"><p>Counter (encryption)</p></div><p class="src"><a name="v:unCtr" class="def">unCtr</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unCtr" class="link">Source</a></p><div class="doc"><p>Counter (decryption)</p></div><p class="src"><a name="v:ctrLazy" class="def">ctrLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#ctrLazy" class="link">Source</a></p><div class="doc"><p>Counter (encryption)</p></div><p class="src"><a name="v:unCtrLazy" class="def">unCtrLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unCtrLazy" class="link">Source</a></p><div class="doc"><p>Counter (decryption)</p></div><p class="src"><a name="v:cfb" class="def">cfb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#cfb" class="link">Source</a></p><div class="doc"><p>Ciphertext feedback (encryption)</p></div><p class="src"><a name="v:unCfb" class="def">unCfb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unCfb" class="link">Source</a></p><div class="doc"><p>Ciphertext feedback (decryption)</p></div><p class="src"><a name="v:ofb" class="def">ofb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#ofb" class="link">Source</a></p><div class="doc"><p>Output feedback (encryption)</p></div><p class="src"><a name="v:unOfb" class="def">unOfb</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unOfb" class="link">Source</a></p><div class="doc"><p>Output feedback (decryption)</p></div><p class="src"><a name="v:cbcLazy" class="def">cbcLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#cbcLazy" class="link">Source</a></p><div class="doc"><p>Cipher block chaining encryption for lazy bytestrings</p></div><p class="src"><a name="v:unCbcLazy" class="def">unCbcLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unCbcLazy" class="link">Source</a></p><div class="doc"><p>Cipher block chaining decryption for lazy bytestrings</p></div><p class="src"><a name="v:sivLazy" class="def">sivLazy</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#sivLazy" class="link">Source</a></p><div class="doc"><p>SIV (Synthetic IV) mode for lazy bytestrings. The third argument is
 the optional list of bytestrings to be authenticated but not
 encrypted As required by the specification this algorithm may
 return nothing when certain constraints aren't met.</p></div><p class="src"><a name="v:unSivLazy" class="def">unSivLazy</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unSivLazy" class="link">Source</a></p><div class="doc"><p>SIV (Synthetic IV) for lazy bytestrings.  The third argument is the
 optional list of bytestrings to be authenticated but not encrypted.
 As required by the specification this algorithm may return nothing
 when authentication fails.</p></div><p class="src"><a name="v:siv" class="def">siv</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#siv" class="link">Source</a></p><div class="doc"><p>SIV (Synthetic IV) mode for strict bytestrings.  First argument is
 the optional list of bytestrings to be authenticated but not
 encrypted.  As required by the specification this algorithm may
 return nothing when certain constraints aren't met.</p></div><p class="src"><a name="v:unSiv" class="def">unSiv</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unSiv" class="link">Source</a></p><div class="doc"><p>SIV (Synthetic IV) for strict bytestrings First argument is the
 optional list of bytestrings to be authenticated but not encrypted
 As required by the specification this algorithm may return nothing
 when authentication fails.</p></div><p class="src"><a name="v:ecbLazy" class="def">ecbLazy</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#ecbLazy" class="link">Source</a></p><div class="doc"><p>Cook book mode - not really a mode at all.  If you don't know what you're doing, don't use this mode^H^H^H^H library.</p></div><p class="src"><a name="v:unEcbLazy" class="def">unEcbLazy</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unEcbLazy" class="link">Source</a></p><div class="doc"><p>ECB decrypt, complementary to <code><a href="Crypto-Classes.html#v:ecb">ecb</a></code>.</p></div><p class="src"><a name="v:cfbLazy" class="def">cfbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#cfbLazy" class="link">Source</a></p><div class="doc"><p>Ciphertext feed-back encryption mode for lazy bytestrings (with s
 == blockSize)</p></div><p class="src"><a name="v:unCfbLazy" class="def">unCfbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unCfbLazy" class="link">Source</a></p><div class="doc"><p>Ciphertext feed-back decryption mode for lazy bytestrings (with s
 == blockSize)</p></div><p class="src"><a name="v:ofbLazy" class="def">ofbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#ofbLazy" class="link">Source</a></p><div class="doc"><p>Output feedback mode for lazy bytestrings</p></div><p class="src"><a name="v:unOfbLazy" class="def">unOfbLazy</a> :: k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>, <a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#unOfbLazy" class="link">Source</a></p><div class="doc"><p>Output feedback mode for lazy bytestrings</p></div></div></div><div class="top"><p class="src"><a name="v:blockSizeBytes" class="def">blockSizeBytes</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:ByteLength">ByteLength</a> <a href="src/Crypto-Classes.html#blockSizeBytes" class="link">Source</a></p><div class="doc"><p>The number of bytes in a block cipher block</p></div></div><div class="top"><p class="src"><a name="v:keyLengthBytes" class="def">keyLengthBytes</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:ByteLength">ByteLength</a> <a href="src/Crypto-Classes.html#keyLengthBytes" class="link">Source</a></p><div class="doc"><p>The number of bytes in a block cipher key (assuming it is an even
 multiple of 8 bits)</p></div></div><div class="top"><p class="src"><a name="v:buildKeyIO" class="def">buildKeyIO</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> k <a href="src/Crypto-Classes.html#buildKeyIO" class="link">Source</a></p><div class="doc"><p>Build a symmetric key using the system entropy (see <code><a href="System.html#v:Entropy">Entropy</a></code>)</p></div></div><div class="top"><p class="src"><a name="v:buildKeyGen" class="def">buildKeyGen</a> :: (<a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (k, g) <a href="src/Crypto-Classes.html#buildKeyGen" class="link">Source</a></p><div class="doc"><p>Build a symmetric key using a given <code><a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a></code></p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> k =&gt; <a name="t:StreamCipher" class="def">StreamCipher</a> k iv | k -&gt; iv <span class="keyword">where</span> <a href="src/Crypto-Classes.html#StreamCipher" class="link">Source</a></p><div class="doc"><p>A stream cipher class.  Instance are expected to work on messages as small as one byte
 The length of the resulting cipher text should be equal
 to the length of the input message.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:buildStreamKey" class="def">buildStreamKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Maybe.html#t:Maybe">Maybe</a> k <a href="src/Crypto-Classes.html#buildStreamKey" class="link">Source</a></p><p class="src"><a name="v:encryptStream" class="def">encryptStream</a> :: k -&gt; iv -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, iv) <a href="src/Crypto-Classes.html#encryptStream" class="link">Source</a></p><p class="src"><a name="v:decryptStream" class="def">decryptStream</a> :: k -&gt; iv -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, iv) <a href="src/Crypto-Classes.html#decryptStream" class="link">Source</a></p><p class="src"><a name="v:streamKeyLength" class="def">streamKeyLength</a> :: <a href="file:///usr/share/doc/libghc-tagged-doc/html/Data-Tagged.html#t:Tagged">Tagged</a> k <a href="Crypto-Types.html#t:BitLength">BitLength</a> <a href="src/Crypto-Classes.html#streamKeyLength" class="link">Source</a></p></div></div><div class="top"><p class="src"><a name="v:buildStreamKeyIO" class="def">buildStreamKeyIO</a> :: <a href="Crypto-Classes.html#t:StreamCipher">StreamCipher</a> k iv =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> k <a href="src/Crypto-Classes.html#buildStreamKeyIO" class="link">Source</a></p><div class="doc"><p>Build a stream key using the system random generator</p></div></div><div class="top"><p class="src"><a name="v:buildStreamKeyGen" class="def">buildStreamKeyGen</a> :: (<a href="Crypto-Classes.html#t:StreamCipher">StreamCipher</a> k iv, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (k, g) <a href="src/Crypto-Classes.html#buildStreamKeyGen" class="link">Source</a></p><div class="doc"><p>Build a stream key using the provided random generator</p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a name="t:AsymCipher" class="def">AsymCipher</a> p v | p -&gt; v, v -&gt; p <span class="keyword">where</span> <a href="src/Crypto-Classes.html#AsymCipher" class="link">Source</a></p><div class="doc"><p>Asymetric ciphers (common ones being RSA or EC based)</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:buildKeyPair" class="def">buildKeyPair</a> <a href="src/Crypto-Classes.html#buildKeyPair" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g)</td><td class="doc"><p>build a public/private key pair using the provided generator</p></td></tr></table></div><p class="src"><a name="v:encryptAsym" class="def">encryptAsym</a> <a href="src/Crypto-Classes.html#encryptAsym" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; p</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, g)</td><td class="doc"><p>Asymetric encryption</p></td></tr></table></div><p class="src"><a name="v:decryptAsym" class="def">decryptAsym</a> <a href="src/Crypto-Classes.html#decryptAsym" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; v</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, g)</td><td class="doc"><p>Asymetric decryption</p></td></tr></table></div><p class="src"><a name="v:publicKeyLength" class="def">publicKeyLength</a> :: p -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> <a href="src/Crypto-Classes.html#publicKeyLength" class="link">Source</a></p><p class="src"><a name="v:privateKeyLength" class="def">privateKeyLength</a> :: v -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> <a href="src/Crypto-Classes.html#privateKeyLength" class="link">Source</a></p></div></div><div class="top"><p class="src"><a name="v:buildKeyPairIO" class="def">buildKeyPairIO</a> :: <a href="Crypto-Classes.html#t:AsymCipher">AsymCipher</a> p v =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (p, v)) <a href="src/Crypto-Classes.html#buildKeyPairIO" class="link">Source</a></p><div class="doc"><p>Build a pair of asymmetric keys using the system random generator.</p></div></div><div class="top"><p class="src"><a name="v:buildKeyPairGen" class="def">buildKeyPairGen</a> :: (<a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g, <a href="Crypto-Classes.html#t:AsymCipher">AsymCipher</a> p v) =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g) <a href="src/Crypto-Classes.html#buildKeyPairGen" class="link">Source</a></p><div class="doc"><p>Flipped <code><a href="Crypto-Classes.html#v:buildKeyPair">buildKeyPair</a></code> for ease of use with state monads.</p></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> p, <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> v) =&gt; <a name="t:Signing" class="def">Signing</a> p v | p -&gt; v, v -&gt; p <span class="keyword">where</span> <a href="src/Crypto-Classes.html#Signing" class="link">Source</a></p><div class="doc"><p>A class for signing operations which inherently can not be as generic
 as asymetric ciphers (ex: DSA).</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:sign" class="def">sign</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>, g) <a href="src/Crypto-Classes.html#sign" class="link">Source</a></p><p class="src"><a name="v:verify" class="def">verify</a> :: p -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Crypto-Classes.html#verify" class="link">Source</a></p><p class="src"><a name="v:buildSigningPair" class="def">buildSigningPair</a> :: <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g =&gt; g -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g) <a href="src/Crypto-Classes.html#buildSigningPair" class="link">Source</a></p><p class="src"><a name="v:signingKeyLength" class="def">signingKeyLength</a> :: v -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> <a href="src/Crypto-Classes.html#signingKeyLength" class="link">Source</a></p><p class="src"><a name="v:verifyingKeyLength" class="def">verifyingKeyLength</a> :: p -&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> <a href="src/Crypto-Classes.html#verifyingKeyLength" class="link">Source</a></p></div></div><div class="top"><p class="src"><a name="v:buildSigningKeyPairIO" class="def">buildSigningKeyPairIO</a> :: <a href="Crypto-Classes.html#t:Signing">Signing</a> p v =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (p, v)) <a href="src/Crypto-Classes.html#buildSigningKeyPairIO" class="link">Source</a></p><div class="doc"><p>Build a signing key using the system random generator</p></div></div><div class="top"><p class="src"><a name="v:buildSigningKeyPairGen" class="def">buildSigningKeyPairGen</a> :: (<a href="Crypto-Classes.html#t:Signing">Signing</a> p v, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; <a href="Crypto-Types.html#t:BitLength">BitLength</a> -&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> ((p, v), g) <a href="src/Crypto-Classes.html#buildSigningKeyPairGen" class="link">Source</a></p><div class="doc"><p>Flipped <code><a href="Crypto-Classes.html#v:buildSigningPair">buildSigningPair</a></code> for ease of use with state monads.</p></div></div><h1 id="g:3">Misc helper functions</h1><div class="top"><p class="src"><a name="v:encode" class="def">encode</a> :: <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> a =&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a></p><div class="doc"><p>Encode a value using binary serialization to a strict ByteString.</p></div></div><div class="top"><p class="src"><a name="v:zeroIV" class="def">zeroIV</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="Crypto-Types.html#t:IV">IV</a> k <a href="src/Crypto-Classes.html#zeroIV" class="link">Source</a></p><div class="doc"><p>Obtain an <code><a href="Crypto-Types.html#t:IV">IV</a></code> made only of zeroes</p></div></div><div class="top"><p class="src"><a name="v:incIV" class="def">incIV</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="Crypto-Types.html#t:IV">IV</a> k -&gt; <a href="Crypto-Types.html#t:IV">IV</a> k <a href="src/Crypto-Classes.html#incIV" class="link">Source</a></p><div class="doc"><p>Increase an <code><a href="Crypto-Types.html#t:IV">IV</a></code> by one.  This is way faster than decoding,
 increasing, encoding</p></div></div><div class="top"><p class="src"><a name="v:getIV" class="def">getIV</a> :: (<a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k, <a href="Crypto-Random.html#t:CryptoRandomGen">CryptoRandomGen</a> g) =&gt; g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Either.html#t:Either">Either</a> <a href="Crypto-Random.html#t:GenError">GenError</a> (<a href="Crypto-Types.html#t:IV">IV</a> k, g) <a href="src/Crypto-Classes.html#getIV" class="link">Source</a></p><div class="doc"><p>Obtain an <code><a href="Crypto-Types.html#t:IV">IV</a></code> using the provided CryptoRandomGenerator.</p></div></div><div class="top"><p class="src"><a name="v:getIVIO" class="def">getIVIO</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (<a href="Crypto-Types.html#t:IV">IV</a> k) <a href="src/Crypto-Classes.html#getIVIO" class="link">Source</a></p><div class="doc"><p>Obtain an <code><a href="Crypto-Types.html#t:IV">IV</a></code> using the system entropy (see <code><a href="System.html#v:Entropy">Entropy</a></code>)</p></div></div><div class="top"><p class="src"><a name="v:chunkFor" class="def">chunkFor</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>] <a href="src/Crypto-Classes.html#chunkFor" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:chunkFor-39-" class="def">chunkFor'</a> :: <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.6.0/Data-ByteString.html#t:ByteString">ByteString</a>] <a href="src/Crypto-Classes.html#chunkFor%27" class="link">Source</a></p></div><div class="top"><p class="src">module <a href="Crypto-Util.html">Crypto.Util</a></p></div><div class="top"><p class="src">module <a href="Crypto-Types.html">Crypto.Types</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>