This file is indexed.

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

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
<!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 src="file:///usr/share/javascript/mathjax/MathJax.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><li><a href="#section.orphans">Orphan instances</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.9.1.0/Data-Eq.html#t:Eq">Eq</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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"></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.8.1/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.8.1/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"></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.9.1.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.9.1.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"></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.9.1.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.9.1.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"></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.9.1.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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.9.1.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"></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.9.1.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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.9.1.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.8.1/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.9.1.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.9.1.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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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.9.1.0/Data-Eq.html#t:Eq">Eq</a> d, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> d) =&gt; <a id="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> <a href="#t:Hash" class="selflink">#</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 id="v:outputLength" class="def">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> <a href="src/Crypto-Classes.html#outputLength" class="link">Source</a> <a href="#v:outputLength" class="selflink">#</a></p><p class="src"><a id="v:blockLength" class="def">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> <a href="src/Crypto-Classes.html#blockLength" class="link">Source</a> <a href="#v:blockLength" class="selflink">#</a></p><p class="src"><a id="v:initialCtx" class="def">initialCtx</a> :: ctx <a href="src/Crypto-Classes.html#initialCtx" class="link">Source</a> <a href="#v:initialCtx" class="selflink">#</a></p><p class="src"><a id="v:updateCtx" class="def">updateCtx</a> :: ctx -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; ctx <a href="src/Crypto-Classes.html#updateCtx" class="link">Source</a> <a href="#v:updateCtx" class="selflink">#</a></p><p class="src"><a id="v:finalize" class="def">finalize</a> :: ctx -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#finalize" class="link">Source</a> <a href="#v:finalize" class="selflink">#</a></p><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hash" class="link">Source</a> <a href="#v:hash" class="selflink">#</a></p><div class="doc"><p>Hash a lazy ByteString, creating a digest</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hash%27" class="link">Source</a> <a href="#v:hash-39-" class="selflink">#</a></p><div class="doc"><p>Hash a strict ByteString, creating a digest</p></div></div></div><div class="top"><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hashFunc%27" class="link">Source</a> <a href="#v:hashFunc-39-" class="selflink">#</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 id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; d <a href="src/Crypto-Classes.html#hashFunc" class="link">Source</a> <a href="#v:hashFunc" class="selflink">#</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 id="t:BlockCipher" class="def">BlockCipher</a> k <span class="keyword">where</span> <a href="src/Crypto-Classes.html#BlockCipher" class="link">Source</a> <a href="#t:BlockCipher" class="selflink">#</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 id="v:blockSize" class="def">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> <a href="src/Crypto-Classes.html#blockSize" class="link">Source</a> <a href="#v:blockSize" class="selflink">#</a></p><p class="src"><a id="v:encryptBlock" class="def">encryptBlock</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#encryptBlock" class="link">Source</a> <a href="#v:encryptBlock" class="selflink">#</a></p><p class="src"><a id="v:decryptBlock" class="def">decryptBlock</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#decryptBlock" class="link">Source</a> <a href="#v:decryptBlock" class="selflink">#</a></p><p class="src"><a id="v:buildKey" class="def">buildKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> k <a href="src/Crypto-Classes.html#buildKey" class="link">Source</a> <a href="#v:buildKey" class="selflink">#</a></p><p class="src"><a id="v:keyLength" class="def">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> <a href="src/Crypto-Classes.html#keyLength" class="link">Source</a> <a href="#v:keyLength" class="selflink">#</a></p><p class="src"><a id="v:ecb" class="def">ecb</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#ecb" class="link">Source</a> <a href="#v:ecb" class="selflink">#</a></p><div class="doc"><p>Electronic Cookbook (encryption)</p></div><p class="src"><a id="v:unEcb" class="def">unEcb</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unEcb" class="link">Source</a> <a href="#v:unEcb" class="selflink">#</a></p><div class="doc"><p>Electronic Cookbook (decryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:cbc" class="selflink">#</a></p><div class="doc"><p>Cipherblock Chaining (encryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unCbc" class="selflink">#</a></p><div class="doc"><p>Cipherblock Chaining (decryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:ctr" class="selflink">#</a></p><div class="doc"><p>Counter (encryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unCtr" class="selflink">#</a></p><div class="doc"><p>Counter (decryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:ctrLazy" class="selflink">#</a></p><div class="doc"><p>Counter (encryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unCtrLazy" class="selflink">#</a></p><div class="doc"><p>Counter (decryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:cfb" class="selflink">#</a></p><div class="doc"><p>Ciphertext feedback (encryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unCfb" class="selflink">#</a></p><div class="doc"><p>Ciphertext feedback (decryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:ofb" class="selflink">#</a></p><div class="doc"><p>Output feedback (encryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unOfb" class="selflink">#</a></p><div class="doc"><p>Output feedback (decryption)</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:cbcLazy" class="selflink">#</a></p><div class="doc"><p>Cipher block chaining encryption for lazy bytestrings</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unCbcLazy" class="selflink">#</a></p><div class="doc"><p>Cipher block chaining decryption for lazy bytestrings</p></div><p class="src"><a id="v:sivLazy" class="def">sivLazy</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#sivLazy" class="link">Source</a> <a href="#v:sivLazy" class="selflink">#</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 id="v:unSivLazy" class="def">unSivLazy</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unSivLazy" class="link">Source</a> <a href="#v:unSivLazy" class="selflink">#</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 id="v:siv" class="def">siv</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#siv" class="link">Source</a> <a href="#v:siv" class="selflink">#</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 id="v:unSiv" class="def">unSiv</a> :: k -&gt; k -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unSiv" class="link">Source</a> <a href="#v:unSiv" class="selflink">#</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 id="v:ecbLazy" class="def">ecbLazy</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#ecbLazy" class="link">Source</a> <a href="#v:ecbLazy" class="selflink">#</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 id="v:unEcbLazy" class="def">unEcbLazy</a> :: k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Crypto-Classes.html#unEcbLazy" class="link">Source</a> <a href="#v:unEcbLazy" class="selflink">#</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 id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:cfbLazy" class="selflink">#</a></p><div class="doc"><p>Ciphertext feed-back encryption mode for lazy bytestrings (with s
 == blockSize)</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unCfbLazy" class="selflink">#</a></p><div class="doc"><p>Ciphertext feed-back decryption mode for lazy bytestrings (with s
 == blockSize)</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:ofbLazy" class="selflink">#</a></p><div class="doc"><p>Output feedback mode for lazy bytestrings</p></div><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/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> <a href="#v:unOfbLazy" class="selflink">#</a></p><div class="doc"><p>Output feedback mode for lazy bytestrings</p></div></div></div><div class="top"><p class="src"><a id="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> <a href="#v:blockSizeBytes" class="selflink">#</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 id="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> <a href="#v:keyLengthBytes" class="selflink">#</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 id="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.9.1.0/System-IO.html#t:IO">IO</a> k <a href="src/Crypto-Classes.html#buildKeyIO" class="link">Source</a> <a href="#v:buildKeyIO" class="selflink">#</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 id="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.9.1.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> <a href="#v:buildKeyGen" class="selflink">#</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 id="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> <a href="#t:StreamCipher" class="selflink">#</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 minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Crypto-Classes.html#v:buildStreamKey">buildStreamKey</a>, <a href="Crypto-Classes.html#v:encryptStream">encryptStream</a>, <a href="Crypto-Classes.html#v:decryptStream">decryptStream</a>, <a href="Crypto-Classes.html#v:streamKeyLength">streamKeyLength</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:buildStreamKey" class="def">buildStreamKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> k <a href="src/Crypto-Classes.html#buildStreamKey" class="link">Source</a> <a href="#v:buildStreamKey" class="selflink">#</a></p><p class="src"><a id="v:encryptStream" class="def">encryptStream</a> :: k -&gt; iv -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, iv) <a href="src/Crypto-Classes.html#encryptStream" class="link">Source</a> <a href="#v:encryptStream" class="selflink">#</a></p><p class="src"><a id="v:decryptStream" class="def">decryptStream</a> :: k -&gt; iv -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, iv) <a href="src/Crypto-Classes.html#decryptStream" class="link">Source</a> <a href="#v:decryptStream" class="selflink">#</a></p><p class="src"><a id="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> <a href="#v:streamKeyLength" class="selflink">#</a></p></div></div><div class="top"><p class="src"><a id="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.9.1.0/System-IO.html#t:IO">IO</a> k <a href="src/Crypto-Classes.html#buildStreamKeyIO" class="link">Source</a> <a href="#v:buildStreamKeyIO" class="selflink">#</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 id="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.9.1.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> <a href="#v:buildStreamKeyGen" class="selflink">#</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 id="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> <a href="#t:AsymCipher" class="selflink">#</a></p><div class="doc"><p>Asymetric ciphers (common ones being RSA or EC based)</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Crypto-Classes.html#v:buildKeyPair">buildKeyPair</a>, <a href="Crypto-Classes.html#v:encryptAsym">encryptAsym</a>, <a href="Crypto-Classes.html#v:decryptAsym">decryptAsym</a>, <a href="Crypto-Classes.html#v:publicKeyLength">publicKeyLength</a>, <a href="Crypto-Classes.html#v:privateKeyLength">privateKeyLength</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:buildKeyPair" class="def">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.9.1.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#buildKeyPair" class="link">Source</a> <a href="#v:buildKeyPair" class="selflink">#</a></p><p class="src"><a id="v:encryptAsym" class="def">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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, g) <a href="src/Crypto-Classes.html#encryptAsym" class="link">Source</a> <a href="#v:encryptAsym" class="selflink">#</a></p><p class="src"><a id="v:decryptAsym" class="def">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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, g) <a href="src/Crypto-Classes.html#decryptAsym" class="link">Source</a> <a href="#v:decryptAsym" class="selflink">#</a></p><p class="src"><a id="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> <a href="#v:publicKeyLength" class="selflink">#</a></p><p class="src"><a id="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> <a href="#v:privateKeyLength" class="selflink">#</a></p></div></div><div class="top"><p class="src"><a id="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.9.1.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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> <a href="#v:buildKeyPairIO" class="selflink">#</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 id="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.9.1.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> <a href="#v:buildKeyPairGen" class="selflink">#</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 id="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> <a href="#t:Signing" class="selflink">#</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 minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Crypto-Classes.html#v:sign">sign</a>, <a href="Crypto-Classes.html#v:verify">verify</a>, <a href="Crypto-Classes.html#v:buildSigningPair">buildSigningPair</a>, <a href="Crypto-Classes.html#v:signingKeyLength">signingKeyLength</a>, <a href="Crypto-Classes.html#v:verifyingKeyLength">verifyingKeyLength</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, g) <a href="src/Crypto-Classes.html#sign" class="link">Source</a> <a href="#v:sign" class="selflink">#</a></p><p class="src"><a id="v:verify" class="def">verify</a> :: p -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Crypto-Classes.html#verify" class="link">Source</a> <a href="#v:verify" class="selflink">#</a></p><p class="src"><a id="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.9.1.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> <a href="#v:buildSigningPair" class="selflink">#</a></p><p class="src"><a id="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> <a href="#v:signingKeyLength" class="selflink">#</a></p><p class="src"><a id="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> <a href="#v:verifyingKeyLength" class="selflink">#</a></p></div></div><div class="top"><p class="src"><a id="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.9.1.0/System-IO.html#t:IO">IO</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.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> <a href="#v:buildSigningKeyPairIO" class="selflink">#</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 id="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.9.1.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> <a href="#v:buildSigningKeyPairGen" class="selflink">#</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 id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="#v:encode" class="selflink">#</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 id="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> <a href="#v:zeroIV" class="selflink">#</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 id="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> <a href="#v:incIV" class="selflink">#</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 id="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.9.1.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> <a href="#v:getIV" class="selflink">#</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 id="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.9.1.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> <a href="#v:getIVIO" class="selflink">#</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 id="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.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>] <a href="src/Crypto-Classes.html#chunkFor" class="link">Source</a> <a href="#v:chunkFor" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="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.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>] <a href="src/Crypto-Classes.html#chunkFor%27" class="link">Source</a> <a href="#v:chunkFor-39-" class="selflink">#</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><h1>Orphan instances</h1><div id="section.orphans" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:Serialize:Serialize:1" class="instance expander" onclick="toggleSection('i:o:ic:Serialize:Serialize:1')"></span> <a href="Crypto-Classes.html#t:BlockCipher">BlockCipher</a> k =&gt; <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize.html#t:Serialize">Serialize</a> (<a href="Crypto-Types.html#t:IV">IV</a> k)</span> <a href="src/Crypto-Classes.html#line-721" class="link">Source</a> <a href="#v:-36-fSerializeIV" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:o:ic:Serialize:Serialize:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:put">put</a> :: <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize-Put.html#t:Putter">Putter</a> (<a href="Crypto-Types.html#t:IV">IV</a> k) <a href="#v:put" class="selflink">#</a></p><p class="src"><a href="#v:get">get</a> :: <a href="file:///usr/share/doc/libghc-cereal-doc/html/Data-Serialize-Get.html#t:Get">Get</a> (<a href="Crypto-Types.html#t:IV">IV</a> k) <a href="#v:get" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>