Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

release 0.31

  • Loading branch information...
commit 6fdafa1e97dad852d1b239943441ef0a69cec115 1 parent 91b6184
@froydnj authored
Showing with 201 additions and 168 deletions.
  1. +1 −1  NEWS
  2. +199 −166 doc/index.html
  3. +1 −1  ironclad.asd
View
2  NEWS
@@ -1,6 +1,6 @@
-*- mode: outline -*-
-* Version 0.31, released
+* Version 0.31, released 2012-07-01
** bug fixes
View
365 doc/index.html
@@ -1,190 +1,223 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
-<html><head><title>Ironclad</title><link type="text/css" title="default" rel="stylesheet" media="screen" href="style.css" /></head><body><h1>Ironclad</h1><p>Ironclad is a cryptography library written entirely in Common
-Lisp. It includes support for several popular <a href="#ciphers">ciphers</a>, <a href="#digests">digests</a>, and <a href="#macs">MACs</a>. Rudimentary support for <a href="#public-key">public-key
-cryptography</a> is included. For several implementations that support
-Gray Streams, <a href="#gray-streams">support</a> is included for
-convenient stream wrappers.</p><p>Ironclad was written primarily by Nathan Froyd (froydnj@gmail.com).</p><h2>Installation</h2><p>Ironclad can be downloaded at <a href="http://www.method-combination.net/lisp/files/ironclad.tar.gz">http://www.method-combination.net/lisp/files/ironclad.tar.gz</a>. The latest released version is 0.30. If you are feeling
-adventurous, you can download a bleeding-edge version at <a href="http://github.com/froydnj/ironclad">http://github.com/froydnj/ironclad</a>.</p><p>It comes with an ASDF system definition, so <tt>(ASDF:OOS
-'ASDF:LOAD-OP :IRONCLAD)</tt> should be all that you need to get started.
-The testsuite can be run by substituting <tt>ASDF:TEST-OP</tt> for <tt>ASDF:LOAD-OP</tt> in the form above.</p><p>Ironclad has been tested in the following implementations:</p><ul><li>SBCL x86/linux, x86-64/linux (primary development platforms)</li><li>SBCL x86-64/solaris, x86/darwin</li><li>CMUCL x86/linux</li><li>ABCL with Sun's 1.5.0 JVM</li><li>Lispworks 5.0.1 x86/linux</li><li>Lispworks 5.1.2 x86-64/darwin x86/windows</li><li>Allegro 8.0 x86/linux</li><li>Allegro 8.1 x86/linux, x86-64/linux, sparc/solaris</li><li>CLISP 2.41 x86/linux, x86/cygwin</li><li>Clozure Common Lisp 1.2 x86-64/Linux</li></ul><p>All included tests should pass successfully. If you use a platform
+<HTML><HEAD><TITLE>Ironclad</TITLE><LINK TYPE="text/css" TITLE="default" REL="stylesheet" MEDIA="screen" HREF="style.css" /></HEAD><BODY><H1>Ironclad</H1><P>Ironclad is a cryptography library written entirely in Common
+Lisp. It includes support for several popular <A HREF="#ciphers">ciphers</A>, <A HREF="#digests">digests</A>, and <A HREF="#macs">MACs</A>. Rudimentary support for <A HREF="#public-key">public-key
+cryptography</A> is included. For several implementations that support
+Gray Streams, <A HREF="#gray-streams">support</A> is included for
+convenient stream wrappers.</P><P>Ironclad was written primarily by Nathan Froyd (froydnj@gmail.com).</P><H2>Installation</H2><P>Ironclad can be downloaded at <A HREF="http://www.method-combination.net/lisp/files/ironclad.tar.gz">http://www.method-combination.net/lisp/files/ironclad.tar.gz</A>. The latest released version is 0.31. If you are feeling
+adventurous, you can download a bleeding-edge version at <A HREF="http://github.com/froydnj/ironclad">http://github.com/froydnj/ironclad</A>.</P><P>It comes with an ASDF system definition, so <TT>(ASDF:OOS
+'ASDF:LOAD-OP :IRONCLAD)</TT> should be all that you need to get started.
+The testsuite can be run by substituting <TT>ASDF:TEST-OP</TT> for <TT>ASDF:LOAD-OP</TT> in the form above.</P><P>Ironclad has been tested in the following implementations:</P><UL><LI>SBCL x86/linux, x86-64/linux (primary development platforms)</LI><LI>SBCL x86-64/solaris, x86/darwin</LI><LI>CMUCL x86/linux</LI><LI>ABCL with Sun's 1.5.0 JVM</LI><LI>Lispworks 5.0.1 x86/linux</LI><LI>Lispworks 5.1.2 x86-64/darwin x86/windows</LI><LI>Allegro 8.0 x86/linux</LI><LI>Allegro 8.1 x86/linux, x86-64/linux, sparc/solaris</LI><LI>CLISP 2.41 x86/linux, x86/cygwin</LI><LI>Clozure Common Lisp 1.2 x86-64/Linux</LI></UL><P>All included tests should pass successfully. If you use a platform
not listed above, please send your platform information to the author so
that he can add it to the above list. If the tests do not all pass, you
-have found a bug; please report it.</p><h2>License</h2><p>Ironclad is released under a MIT-like license; you can do pretty
+have found a bug; please report it.</P><H2>License</H2><P>Ironclad is released under a MIT-like license; you can do pretty
much anything you want to with the code except claim that you wrote
-it.</p><h2 id="ciphers">Ciphers</h2><div class="lisp-symbol"><a name="make-cipher"></a><tt><strong>make-cipher</strong> <em>name</em> <em><tt>&key</tt></em> <em>key</em> <em>mode</em> <em>initialization-vector</em> <em>padding</em> =&gt; <em>cipher</em></tt><br /></div><p>Return a cipher object suitable for use for both encryption and
-decryption.</p><p><em>name</em> denotes the encryption algorithm to use. <a href="#list-all-ciphers" style="symbol">list-all-ciphers</a> will tell you the names of all supported ciphers;
-the short list of ones you are likely to be interested in is:</p><ul><li>AES</li><li>DES</li><li>3DES</li><li>Blowfish</li><li>Twofish</li><li>RC5</li><li>RC6</li><li>Arcfour (RC4)</li></ul><p><em>name</em> can be a symbol in the <tt>KEYWORD</tt> package or the <tt>IRONCLAD</tt> package; <tt>:AES</tt> for AES, <tt>IRONCLAD:ARCFOUR</tt> for
-RC4, and so forth.</p><p><em>mode</em> describes the mode of operation for the cipher. Stream
-ciphers such as Arcfour can operate in only one mode, <tt>stream</tt>.
+it.</P><H2 ID="ciphers">Ciphers</H2><DIV CLASS="lisp-symbol"><A NAME="make-cipher"></A><TT><STRONG>make-cipher</STRONG> <EM>name</EM> <EM><TT>&key</TT></EM> <EM>key</EM> <EM>mode</EM> <EM>initialization-vector</EM> <EM>padding</EM> =&gt; <EM>cipher</EM></TT><BR /></DIV><P>Return a cipher object suitable for use for both encryption and
+decryption.</P><P><EM>name</EM> denotes the encryption algorithm to use. <A HREF="#list-all-ciphers" STYLE="symbol">list-all-ciphers</A> will tell you the names of all supported ciphers;
+the short list of ones you are likely to be interested in is:</P><UL><LI>AES</LI><LI>DES</LI><LI>3DES</LI><LI>Blowfish</LI><LI>Twofish</LI><LI>RC5</LI><LI>RC6</LI><LI>Arcfour (RC4)</LI></UL><P><EM>name</EM> can be a symbol in the <TT>KEYWORD</TT> package or the <TT>IRONCLAD</TT> package; <TT>:AES</TT> for AES, <TT>IRONCLAD:ARCFOUR</TT> for
+RC4, and so forth.</P><P><EM>mode</EM> describes the mode of operation for the cipher. Stream
+ciphers such as Arcfour can operate in only one mode, <TT>stream</TT>.
Block ciphers such as AES and DES can operate in several different
-modes:</p><ul><li>ECB</li><li>CBC</li><li>OFB</li><li>CFB (note that Ironclad's CFB mode is 'n'-bit CFB, where 'n' is
-the <a href="#block-length" style="symbol">block-length</a> of the cipher)</li><li>CFB8 (this seems to be the mode other crypto packages call
-'CFB')</li><li>CTR</li></ul><p><em>mode</em> should be a symbol in the <tt>KEYWORD</tt> or <tt>IRONCLAD</tt>
-packages; <tt>:STREAM</tt>, <tt>IRONCLAD:OFB</tt>, and so forth. An error
-will be signaled if <em>mode</em> is not appropriate for the cipher <em>name</em>.</p><p><em>initialization-vector</em> (IV) should be supplied only if <em>mode</em>
-requires one. <em>initialization-vector</em> should be a <tt>(VECTOR
-(UNSIGNED-BYTE 8))</tt>. The supplied IV should be the same length as the
-<a href="#block-length" style="symbol">block-length</a> of <em>name</em>.</p><p><em>key</em> is, of course, the key for the cipher. <em>key</em> should be
-a <tt>(VECTOR (UNSIGNED-BYTE 8))</tt>.</p><p>If <em>padding</em> is supplied, the specified padding method will be
-used by <a href="#encrypt" style="symbol">encrypt</a> and <a href="#decrypt" style="symbol">decrypt</a> to handle short blocks when the <tt>:HANDLE-FINAL-BLOCK</tt> argument is supplied. Depending on the mode
-specified, <em>padding</em> may be ignored (e.g. OFB and CFB modes do not
-care about short blocks; neither do stream ciphers).</p><table class="note"><tr><td class="title">Note</td><td class="content"><em>padding</em> is currently ignored in all modes (and, by extension,
-so is <tt>:HANDLE-FINAL-BLOCK</tt>). This oversight is expected to be
-corrected in a future release.</td></tr></table><div class="lisp-symbol"><a name="encrypt"></a><tt><strong>encrypt</strong> <em>cipher</em> <em>plaintext</em> <em>ciphertext</em> <em><tt>&key</tt></em> <em>plaintext-start</em> <em>plaintext-end</em> <em>ciphertext-start</em> <em>handle-final-block</em> <em>plaintext-start</em> <em>ciphertext-start</em> =&gt; <em>n-bytes-consumed</em>, <em>n-bytes-produced</em></tt><br /></div><p>Encrypts data according to <em>cipher</em> from <em>plaintext</em>
-starting at <em>plaintext-start</em> and continuing until <em>plaintext-end</em>. The encrypted data is placed in <em>ciphertext</em> starting at <em>ciphertext-start</em>.</p><div class="lisp-symbol"><a name="decrypt"></a><tt><strong>decrypt</strong> <em>cipher</em> <em>ciphertext</em> <em>plaintext</em> <em><tt>&key</tt></em> <em>ciphertext-start</em> <em>ciphertext-end</em> <em>plaintext-start</em> <em>handle-final-block</em> <em>ciphertext-start</em> <em>plaintext-start</em> =&gt; <em>n-bytes-consumed</em>, <em>n-bytes-produced</em></tt><br /></div><p>Decrypts data according to <em>cipher</em> from <em>ciphertext</em>
-starting at <em>ciphertext-start</em> and continuing until <em>ciphertext-end</em>. The decrypted data is placed in <em>plaintext</em>
-starting at <em>plaintext-start</em>.</p><div class="lisp-symbol"><a name="encrypt-in-place"></a><tt><strong>encrypt-in-place</strong> <em>cipher</em> <em>text</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>n-bytes-consumed</em>, <em>n-bytes-produced</em></tt><br /><a name="decrypt-in-place"></a><tt><strong>decrypt-in-place</strong> <em>cipher</em> <em>text</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>n-bytes-consumed</em>, <em>n-bytes-produced</em></tt><br /></div><p>Encrypts or decrypts data in <em>text</em> between <em>start</em> and <em>end</em> "in-place" according to <em>cipher</em>. These functions are
-shorthand for:</p><pre>(encrypt cipher text text :plaintext-start start :plaintext-end end :ciphertext-start start)
-(decrypt cipher text text :ciphertext-start start :ciphertext-end end :plaintext-start start)</pre><table class="note"><tr><td class="title">Note</td><td class="content"><a href="#encrypt-in-place" style="symbol">encrypt-in-place</a> and <a href="#decrypt-in-place" style="symbol">decrypt-in-place</a> do not support a <em>handle-final-block</em> parameter as <a href="#encrypt" style="symbol">encrypt</a> and <a href="#decrypt" style="symbol">decrypt</a> do.
-If you need the functionality that <em>handle-final-block</em> provides,
-then you need to use <a href="#encrypt" style="symbol">encrypt</a> and <a href="#decrypt" style="symbol">decrypt</a>.</td></tr></table><table class="note"><tr><td class="title">Note</td><td class="content"><em>n-bytes-consumed</em> and <em>n-bytes-produced</em> may not always be
-equal to the length of the data specified in the call to <a href="#encrypt-in-place" style="symbol">encrypt-in-place</a> or <a href="#decrypt-in-place" style="symbol">decrypt-in-place</a>. This subtlely is also
-present in <a href="#encrypt" style="symbol">encrypt</a> or <a href="#decrypt" style="symbol">decrypt</a>.</td></tr></table><h3>Inquiry functions</h3><div class="lisp-symbol"><a name="list-all-ciphers"></a><tt><strong>list-all-ciphers</strong> =&gt; <em>list</em></tt><br /></div><p>Returns a list of cipher-names that may be validly passed to <a href="#make-cipher" style="symbol">make-cipher</a>.</p><div class="lisp-symbol"><a name="cipher-supported-p"></a><tt><strong>cipher-supported-p</strong> <em>name</em> =&gt; <em>boolean</em></tt><br /></div><p>Returns T if <em>name</em> would be in the list returned by <a href="#list-all-ciphers" style="symbol">list-all-ciphers</a>, NIL otherwise.</p><div class="lisp-symbol"><a name="key-lengths"></a><tt><strong>key-lengths</strong> <em>cipher</em> =&gt; <em>list</em></tt><br /></div><p>Return a list of valid key lengths for <em>cipher</em>.</p><div class="lisp-symbol"><a name="block-length"></a><tt><strong>block-length</strong> <em>cipher</em> =&gt; <em>number</em></tt><br /></div><p>Return the number of octets <em>cipher</em> processes at a time. This
-function always returns 1 for stream ciphers.</p><h2 id="digests">Digests</h2><p>Digest functions, also known as hash functions, produce
-fixed-length output (a <em>digest</em> or <em>hash</em>) from a
+modes:</P><UL><LI>ECB</LI><LI>CBC</LI><LI>OFB</LI><LI>CFB (note that Ironclad's CFB mode is 'n'-bit CFB, where 'n' is
+the <A HREF="#block-length" STYLE="symbol">block-length</A> of the cipher)</LI><LI>CFB8 (this seems to be the mode other crypto packages call
+'CFB')</LI><LI>CTR</LI></UL><P><EM>mode</EM> should be a symbol in the <TT>KEYWORD</TT> or <TT>IRONCLAD</TT>
+packages; <TT>:STREAM</TT>, <TT>IRONCLAD:OFB</TT>, and so forth. An error
+will be signaled if <EM>mode</EM> is not appropriate for the cipher <EM>name</EM>.</P><P><EM>initialization-vector</EM> (IV) should be supplied only if <EM>mode</EM>
+requires one. <EM>initialization-vector</EM> should be a <TT>(VECTOR
+(UNSIGNED-BYTE 8))</TT>. The supplied IV should be the same length as the
+<A HREF="#block-length" STYLE="symbol">block-length</A> of <EM>name</EM>.</P><P><EM>key</EM> is, of course, the key for the cipher. <EM>key</EM> should be
+a <TT>(VECTOR (UNSIGNED-BYTE 8))</TT>.</P><P>If <EM>padding</EM> is supplied, the specified padding method will be
+used by <A HREF="#encrypt" STYLE="symbol">encrypt</A> and <A HREF="#decrypt" STYLE="symbol">decrypt</A> to handle short blocks when the <TT>:HANDLE-FINAL-BLOCK</TT> argument is supplied. Depending on the mode
+specified, <EM>padding</EM> may be ignored (e.g. OFB and CFB modes do not
+care about short blocks; neither do stream ciphers).</P><TABLE CLASS="note"><TR><TD CLASS="title">Note</TD><TD CLASS="content"><EM>padding</EM> is currently ignored in all modes (and, by extension,
+so is <TT>:HANDLE-FINAL-BLOCK</TT>). This oversight is expected to be
+corrected in a future release.</TD></TR></TABLE><DIV CLASS="lisp-symbol"><A NAME="encrypt"></A><TT><STRONG>encrypt</STRONG> <EM>cipher</EM> <EM>plaintext</EM> <EM>ciphertext</EM> <EM><TT>&key</TT></EM> <EM>plaintext-start</EM> <EM>plaintext-end</EM> <EM>ciphertext-start</EM> <EM>handle-final-block</EM> =&gt; <EM>n-bytes-consumed</EM>, <EM>n-bytes-produced</EM></TT><BR /></DIV><P>Encrypts data according to <EM>cipher</EM> from <EM>plaintext</EM>
+starting at <EM>plaintext-start</EM> and continuing until <EM>plaintext-end</EM>. The encrypted data is placed in <EM>ciphertext</EM> starting at <EM>ciphertext-start</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="decrypt"></A><TT><STRONG>decrypt</STRONG> <EM>cipher</EM> <EM>ciphertext</EM> <EM>plaintext</EM> <EM><TT>&key</TT></EM> <EM>ciphertext-start</EM> <EM>ciphertext-end</EM> <EM>plaintext-start</EM> <EM>handle-final-block</EM> =&gt; <EM>n-bytes-consumed</EM>, <EM>n-bytes-produced</EM></TT><BR /></DIV><P>Decrypts data according to <EM>cipher</EM> from <EM>ciphertext</EM>
+starting at <EM>ciphertext-start</EM> and continuing until <EM>ciphertext-end</EM>. The decrypted data is placed in <EM>plaintext</EM>
+starting at <EM>plaintext-start</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="encrypt-in-place"></A><TT><STRONG>encrypt-in-place</STRONG> <EM>cipher</EM> <EM>text</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>n-bytes-consumed</EM>, <EM>n-bytes-produced</EM></TT><BR /><A NAME="decrypt-in-place"></A><TT><STRONG>decrypt-in-place</STRONG> <EM>cipher</EM> <EM>text</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>n-bytes-consumed</EM>, <EM>n-bytes-produced</EM></TT><BR /></DIV><P>Encrypts or decrypts data in <EM>text</EM> between <EM>start</EM> and <EM>end</EM> "in-place" according to <EM>cipher</EM>. These functions are
+shorthand for:</P><PRE>(encrypt cipher text text :plaintext-start start :plaintext-end end :ciphertext-start start)
+(decrypt cipher text text :ciphertext-start start :ciphertext-end end :plaintext-start start)</PRE><TABLE CLASS="note"><TR><TD CLASS="title">Note</TD><TD CLASS="content"><A HREF="#encrypt-in-place" STYLE="symbol">encrypt-in-place</A> and <A HREF="#decrypt-in-place" STYLE="symbol">decrypt-in-place</A> do not support a <EM>handle-final-block</EM> parameter as <A HREF="#encrypt" STYLE="symbol">encrypt</A> and <A HREF="#decrypt" STYLE="symbol">decrypt</A> do.
+If you need the functionality that <EM>handle-final-block</EM> provides,
+then you need to use <A HREF="#encrypt" STYLE="symbol">encrypt</A> and <A HREF="#decrypt" STYLE="symbol">decrypt</A>.</TD></TR></TABLE><TABLE CLASS="note"><TR><TD CLASS="title">Note</TD><TD CLASS="content"><EM>n-bytes-consumed</EM> and <EM>n-bytes-produced</EM> may not always be
+equal to the length of the data specified in the call to <A HREF="#encrypt-in-place" STYLE="symbol">encrypt-in-place</A> or <A HREF="#decrypt-in-place" STYLE="symbol">decrypt-in-place</A>. This subtlely is also
+present in <A HREF="#encrypt" STYLE="symbol">encrypt</A> or <A HREF="#decrypt" STYLE="symbol">decrypt</A>.</TD></TR></TABLE><H3>Inquiry functions</H3><DIV CLASS="lisp-symbol"><A NAME="list-all-ciphers"></A><TT><STRONG>list-all-ciphers</STRONG> =&gt; <EM>list</EM></TT><BR /></DIV><P>Returns a list of cipher-names that may be validly passed to <A HREF="#make-cipher" STYLE="symbol">make-cipher</A>.</P><DIV CLASS="lisp-symbol"><A NAME="cipher-supported-p"></A><TT><STRONG>cipher-supported-p</STRONG> <EM>name</EM> =&gt; <EM>boolean</EM></TT><BR /></DIV><P>Returns T if <EM>name</EM> would be in the list returned by <A HREF="#list-all-ciphers" STYLE="symbol">list-all-ciphers</A>, NIL otherwise.</P><DIV CLASS="lisp-symbol"><A NAME="key-lengths"></A><TT><STRONG>key-lengths</STRONG> <EM>cipher</EM> =&gt; <EM>list</EM></TT><BR /></DIV><P>Return a list of valid key lengths for <EM>cipher</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="block-length"></A><TT><STRONG>block-length</STRONG> <EM>cipher</EM> =&gt; <EM>number</EM></TT><BR /></DIV><P>Return the number of octets <EM>cipher</EM> processes at a time. This
+function always returns 1 for stream ciphers.</P><H2 ID="digests">Digests</H2><P>Digest functions, also known as hash functions, produce
+fixed-length output (a <EM>digest</EM> or <EM>hash</EM>) from a
variable-length message. The simplest example of a digest function is
one that adds up all the bytes in the message modulo 256. This digest
function fails one test of a cryptographically secure hash function: it
must be difficult to find a message with a given digest. It also fails
the other test: it must be difficult to find two messages with the same
-digest.</p><p>Ironclad provides several cryptographically secure digest functions
-and several non-cryptographically secure digest functions.</p><table class="note"><tr><td class="title">Note</td><td class="content">In the functions below, messages or parts thereof are provided
+digest.</P><P>Ironclad provides several cryptographically secure digest functions
+and several non-cryptographically secure digest functions.</P><TABLE CLASS="note"><TR><TD CLASS="title">Note</TD><TD CLASS="content">In the functions below, messages or parts thereof are provided
as octet vectors; Ironclad has no facilities for producing digests of
strings. If you need to obtain the digest of a string, then you need to
figure out how to convert it to an octet vector first. This is a
deliberate design decision. Characters are not equivalent to bytes.
-See your local Unicode guru for more details.</td></tr></table><div class="lisp-symbol"><a name="make-digest"></a><tt><strong>make-digest</strong> <em>digest-name</em> <em><tt>&rest</tt></em> <em>keys</em> <em><tt>&key</tt></em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>digester</em></tt><br /></div><p>Returns a digest object. <em>digest-name</em> is a keyword naming the
-algorithm you wish <em>digester</em> to use. The algorithms you are likely
-to want to use are:</p><ul><li>MD4</li><li>MD5</li><li>SHA1</li><li>SHA256</li><li>Tiger</li><li>Adler32</li><li>CRC32</li></ul><p>Other legitimate digest names can be found by calling <a href="#list-all-digests" style="symbol">list-all-digests</a>. Like <a href="#make-cipher" style="symbol">make-cipher</a>, <em>digest-name</em> should be
-a symbol in the <tt>KEYWORD</tt> or <tt>IRONCLAD</tt> packages.</p><div class="lisp-symbol"><a name="update-digest"></a><tt><strong>update-digest</strong> <em>digester</em> <em>thing</em> <em><tt>&key</tt></em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>(values)</em></tt><br /></div><p>Updates the internal state of <em>digester</em> with the contents of <em>thing</em>. The exact method is determined by the type of THING.</p><p>There are several methods defined on this generic function that
-take a particular digester and a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8)
-(*))</tt> as well as the usual <em>start</em> and <em>end</em> keyword
-arguments. These methods update the state of <em>digester</em> with the
-subsequence of the array denoted by <em>start</em> and <em>end</em>. They are
+See your local Unicode guru for more details.</TD></TR></TABLE><DIV CLASS="lisp-symbol"><A NAME="make-digest"></A><TT><STRONG>make-digest</STRONG> <EM>digest-name</EM> <EM><TT>&rest</TT></EM> <EM>keys</EM> <EM><TT>&key</TT></EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>digester</EM></TT><BR /></DIV><P>Returns a digest object. <EM>digest-name</EM> is a keyword naming the
+algorithm you wish <EM>digester</EM> to use. The algorithms you are likely
+to want to use are:</P><UL><LI>MD4</LI><LI>MD5</LI><LI>SHA1</LI><LI>SHA256</LI><LI>Tiger</LI><LI>Adler32</LI><LI>CRC32</LI></UL><P>Other legitimate digest names can be found by calling <A HREF="#list-all-digests" STYLE="symbol">list-all-digests</A>. Like <A HREF="#make-cipher" STYLE="symbol">make-cipher</A>, <EM>digest-name</EM> should be
+a symbol in the <TT>KEYWORD</TT> or <TT>IRONCLAD</TT> packages.</P><DIV CLASS="lisp-symbol"><A NAME="update-digest"></A><TT><STRONG>update-digest</STRONG> <EM>digester</EM> <EM>thing</EM> <EM><TT>&key</TT></EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>(values)</EM></TT><BR /></DIV><P>Updates the internal state of <EM>digester</EM> with the contents of <EM>thing</EM>. The exact method is determined by the type of THING.</P><P>There are several methods defined on this generic function that
+take a particular digester and a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8)
+(*))</TT> as well as the usual <EM>start</EM> and <EM>end</EM> keyword
+arguments. These methods update the state of <EM>digester</EM> with the
+subsequence of the array denoted by <EM>start</EM> and <EM>end</EM>. They are
not listed here because there's one method for every type of digest
that Ironclad provides, and listing them would get very tedious
-for no benefit. An example should suffice.</p><pre>(let ((digester (ironclad:make-digest :sha1))
+for no benefit. An example should suffice.</P><PRE>(let ((digester (ironclad:make-digest :sha1))
(array (make-array 16 :element-type '(unsigned-byte 8) :initial-element 0)))
;; Update with 16 zeroes.
(ironclad:update-digest digester array)
;; Update with 8 ones.
(fill array 1 :start 2 :end 10)
- (ironclad:update-digest digester array :start 2 :end 10))</pre><div class="lisp-symbol"><a name="update-digest"></a><tt><strong>update-digest</strong> <em>digester</em> <em>(stream stream)</em> <em><tt>&key</tt></em> <em>buffer</em> <em>(start 0)</em> <em>end</em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>digester</em></tt><br /></div><p>Update the internal state of <em>digester</em> with the contents of <em>stream</em>, which must respond to <tt>READ-BYTE</tt> or <tt>READ-SEQUENCE</tt>
-with a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</tt> and return <em>digester</em>. It differs from <a href="#digest-stream" style="symbol">digest-stream</a>, below, in that you
-may need to digest data before or after the contents of <em>stream</em>
-(this happens, for instance, when signing the contents of some file).</p><div class="lisp-symbol"><a name="produce-digest"></a><tt><strong>produce-digest</strong> <em>digester</em> <em><tt>&key</tt></em> <em>digest</em> <em>digest-start</em> =&gt; <em>digest</em></tt><br /></div><p>Return the digest of the data processed by <em>digester</em> so far.
-The internal state of <em>digester</em> is modified; if you wish to retain
-a copy of the digest, you must call <a href="#copy-digest" style="symbol">copy-digest</a>.</p><p>If <em>digest</em> is provided, the computed digest will be placed
-into <em>digest</em> starting at <em>digest-start</em>. <em>digest</em> must be
-a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</tt>. An <a href="#insufficient-buffer-space" style="symbol">insufficient-buffer-space</a> error will be signaled if there is
-insufficient space in <em>digest</em>.</p><h3>High-level convenience functions</h3><p>Several high-level convenience functions that encapsulate common
-sequences of <a href="#make-digest" style="symbol">make-digest</a>, <a href="#update-digest" style="symbol">update-digest</a> and <a href="#produce-digest" style="symbol">produce-digest</a> are provided by Ironclad as well. They come in two flavors: the first
-takes a digest name as would be provided to <a href="#make-digest" style="symbol">make-digest</a>. The
+ (ironclad:update-digest digester array :start 2 :end 10))</PRE><DIV CLASS="lisp-symbol"><A NAME="update-digest"></A><TT><STRONG>update-digest</STRONG> <EM>digester</EM> <EM>(stream stream)</EM> <EM><TT>&key</TT></EM> <EM>buffer</EM> <EM>(start 0)</EM> <EM>end</EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>digester</EM></TT><BR /></DIV><P>Update the internal state of <EM>digester</EM> with the contents of <EM>stream</EM>, which must respond to <TT>READ-BYTE</TT> or <TT>READ-SEQUENCE</TT>
+with a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</TT> and return <EM>digester</EM>. It differs from <A HREF="#digest-stream" STYLE="symbol">digest-stream</A>, below, in that you
+may need to digest data before or after the contents of <EM>stream</EM>
+(this happens, for instance, when signing the contents of some file).</P><DIV CLASS="lisp-symbol"><A NAME="produce-digest"></A><TT><STRONG>produce-digest</STRONG> <EM>digester</EM> <EM><TT>&key</TT></EM> <EM>digest</EM> <EM>digest-start</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Return the digest of the data processed by <EM>digester</EM> so far.
+The internal state of <EM>digester</EM> is modified; if you wish to retain
+a copy of the digest, you must call <A HREF="#copy-digest" STYLE="symbol">copy-digest</A>.</P><P>If <EM>digest</EM> is provided, the computed digest will be placed
+into <EM>digest</EM> starting at <EM>digest-start</EM>. <EM>digest</EM> must be
+a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</TT>. An <A HREF="#insufficient-buffer-space" STYLE="symbol">insufficient-buffer-space</A> error will be signaled if there is
+insufficient space in <EM>digest</EM>.</P><H3>High-level convenience functions</H3><P>Several high-level convenience functions that encapsulate common
+sequences of <A HREF="#make-digest" STYLE="symbol">make-digest</A>, <A HREF="#update-digest" STYLE="symbol">update-digest</A> and <A HREF="#produce-digest" STYLE="symbol">produce-digest</A> are provided by Ironclad as well. They come in two flavors: the first
+takes a digest name as would be provided to <A HREF="#make-digest" STYLE="symbol">make-digest</A>. The
second way to call these functions is to provide an actual digest object
-as the first argument. So one can say:</p><pre>(ironclad:digest-sequence :md5 *buffer*)</pre><p>or, equivalently:</p><pre>(let ((digester (make-digest :md5)))
- (ironclad:digest-sequence digester *buffer*))</pre><p>The second form comes in handy if you plan on <a href="#digest-tips">reusing the digest object</a>.</p><div class="lisp-symbol"><a name="digest-sequence"></a><tt><strong>digest-sequence</strong> <em>digest-spec</em> <em>sequence</em> <em><tt>&rest</tt></em> <em>args</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> <em>digest</em> <em>digest-start</em> =&gt; <em>digest</em></tt><br /></div><p>Returns the digest of the subsequence of <em>sequence</em> bounded by
-<em>start</em> and <em>end</em>, according to <em>digest-name</em>. <em>sequence</em> must be a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8))</tt>. <em>digest</em> and <em>digest-start</em> are as in <a href="#produce-digest" style="symbol">produce-digest</a>.</p><div class="lisp-symbol"><a name="digest-stream"></a><tt><strong>digest-stream</strong> <em>digest-spec</em> <em>stream</em> <em><tt>&rest</tt></em> <em>args</em> <em><tt>&key</tt></em> <em>buffer</em> <em>start</em> <em>end</em> <em>digest</em> <em>digest-start</em> =&gt; <em>digest</em></tt><br /></div><p>Returns the digest of the contents of the stream specified by <em>stream</em>. <tt>READ-BYTE</tt> must be a legal operation on <em>stream</em>
-and return an <tt>(UNSIGNED-BYTE 8)</tt>. In a similar fashion, <tt>READ-SEQUENCE</tt> on <em>stream</em> must support reading into a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8))</tt>. <em>digest</em> and <em>digest-start</em> are as in <a href="#produce-digest" style="symbol">produce-digest</a>.</p><p>If <em>buffer</em> is provided, it must be a <tt>(SIMPLE-ARRAY
-(UNSIGNED-BYTE 8) (*))</tt>; the portion of <em>buffer</em> between <em>start</em> and <em>end</em> will be used to read the data from the stream.</p><div class="lisp-symbol"><a name="digest-file"></a><tt><strong>digest-file</strong> <em>digest-spec</em> <em>pathname</em> <em><tt>&rest</tt></em> <em>args</em> <em><tt>&key</tt></em> <em>buffer</em> <em>start</em> <em>end</em> <em>digest</em> <em>digest-start</em> =&gt; <em>digest</em></tt><br /></div><p>Returns the digest of the contents of the file named by <em>pathname</em>. <em>digest</em> and <em>digest-start</em> are as in <a href="#produce-digest" style="symbol">produce-digest</a>.</p><p>If <em>buffer</em> is provided, it must be a <tt>(SIMPLE-ARRAY
-(UNSIGNED-BYTE 8) (*))</tt>; the portion of <em>buffer</em> between <em>start</em> and <em>end</em> will be used to read the data from the stream.</p><h3>Inquiry functions</h3><div class="lisp-symbol"><a name="list-all-digests"></a><tt><strong>list-all-digests</strong> =&gt; <em>list</em></tt><br /></div><p>Returns a list whose elements may be validly passed to <a href="#make-digest" style="symbol">make-digest</a>.</p><div class="lisp-symbol"><a name="digest-supported-p"></a><tt><strong>digest-supported-p</strong> <em>name</em> =&gt; <em>boolean</em></tt><br /></div><p>Returns T if <em>name</em> would be in the list returned by <a href="#list-all-digests" style="symbol">list-all-digests</a>, NIL otherwise.</p><div class="lisp-symbol"><a name="digest-length"></a><tt><strong>digest-length</strong> <em>digest</em> =&gt; <em>number</em></tt><br /></div><p>Returns the length of the digest computed by <em>digest</em>, which
-may be a digest-name or a digest instance.</p><h3 id="digest-tips">Miscellaneous</h3><p>Ironclad digests are CLOS objects; the interesting thing about this
-for most purposes is that functions like <tt>REINITIALIZE-INSTANCE</tt> are
-supported. This means one can write a fairly efficient clone of the <tt>md5sum</tt> program like so:</p><pre>(defun digest-sum-files (digest &rest files)
+as the first argument. So one can say:</P><PRE>(ironclad:digest-sequence :md5 *buffer*)</PRE><P>or, equivalently:</P><PRE>(let ((digester (make-digest :md5)))
+ (ironclad:digest-sequence digester *buffer*))</PRE><P>The second form comes in handy if you plan on <A HREF="#digest-tips">reusing the digest object</A>.</P><DIV CLASS="lisp-symbol"><A NAME="digest-sequence"></A><TT><STRONG>digest-sequence</STRONG> <EM>digest-spec</EM> <EM>sequence</EM> <EM><TT>&rest</TT></EM> <EM>args</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> <EM>digest</EM> <EM>digest-start</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Returns the digest of the subsequence of <EM>sequence</EM> bounded by
+<EM>start</EM> and <EM>end</EM>, according to <EM>digest-name</EM>. <EM>sequence</EM> must be a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8))</TT>. <EM>digest</EM> and <EM>digest-start</EM> are as in <A HREF="#produce-digest" STYLE="symbol">produce-digest</A>.</P><DIV CLASS="lisp-symbol"><A NAME="digest-stream"></A><TT><STRONG>digest-stream</STRONG> <EM>digest-spec</EM> <EM>stream</EM> <EM><TT>&rest</TT></EM> <EM>args</EM> <EM><TT>&key</TT></EM> <EM>buffer</EM> <EM>start</EM> <EM>end</EM> <EM>digest</EM> <EM>digest-start</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Returns the digest of the contents of the stream specified by <EM>stream</EM>. <TT>READ-BYTE</TT> must be a legal operation on <EM>stream</EM>
+and return an <TT>(UNSIGNED-BYTE 8)</TT>. In a similar fashion, <TT>READ-SEQUENCE</TT> on <EM>stream</EM> must support reading into a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8))</TT>. <EM>digest</EM> and <EM>digest-start</EM> are as in <A HREF="#produce-digest" STYLE="symbol">produce-digest</A>.</P><P>If <EM>buffer</EM> is provided, it must be a <TT>(SIMPLE-ARRAY
+(UNSIGNED-BYTE 8) (*))</TT>; the portion of <EM>buffer</EM> between <EM>start</EM> and <EM>end</EM> will be used to read the data from the stream.</P><DIV CLASS="lisp-symbol"><A NAME="digest-file"></A><TT><STRONG>digest-file</STRONG> <EM>digest-spec</EM> <EM>pathname</EM> <EM><TT>&rest</TT></EM> <EM>args</EM> <EM><TT>&key</TT></EM> <EM>buffer</EM> <EM>start</EM> <EM>end</EM> <EM>digest</EM> <EM>digest-start</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Returns the digest of the contents of the file named by <EM>pathname</EM>. <EM>digest</EM> and <EM>digest-start</EM> are as in <A HREF="#produce-digest" STYLE="symbol">produce-digest</A>.</P><P>If <EM>buffer</EM> is provided, it must be a <TT>(SIMPLE-ARRAY
+(UNSIGNED-BYTE 8) (*))</TT>; the portion of <EM>buffer</EM> between <EM>start</EM> and <EM>end</EM> will be used to read the data from the stream.</P><H3>Inquiry functions</H3><DIV CLASS="lisp-symbol"><A NAME="list-all-digests"></A><TT><STRONG>list-all-digests</STRONG> =&gt; <EM>list</EM></TT><BR /></DIV><P>Returns a list whose elements may be validly passed to <A HREF="#make-digest" STYLE="symbol">make-digest</A>.</P><DIV CLASS="lisp-symbol"><A NAME="digest-supported-p"></A><TT><STRONG>digest-supported-p</STRONG> <EM>name</EM> =&gt; <EM>boolean</EM></TT><BR /></DIV><P>Returns T if <EM>name</EM> would be in the list returned by <A HREF="#list-all-digests" STYLE="symbol">list-all-digests</A>, NIL otherwise.</P><DIV CLASS="lisp-symbol"><A NAME="digest-length"></A><TT><STRONG>digest-length</STRONG> <EM>digest</EM> =&gt; <EM>number</EM></TT><BR /></DIV><P>Returns the length of the digest computed by <EM>digest</EM>, which
+may be a digest-name or a digest instance.</P><H3 ID="digest-tips">Miscellaneous</H3><P>Ironclad digests are CLOS objects; the interesting thing about this
+for most purposes is that functions like <TT>REINITIALIZE-INSTANCE</TT> are
+supported. This means one can write a fairly efficient clone of the <TT>md5sum</TT> program like so:</P><PRE>(defun digest-sum-files (digest-name &rest files)
(unless files
(error "no files given to digest"))
(loop with buffer = (make-array 8192 :element-type '(unsigned-byte 8))
- with digest = (make-array (ironclad:digest-length digest)
+ with digest = (make-array (ironclad:digest-length digest-name)
:element-type '(unsigned-byte 8))
for file in files
- for digester = (ironclad:make-digest digest)
+ for digester = (ironclad:make-digest digest-name)
then (reinitialize-instance digester)
do (ironclad:digest-file digester file :buffer buffer :digest digest)
(format t "~A ~A~%" (file-namestring file)
- (ironclad:byte-array-to-hex-string digest))))</pre><h3>Tree hashes</h3><p>Ironclad supports tree hashes, as described in <a href="http://web.archive.org/web/20080316033726/http://www.open-content.net/specs/draft-jchapweske-thex-02.html">Tree Hash EXchange format</a>. You create tree hashes as if you were
-creating a digest:</p><pre>(ironclad:make-digest :tree-hash)</pre><p>By default, this creates a tree hash that uses the Tiger digest
+ (ironclad:byte-array-to-hex-string digest))))</PRE><H3>Tree hashes</H3><P>Ironclad supports tree hashes, as described in <A HREF="http://web.archive.org/web/20080316033726/http://www.open-content.net/specs/draft-jchapweske-thex-02.html">Tree Hash EXchange format</A>. You create tree hashes as if you were
+creating a digest:</P><PRE>(ironclad:make-digest :tree-hash)</PRE><P>By default, this creates a tree hash that uses the Tiger digest
algorithm internally and a segment size of 1024. Since using the Tiger
digest algorithm is so common, a convenience function that makes your
-intent obvious:</p><pre>(ironclad:make-tiger-tree-hash)</pre><p>has also been provided.</p><p>You may indicate that you wish to use a different algorithm than
-Tiger:</p><pre>(ironclad:make-digest '(:treehash :digest :sha256))</pre><p>Or you might wish to use a different segment size:</p><pre>(ironclad:make-digest '(:tree-hash :block-length 16384))</pre><p>There is currently no interface for obtaining the intermediate
-hashes computed while computing the final tree hash.</p><h2 id="macs">Message authentication codes</h2><p>A message authentication code is a cryptographic function of some
+intent obvious:</P><PRE>(ironclad:make-tiger-tree-hash)</PRE><P>has also been provided.</P><P>You may indicate that you wish to use a different algorithm than
+Tiger:</P><PRE>(ironclad:make-digest '(:treehash :digest :sha256))</PRE><P>Or you might wish to use a different segment size:</P><PRE>(ironclad:make-digest '(:tree-hash :block-length 16384))</PRE><P>There is currently no interface for obtaining the intermediate
+hashes computed while computing the final tree hash.</P><H2 ID="macs">Message authentication codes</H2><P>A message authentication code is a cryptographic function of some
data and a user-specified key. Only a person knowing the key can
recompute the MAC for the given message. A MAC is useful where
maintaining data integrity is required, but the secrecy of the data is
-not paramount.</p><p>Ironclad provides two different kinds of MACs: HMACs, specified in
-<a href="http://www.ietf.org/rfc/rfc2109.txt">RFC 2104</a>, and CMACs,
-specified in <a href="http://www.ietf.org/rfc/rfc4493.txt">RFC 4493</a>
-and NIST document 800-38B.</p><h3>HMACs</h3><p>Instances of HMACs are constructed by specifying a secret key and a
-digest-name.</p><div class="lisp-symbol"><a name="make-hmac"></a><tt><strong>make-hmac</strong> <em>key</em> <em>digest-name</em> =&gt; <em>hmac</em></tt><br /></div><p>Return an HMAC instance based on the hash function <em>digest-name</em> with secret key <em>key</em>.</p><p>The returned object supports <tt>REINITIALIZE-INSTANCE</tt>:</p><div class="lisp-symbol"><a name="reinitialize-instance"></a><tt><strong>reinitialize-instance</strong> <em>(mac hmac)</em> <em><tt>&rest</tt></em> <em>initargs</em> <em><tt>&key</tt></em> <em>key</em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>hmac</em></tt><br /></div><p>The <tt>:KEY</tt> argument is the secret key, as provided to <a href="#make-hmac" style="symbol">make-hmac</a>.</p><div class="lisp-symbol"><a name="update-hmac"></a><tt><strong>update-hmac</strong> <em>hmac</em> <em>sequence</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>hmac</em></tt><br /></div><p>Update the internal state of <em>hmac</em> with the data in <em>sequence</em> bounded by <em>start</em> and <em>end</em>. <em>sequence</em> must
-be a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</tt>.</p><div class="lisp-symbol"><a name="hmac-digest"></a><tt><strong>hmac-digest</strong> <em>hmac</em> <em><tt>&key</tt></em> <em>buffer</em> <em>buffer-start</em> =&gt; <em>digest</em></tt><br /></div><p>Returns the MAC (<em>digest</em>) computed by <em>hmac</em> thus far.
-The internal state of <em>hmac</em> is not modified; this feature makes it
-possible to compute a "rolling MAC" of a document. The length of <em>digest</em> is determined by the <a href="#digest-length" style="symbol">digest-length</a> of <em>digest-name</em>
-passed to <a href="#make-hmac" style="symbol">make-hmac</a> when <em>hmac</em> was constructed.</p><p>If <em>buffer</em> is provided, the computed MAC will be placed into <em>buffer</em> starting at <em>buffer-start</em>. <em>buffer</em> must be a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</tt>. An <a href="#insufficient-buffer-space" style="symbol">insufficient-buffer-space</a> error will be signaled if there is
-insufficient space in <em>buffer</em>.</p><h3>PBKDF</h3><p>Ironclad comes with the basic PBKDF1 and PBKDF2 algorithms, as
-well as convenience functions for using them to store passwords.</p><div class="lisp-symbol"><a name="derive-key"></a><tt><strong>derive-key</strong> <em>kdf</em> <em>passphrase</em> <em>salt</em> <em>iteration-count</em> <em>key-length</em> =&gt; <em>digest</em></tt><br /></div><p>Given a key derivation function object (produced by <tt>make-kdf</tt>), a password and salt (both must be of type <tt>(SIMPLE-ARRAY
-(UNSIGNED-BYTE 8) (*))</tt>), and number of digest iterations, returns
-the password digest as a byte array of length <em>key-length</em>.</p><div class="lisp-symbol"><a name="make-kdf"></a><tt><strong>make-kdf</strong> <em>kind</em> <em><tt>&key</tt></em> <em>digest</em> =&gt; <em>kind</em></tt><br /></div><p>Returns a key derivation function instance (<em>kind</em> must
-either be <em>pbkdf1</em> or <em>pbkdf2</em>) that uses the given <em>digest</em>.</p><div class="lisp-symbol"><a name="pbkdf2-hash-password"></a><tt><strong>pbkdf2-hash-password</strong> <em>password</em> <em><tt>&key</tt></em> <em>salt</em> <em>digest</em> <em>iterations</em> =&gt; <em>password</em></tt><br /></div><p>Convenience function for hashing passwords using the PBKDF2
+not paramount.</P><P>Ironclad provides two different kinds of MACs: HMACs, specified in
+<A HREF="http://www.ietf.org/rfc/rfc2109.txt">RFC 2104</A>, and CMACs,
+specified in <A HREF="http://www.ietf.org/rfc/rfc4493.txt">RFC 4493</A>
+and NIST document 800-38B.</P><H3>HMACs</H3><P>Instances of HMACs are constructed by specifying a secret key and a
+digest-name.</P><DIV CLASS="lisp-symbol"><A NAME="make-hmac"></A><TT><STRONG>make-hmac</STRONG> <EM>key</EM> <EM>digest-name</EM> =&gt; <EM>hmac</EM></TT><BR /></DIV><P>Return an HMAC instance based on the hash function <EM>digest-name</EM> with secret key <EM>key</EM>.</P><P>The returned object supports <TT>REINITIALIZE-INSTANCE</TT>:</P><DIV CLASS="lisp-symbol"><A NAME="reinitialize-instance"></A><TT><STRONG>reinitialize-instance</STRONG> <EM>(mac hmac)</EM> <EM><TT>&rest</TT></EM> <EM>initargs</EM> <EM><TT>&key</TT></EM> <EM>key</EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>hmac</EM></TT><BR /></DIV><P>The <TT>:KEY</TT> argument is the secret key, as provided to <A HREF="#make-hmac" STYLE="symbol">make-hmac</A>.</P><DIV CLASS="lisp-symbol"><A NAME="update-hmac"></A><TT><STRONG>update-hmac</STRONG> <EM>hmac</EM> <EM>sequence</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>hmac</EM></TT><BR /></DIV><P>Update the internal state of <EM>hmac</EM> with the data in <EM>sequence</EM> bounded by <EM>start</EM> and <EM>end</EM>. <EM>sequence</EM> must
+be a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</TT>.</P><DIV CLASS="lisp-symbol"><A NAME="hmac-digest"></A><TT><STRONG>hmac-digest</STRONG> <EM>hmac</EM> <EM><TT>&key</TT></EM> <EM>buffer</EM> <EM>buffer-start</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Returns the MAC (<EM>digest</EM>) computed by <EM>hmac</EM> thus far.
+The internal state of <EM>hmac</EM> is not modified; this feature makes it
+possible to compute a "rolling MAC" of a document. The length of <EM>digest</EM> is determined by the <A HREF="#digest-length" STYLE="symbol">digest-length</A> of <EM>digest-name</EM>
+passed to <A HREF="#make-hmac" STYLE="symbol">make-hmac</A> when <EM>hmac</EM> was constructed.</P><P>If <EM>buffer</EM> is provided, the computed MAC will be placed into <EM>buffer</EM> starting at <EM>buffer-start</EM>. <EM>buffer</EM> must be a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</TT>. An <A HREF="#insufficient-buffer-space" STYLE="symbol">insufficient-buffer-space</A> error will be signaled if there is
+insufficient space in <EM>buffer</EM>.</P><H3>PBKDF</H3><P>Ironclad comes with the basic PBKDF1 and PBKDF2 algorithms, as
+well as convenience functions for using them to store passwords.</P><DIV CLASS="lisp-symbol"><A NAME="derive-key"></A><TT><STRONG>derive-key</STRONG> <EM>kdf</EM> <EM>passphrase</EM> <EM>salt</EM> <EM>iteration-count</EM> <EM>key-length</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Given a key derivation function object (produced by <TT>make-kdf</TT>), a password and salt (both must be of type <TT>(SIMPLE-ARRAY
+(UNSIGNED-BYTE 8) (*))</TT>), and number of digest iterations, returns
+the password digest as a byte array of length <EM>key-length</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="make-kdf"></A><TT><STRONG>make-kdf</STRONG> <EM>kind</EM> <EM><TT>&key</TT></EM> <EM>digest</EM> =&gt; <EM>kind</EM></TT><BR /></DIV><P>Returns a key derivation function instance (<EM>kind</EM> must
+either be <EM>pbkdf1</EM> or <EM>pbkdf2</EM>) that uses the given <EM>digest</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="pbkdf2-hash-password"></A><TT><STRONG>pbkdf2-hash-password</STRONG> <EM>password</EM> <EM><TT>&key</TT></EM> <EM>salt</EM> <EM>digest</EM> <EM>iterations</EM> =&gt; <EM>password</EM></TT><BR /></DIV><P>Convenience function for hashing passwords using the PBKDF2
algorithm. Returns the derived hash of the password, and the original
-salt, as byte vectors.</p><div class="lisp-symbol"><a name="pbkdf2-hash-password-to-combined-string"></a><tt><strong>pbkdf2-hash-password-to-combined-string</strong> <em>password</em> <em><tt>&key</tt></em> <em>salt</em> <em>digest</em> <em>iterations</em> =&gt; <em>password</em></tt><br /></div><p>Convenience function for hashing passwords using the PBKDF2
+salt, as byte vectors.</P><DIV CLASS="lisp-symbol"><A NAME="pbkdf2-hash-password-to-combined-string"></A><TT><STRONG>pbkdf2-hash-password-to-combined-string</STRONG> <EM>password</EM> <EM><TT>&key</TT></EM> <EM>salt</EM> <EM>digest</EM> <EM>iterations</EM> =&gt; <EM>password</EM></TT><BR /></DIV><P>Convenience function for hashing passwords using the PBKDF2
algorithm. Returns the derived hash of the password as a single string
-that encodes the given salt and PBKDF2 algorithm parameters.</p><div class="lisp-symbol"><a name="pbkdf2-check-password"></a><tt><strong>pbkdf2-check-password</strong> <em>password</em> <em>combined-salt-and-digest</em> =&gt; <em>boolean</em></tt><br /></div><p>Given a <em>password</em> byte vector and a combined salt and digest string
-produced by <tt>pbkdf2-hash-password-to-combined-string</tt>, checks whether
-the password is valid.</p><h3>CMACs</h3><p>Instances of CMACs are constructed by specifying a secret key and a
-cipher-name.</p><div class="lisp-symbol"><a name="make-cmac"></a><tt><strong>make-cmac</strong> <em>key</em> <em>cipher-name</em> =&gt; <em>cmac</em></tt><br /></div><p>Return a CMAC instance based on the cipher <em>cipher-name</em> with
-secret key <em>key</em>. <em>cipher-name</em> must have a <a href="#block-length" style="symbol">block-length</a>
+that encodes the given salt and PBKDF2 algorithm parameters.</P><DIV CLASS="lisp-symbol"><A NAME="pbkdf2-check-password"></A><TT><STRONG>pbkdf2-check-password</STRONG> <EM>password</EM> <EM>combined-salt-and-digest</EM> =&gt; <EM>boolean</EM></TT><BR /></DIV><P>Given a <EM>password</EM> byte vector and a combined salt and digest string
+produced by <TT>pbkdf2-hash-password-to-combined-string</TT>, checks whether
+the password is valid.</P><H3>CMACs</H3><P>Instances of CMACs are constructed by specifying a secret key and a
+cipher-name.</P><DIV CLASS="lisp-symbol"><A NAME="make-cmac"></A><TT><STRONG>make-cmac</STRONG> <EM>key</EM> <EM>cipher-name</EM> =&gt; <EM>cmac</EM></TT><BR /></DIV><P>Return a CMAC instance based on the cipher <EM>cipher-name</EM> with
+secret key <EM>key</EM>. <EM>cipher-name</EM> must have a <A HREF="#block-length" STYLE="symbol">block-length</A>
of either 8 or 16; this restriction is satisfied by most ciphers in
-Ironclad with the notable exception of stream ciphers. <em>key</em> must
-be an acceptable key for <em>cipher-name</em>.</p><div class="lisp-symbol"><a name="update-cmac"></a><tt><strong>update-cmac</strong> <em>cmac</em> <em>sequence</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>cmac</em></tt><br /></div><p>Update the internal state of <em>cmac</em> with the data in <em>sequence</em> bounded by <em>start</em> and <em>end</em>. <em>sequence</em> must
-be a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</tt>.</p><div class="lisp-symbol"><a name="cmac-digest"></a><tt><strong>cmac-digest</strong> <em>cmac</em> =&gt; <em>digest</em></tt><br /></div><p>Returns the MAC (<em>digest</em>) computed by <em>cmac</em> thus far.
-The internal state of <em>cmac</em> is not modified; this feature makes it
-possible to compute a "rolling MAC" of a document. The length of <em>digest</em> is determined by the <a href="#block-length" style="symbol">block-length</a> of <em>cipher-name</em>
-passed to <a href="#make-cmac" style="symbol">make-cmac</a> when <em>cmac</em> was constructed.</p><h2 id="public-key">Public-key Operations</h2><p>Ironclad includes support for DSA signing and verification.
+Ironclad with the notable exception of stream ciphers. <EM>key</EM> must
+be an acceptable key for <EM>cipher-name</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="update-cmac"></A><TT><STRONG>update-cmac</STRONG> <EM>cmac</EM> <EM>sequence</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>cmac</EM></TT><BR /></DIV><P>Update the internal state of <EM>cmac</EM> with the data in <EM>sequence</EM> bounded by <EM>start</EM> and <EM>end</EM>. <EM>sequence</EM> must
+be a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*))</TT>.</P><DIV CLASS="lisp-symbol"><A NAME="cmac-digest"></A><TT><STRONG>cmac-digest</STRONG> <EM>cmac</EM> =&gt; <EM>digest</EM></TT><BR /></DIV><P>Returns the MAC (<EM>digest</EM>) computed by <EM>cmac</EM> thus far.
+The internal state of <EM>cmac</EM> is not modified; this feature makes it
+possible to compute a "rolling MAC" of a document. The length of <EM>digest</EM> is determined by the <A HREF="#block-length" STYLE="symbol">block-length</A> of <EM>cipher-name</EM>
+passed to <A HREF="#make-cmac" STYLE="symbol">make-cmac</A> when <EM>cmac</EM> was constructed.</P><H2 ID="public-key">Public-key Operations</H2><P>Ironclad includes support for DSA signing and verification.
Support for RSA encryption and decryption is provided as well, but it is
"raw"--the various formatting schemes (e.g. PKCS-1) must be implemented
-by the user at this time.</p><h3>Key construction</h3><div class="lisp-symbol"><a name="make-public-key"></a><tt><strong>make-public-key</strong> <em>kind</em> <em><tt>&key</tt></em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>public-key</em></tt><br /></div><p>Return a public key according to <em>kind</em>. The <em>&key</em>
-arguments vary according to <em>kind</em>. The interesting bits are in the
-methods that specialize on <em>kind</em>, below.</p><div class="lisp-symbol"><a name="make-public-key"></a><tt><strong>make-public-key</strong> <em>(kind (eql :dsa))</em> <em><tt>&key</tt></em> <em>p</em> <em>q</em> <em>g</em> <em>y</em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>private-key</em></tt><br /></div><p>Return a DSA public key. <em>p</em>, <em>q</em>, <em>g</em>, and <em>y</em>
-are the usual parameters for DSA keys discussed in the literature.</p><div class="lisp-symbol"><a name="make-private-key"></a><tt><strong>make-private-key</strong> <em>kind</em> <em><tt>&key</tt></em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>private-key</em></tt><br /></div><p>Return a private key according to <em>kind</em>. The <em>&key</em>
-arguments vary according to <em>kind</em>. The interesting bits are in the
-methods that specialize on <em>kind</em>, below.</p><div class="lisp-symbol"><a name="make-private-key"></a><tt><strong>make-private-key</strong> <em>(kind (eql :dsa))</em> <em><tt>&key</tt></em> <em>p</em> <em>q</em> <em>g</em> <em>y</em> <em>x</em> <em><tt>&allow-other-keys</tt></em> =&gt; <em>private-key</em></tt><br /></div><p>Return a DSA private key. <em>p</em>, <em>q</em>, <em>g</em>, <em>y</em>, and
-<em>x</em> are the usual parameters for DSA keys discussed in the
-literature.</p><h3>Digital signatures</h3><div class="lisp-symbol"><a name="sign-message"></a><tt><strong>sign-message</strong> <em>key</em> <em>message</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>signature</em></tt><br /></div><p>Return a signature of <em>message</em> between <em>start</em> and <em>end</em> signed with <em>key</em>; the class of <em>key</em> determines the class of
-<em>signature</em>.</p><div class="lisp-symbol"><a name="sign-message"></a><tt><strong>sign-message</strong> <em>(key dsa-private-key)</em> <em>message</em> <em><tt>&key</tt></em> <em>(start 0)</em> <em>end</em> =&gt; <em>signature</em></tt><br /></div><p>This method places an additional constraint on the size of <em>message</em> specified by <em>start</em> and <em>end</em>: it must be exactly
-20 bytes long (the length of a SHA-1 digest). <em>signature</em> is a <a href="#dsa-signature" style="symbol">dsa-signature</a> object.</p><div class="lisp-symbol"><a name="verify-signature"></a><tt><strong>verify-signature</strong> <em>key</em> <em>message</em> <em>signature</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>boolean</em></tt><br /></div><p>Verify whether <em>signature</em> is the signature of <em>message</em>
-between <em>start</em> and <em>end</em> using <em>key</em>. Return T or NIL
-depending on the result of verification.</p><div class="lisp-symbol"><a name="verify-signature"></a><tt><strong>verify-signature</strong> <em>(key dsa-public-key)</em> <em>message</em> <em>(signature dsa-signature)</em> <em><tt>&key</tt></em> <em>(start 0)</em> <em>end</em> =&gt; <em>boolean</em></tt><br /></div><h4>Signature objects</h4><p>There is no one "right" way to format signatures into octet
-vectors; different applications may have different requirements. <a href="#sign-message" style="symbol">sign-message</a> therefore returns objects and lets the user determine
-how to best format the values contained therein.</p><div class="lisp-symbol"><a name="dsa-signature"></a><tt><strong>dsa-signature</strong></tt><br /></div><p>A DSA signature object.</p><div class="lisp-symbol"><a name="make-dsa-signature"></a><tt><strong>make-dsa-signature</strong> <em>r</em> <em>s</em> =&gt; <em>signature</em></tt><br /></div><p>Returns a DSA signature with the provided <em>r</em> and <em>s</em>
-values. <em>r</em> and <em>s</em> may be either integers or they may be
-20-byte octet vectors.</p><div class="lisp-symbol"><a name="dsa-signature-r"></a><tt><strong>dsa-signature-r</strong> <em>object</em> =&gt; <em>integer</em></tt><br /></div><p>Returns the <em>r</em> value of the provided DSA signature.</p><div class="lisp-symbol"><a name="dsa-signature-s"></a><tt><strong>dsa-signature-s</strong> <em>object</em> =&gt; <em>integer</em></tt><br /></div><p>Returns the <em>s</em> value of the provided DSA signature.</p><h3>Encryption and decryption</h3><div class="lisp-symbol"><a name="encrypt-message"></a><tt><strong>encrypt-message</strong> <em>key</em> <em>message</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> <em>end</em> <em>start</em> =&gt; <em>encrypted-message</em></tt><br /></div><div class="lisp-symbol"><a name="decrypt-message"></a><tt><strong>decrypt-message</strong> <em>key</em> <em>message</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> <em>start</em> =&gt; <em>decrypted-message</em></tt><br /></div><h2 id="prng">Pseudo-random Number Generation</h2><div class="lisp-symbol"><a name="make-prng"></a><tt><strong>make-prng</strong> <em>name</em> <em><tt>&key</tt></em> <em>seed</em> <em>seed</em> <em>cipher</em> =&gt; <em>prng</em></tt><br /></div><p>Return a pseudo-random number generator.</p><p><em>name</em> denotes the style of PRNG to use. <a href="#list-all-prngs" style="symbol">list-all-prngs</a> will
-tell you the names of all supported PRNGs. Currently only FORTUNA is
-supported. <em>name</em> can be a symbol in the <tt>KEYWORD</tt> package or
-the <tt>IRONCLAD</tt> package.</p><p><em>seed</em> is a <em>seed descriptor</em>. If NIL, the PRNG will
+by the user at this time.</P><H3>Key construction</H3><DIV CLASS="lisp-symbol"><A NAME="make-public-key"></A><TT><STRONG>make-public-key</STRONG> <EM>kind</EM> <EM><TT>&key</TT></EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>public-key</EM></TT><BR /></DIV><P>Return a public key according to <EM>kind</EM>. The <EM>&key</EM>
+arguments vary according to <EM>kind</EM>. The interesting bits are in the
+methods that specialize on <EM>kind</EM>, below.</P><DIV CLASS="lisp-symbol"><A NAME="make-public-key"></A><TT><STRONG>make-public-key</STRONG> <EM>(kind (eql :dsa))</EM> <EM><TT>&key</TT></EM> <EM>p</EM> <EM>q</EM> <EM>g</EM> <EM>y</EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>private-key</EM></TT><BR /></DIV><P>Return a DSA public key. <EM>p</EM>, <EM>q</EM>, <EM>g</EM>, and <EM>y</EM>
+are the usual parameters for DSA keys discussed in the literature.</P><DIV CLASS="lisp-symbol"><A NAME="make-private-key"></A><TT><STRONG>make-private-key</STRONG> <EM>kind</EM> <EM><TT>&key</TT></EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>private-key</EM></TT><BR /></DIV><P>Return a private key according to <EM>kind</EM>. The <EM>&key</EM>
+arguments vary according to <EM>kind</EM>. The interesting bits are in the
+methods that specialize on <EM>kind</EM>, below.</P><DIV CLASS="lisp-symbol"><A NAME="make-private-key"></A><TT><STRONG>make-private-key</STRONG> <EM>(kind (eql :dsa))</EM> <EM><TT>&key</TT></EM> <EM>p</EM> <EM>q</EM> <EM>g</EM> <EM>y</EM> <EM>x</EM> <EM><TT>&allow-other-keys</TT></EM> =&gt; <EM>private-key</EM></TT><BR /></DIV><P>Return a DSA private key. <EM>p</EM>, <EM>q</EM>, <EM>g</EM>, <EM>y</EM>, and
+<EM>x</EM> are the usual parameters for DSA keys discussed in the
+literature.</P><H3>Digital signatures</H3><DIV CLASS="lisp-symbol"><A NAME="sign-message"></A><TT><STRONG>sign-message</STRONG> <EM>key</EM> <EM>message</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>signature</EM></TT><BR /></DIV><P>Return a signature of <EM>message</EM> between <EM>start</EM> and <EM>end</EM> signed with <EM>key</EM>; the class of <EM>key</EM> determines the class of
+<EM>signature</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="sign-message"></A><TT><STRONG>sign-message</STRONG> <EM>(key dsa-private-key)</EM> <EM>message</EM> <EM><TT>&key</TT></EM> <EM>(start 0)</EM> <EM>end</EM> =&gt; <EM>signature</EM></TT><BR /></DIV><P>This method places an additional constraint on the size of <EM>message</EM> specified by <EM>start</EM> and <EM>end</EM>: it must be exactly
+20 bytes long (the length of a SHA-1 digest). <EM>signature</EM> is a <A HREF="#dsa-signature" STYLE="symbol">dsa-signature</A> object.</P><DIV CLASS="lisp-symbol"><A NAME="verify-signature"></A><TT><STRONG>verify-signature</STRONG> <EM>key</EM> <EM>message</EM> <EM>signature</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>boolean</EM></TT><BR /></DIV><P>Verify whether <EM>signature</EM> is the signature of <EM>message</EM>
+between <EM>start</EM> and <EM>end</EM> using <EM>key</EM>. Return T or NIL
+depending on the result of verification.</P><DIV CLASS="lisp-symbol"><A NAME="verify-signature"></A><TT><STRONG>verify-signature</STRONG> <EM>(key dsa-public-key)</EM> <EM>message</EM> <EM>(signature dsa-signature)</EM> <EM><TT>&key</TT></EM> <EM>(start 0)</EM> <EM>end</EM> =&gt; <EM>boolean</EM></TT><BR /></DIV><H4>Signature objects</H4><P>There is no one "right" way to format signatures into octet
+vectors; different applications may have different requirements. <A HREF="#sign-message" STYLE="symbol">sign-message</A> therefore returns objects and lets the user determine
+how to best format the values contained therein.</P><DIV CLASS="lisp-symbol"><A NAME="dsa-signature"></A><TT><STRONG>dsa-signature</STRONG></TT><BR /></DIV><P>A DSA signature object.</P><DIV CLASS="lisp-symbol"><A NAME="make-dsa-signature"></A><TT><STRONG>make-dsa-signature</STRONG> <EM>r</EM> <EM>s</EM> =&gt; <EM>signature</EM></TT><BR /></DIV><P>Returns a DSA signature with the provided <EM>r</EM> and <EM>s</EM>
+values. <EM>r</EM> and <EM>s</EM> may be either integers or they may be
+20-byte octet vectors.</P><DIV CLASS="lisp-symbol"><A NAME="dsa-signature-r"></A><TT><STRONG>dsa-signature-r</STRONG> <EM>object</EM> =&gt; <EM>integer</EM></TT><BR /></DIV><P>Returns the <EM>r</EM> value of the provided DSA signature.</P><DIV CLASS="lisp-symbol"><A NAME="dsa-signature-s"></A><TT><STRONG>dsa-signature-s</STRONG> <EM>object</EM> =&gt; <EM>integer</EM></TT><BR /></DIV><P>Returns the <EM>s</EM> value of the provided DSA signature.</P><H3>Encryption and decryption</H3><DIV CLASS="lisp-symbol"><A NAME="encrypt-message"></A><TT><STRONG>encrypt-message</STRONG> <EM>key</EM> <EM>message</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> <EM>start</EM> =&gt; <EM>encrypted-message</EM></TT><BR /></DIV><DIV CLASS="lisp-symbol"><A NAME="decrypt-message"></A><TT><STRONG>decrypt-message</STRONG> <EM>key</EM> <EM>message</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> <EM>start</EM> =&gt; <EM>decrypted-message</EM></TT><BR /></DIV><H2 ID="prng">Pseudo-random Number Generation</H2><H3>Example</H3><P><PRE>> (setf *prng* (make-prng :fortuna))
+-> #<fortuna-prng>
+> (random-data 16)
+-> #(61 145 133 130 220 200 90 86 0 101 62 169 0 40 101 78)
+> (setf *prng* (make-prng :fortuna :seed nil))
+-> #<fortuna-prng>
+> (crypto:read-os-random-seed :random)
+-> 1
+> (crypto:strong-random 16)
+-> 3
+> (write-seed #P"/tmp/seed")
+-> t
+> (crypto:read-seed #P"/tmp/seed")
+-> t
+> (crypto:random-bits 16)
+-> 41546
+> (add-random-event 0 0 (string-to-octets "foobar"))</PRE></P><P>See details about <A HREF="#add-random-event" STYLE="symbol">add-random-event</A> below.</P><DIV CLASS="lisp-symbol"><A NAME="make-prng"></A><TT><STRONG>make-prng</STRONG> <EM>name</EM> <EM><TT>&key</TT></EM> <EM>seed</EM> <EM>seed</EM> <EM>cipher</EM> =&gt; <EM>prng</EM></TT><BR /></DIV><P>Create an unseeded pseudo-random number generator.</P><P><EM>name</EM> denotes the style of PRNG to use. <A HREF="#list-all-prngs" STYLE="symbol">list-all-prngs</A> will
+tell you the names of all supported PRNGs. Currently only Fortuna is
+supported. <EM>name</EM> can be a symbol in the <TT>KEYWORD</TT> package or
+the <TT>IRONCLAD</TT> package.</P><P><EM>seed</EM> is a <EM>seed descriptor</EM>. If NIL, the PRNG will
not be seeded (which may prevent it from generating output until it is
-seeded, depending on the generator). If <tt>:RANDOM</tt> then the PRNG
-will be seeded with the OS's cryptographically-secure PRNG. If <tt>:URANDOM</tt> then the PRNG will be seeded with the OS's
+seeded, depending on the generator). If <TT>:RANDOM</TT> then the PRNG
+will be seeded with the OS's cryptographically-secure PRNG. If <TT>:URANDOM</TT> then the PRNG will be seeded with the OS's
fast-but-potentially-less-secure PRNG, if available (if not, will
-fallback to <tt>:RANDOM</tt>). If it is a pathname indicator, a seed will
+fallback to <TT>:RANDOM</TT>). If it is a pathname indicator, a seed will
be read from the indicated file, then a new seed will be generated and
written back to the file (over-writing the old seed). Finally, if it is
-a byte vector, it will be used to seed the PRNG.</p><div class="lisp-symbol"><a name="list-all-prngs"></a><tt><strong>list-all-prngs</strong> =&gt; <em>list</em></tt><br /></div><p>List all known PRNG types.</p><div class="lisp-symbol"><a name="random-data"></a><tt><strong>random-data</strong> <em>pseudo-random-number-generator</em> <em>num-bytes</em> =&gt; <em>bytes</em></tt><br /></div><p>Generate <em>num-bytes</em> bytes of random data from <em>pseudo-random-number-generator</em>. Updates the state of the generator.</p><div class="lisp-symbol"><a name="read-os-random-seed"></a><tt><strong>read-os-random-seed</strong> <em>prng</em> <em><tt>&optional</tt></em> <em>source</em> =&gt; <em>reseed-count</em></tt><br /></div><p>Reads an OS-provided random seed (from /dev/urandom or /dev/random
-on Unix; CryptGenRandom on Windows) and reseed <em>pseudo-random-number-generator</em>.</p><p><em>source</em> may be <tt>:RANDOM</tt>, which indicates /dev/random or <tt>:URANDOM</tt>, which indicates /dev/urandom. On Windows, CryptGenRandom
-is always used.</p><div class="lisp-symbol"><a name="read-seed"></a><tt><strong>read-seed</strong> <em>pseudo-random-number-generator</em> <em>path</em> =&gt; <em>t</em></tt><br /></div><p>Read enough bytes from <em>path</em> to reseed <em>pseudo-random-number-generator</em>, then generate a pseudo-random seed
-and write it back to <em>path</em>. If <em>path</em> doesn't exist, calls <a href="#read-os-random-seed" style="symbol">read-os-random-seed</a> to get a truly random seed from the OS.</p><div class="lisp-symbol"><a name="write-seed"></a><tt><strong>write-seed</strong> <em>prng</em> <em>path</em> =&gt; <em>t</em></tt><br /></div><p>Generate enough random data to reseed <em>pseudo-random-number-generator</em>, then write it to <em>path</em>.</p><div class="lisp-symbol"><a name="random-bits"></a><tt><strong>random-bits</strong> <em>pseudo-random-number-generator</em> <em>num-bits</em> =&gt; <em>integer</em></tt><br /></div><p>Generate and integer with <em>num-bits</em> bits.</p><div class="lisp-symbol"><a name="strong-random"></a><tt><strong>strong-random</strong> <em>limit</em> <em><tt>&optional</tt></em> <em>prng</em> =&gt; <em>number</em></tt><br /></div><p>A drop-in replacement for <em>COMMON-LISP:RANDOM</em>, <tt>STRONG-RANDOM</tt> generates a number (and integer if <em>limit</em> is an
-integer and a float if it is a float) between 0 and <em>limit</em>-1 in an
-unbiased fashion.</p><h3>Fortuna</h3><p>Fortuna is a cryptographically-secure random number presented by
-Ferguson, Schneier and Kohno in <cite>Cryptography Engineering</cite>. It is built around 32 entropy pools, which are used with decreasing
+a byte vector, it will be used to seed the PRNG.</P><DIV CLASS="lisp-symbol"><A NAME="list-all-prngs"></A><TT><STRONG>list-all-prngs</STRONG> =&gt; <EM>list</EM></TT><BR /></DIV><P>List all known PRNG types.</P><DIV CLASS="lisp-symbol"><A NAME="random-data"></A><TT><STRONG>random-data</STRONG> <EM>num-bytes</EM> <EM><TT>&optional</TT></EM> <EM>pseudo-random-number-generator</EM> =&gt; <EM>bytes</EM></TT><BR /></DIV><P>Generate <EM>num-bytes</EM> bytes of random data from <EM>pseudo-random-number-generator</EM>. Updates the state of the generator.</P><DIV CLASS="lisp-symbol"><A NAME="read-os-random-seed"></A><TT><STRONG>read-os-random-seed</STRONG> <EM>source</EM> <EM><TT>&optional</TT></EM> <EM>prng</EM> =&gt; <EM>reseed-count</EM></TT><BR /></DIV><P>Reads an OS-provided random seed (from /dev/urandom or /dev/random
+on Unix; CryptGenRandom on Windows) and reseed <EM>pseudo-random-number-generator</EM>.</P><P><EM>source</EM> may be <TT>:RANDOM</TT>, which indicates /dev/random or <TT>:URANDOM</TT>, which indicates /dev/urandom. On Windows, CryptGenRandom
+is always used.</P><DIV CLASS="lisp-symbol"><A NAME="read-seed"></A><TT><STRONG>read-seed</STRONG> <EM>path</EM> <EM><TT>&optional</TT></EM> <EM>pseudo-random-number-generator</EM> =&gt; <EM>t</EM></TT><BR /></DIV><P>Read enough bytes from <EM>path</EM> to reseed <EM>pseudo-random-number-generator</EM>, then generate a pseudo-random seed
+and write it back to <EM>path</EM>. If <EM>path</EM> doesn't exist, calls <A HREF="#read-os-random-seed" STYLE="symbol">read-os-random-seed</A> to get a truly random seed from the OS. Note
+that reseeding does <EM>not</EM> reset the generator's state to the
+seed value; rather, it <EM>combines</EM> the generator's state with
+the seed to form a new state.</P><DIV CLASS="lisp-symbol"><A NAME="write-seed"></A><TT><STRONG>write-seed</STRONG> <EM>path</EM> <EM><TT>&optional</TT></EM> <EM>prng</EM> =&gt; <EM>t</EM></TT><BR /></DIV><P>Generate enough random data to reseed <EM>pseudo-random-number-generator</EM>, then write it to <EM>path</EM>.</P><DIV CLASS="lisp-symbol"><A NAME="random-bits"></A><TT><STRONG>random-bits</STRONG> <EM>num-bits</EM> <EM><TT>&optional</TT></EM> <EM>pseudo-random-number-generator</EM> =&gt; <EM>integer</EM></TT><BR /></DIV><P>Generate and integer with <EM>num-bits</EM> bits.</P><DIV CLASS="lisp-symbol"><A NAME="strong-random"></A><TT><STRONG>strong-random</STRONG> <EM>limit</EM> <EM><TT>&optional</TT></EM> <EM>prng</EM> =&gt; <EM>number</EM></TT><BR /></DIV><P>A drop-in replacement for <EM>COMMON-LISP:RANDOM</EM>, <TT>STRONG-RANDOM</TT> generates a number (and integer if <EM>limit</EM> is an
+integer and a float if it is a float) between 0 and <EM>limit</EM>-1 in an
+unbiased fashion.</P><H3>Fortuna</H3><P>Fortuna is a cryptographically-secure random number presented by
+Ferguson, Schneier and Kohno in <CITE>Cryptography Engineering</CITE>. It is built around 32 entropy pools, which are used with decreasing
frequency for each reseed (e.g. pool 0 is used in each reseed, pool 1 in
every other reseed, pool 2 in every fourth reseed and so forth). Pools
-are seeded with data from up to 256 sources.</p><div class="lisp-symbol"><a name="add-random-event"></a><tt><strong>add-random-event</strong> <em>pseudo-random-number-generator</em> <em>source</em> <em>pool-id</em> <em>event</em> =&gt; <em>pool-length</em></tt><br /></div><p>Add entropy to <em>pseudo-random-number-generator</em>.</p><p><em>source</em> is an integer in the range 0-255 specifiying the event's
-application-defined source.</p><p><em>pool-id</em> is an integer in the range 0-31 specifying the pool to top up.</p><p><em>event</em> is up to 32 bytes of data (for longer events, hash them
-down or break them up into chunks).</p><h2 id="gray-streams">Gray Streams</h2><p>Ironclad includes support for several convenient stream
+are seeded with data from up to 256 sources.</P><P>Each application should have one or more entropy sources (say, one
+for each OS random number source, one for the low bits of the current
+time, one for the output of a particular command or group of commands
+and so forth). A source should be used to add randomness to each pool
+in order, so source 0 should top up pool 0, then pool 1, and so forth up
+to pool 31, then loop back to pool 1 again. Be very careful to spread
+entropy across all 32 pools.</P><P>Fortuna automatically feeds entropy from the pools back into its
+random state when <A HREF="#random-data" STYLE="symbol">random-data</A> is called, using a method designed to
+make it resistant to various avenues of attack; even in case of
+generator compromise it will return to a safe state within a bounded
+time.</P><P>For purposes of reseeding, Fortuna will not reseed until the first
+pool contains 128 bits of entropy; <EM>+min-pool-size+</EM> sets the number
+of bytes this is; it defaults to a very conservative 128, meaning that
+by default each byte of event is assumed to contain a single bit of
+randomness.</P><P>It also will not reseed more than ten times per second.</P><DIV CLASS="lisp-symbol"><A NAME="add-random-event"></A><TT><STRONG>add-random-event</STRONG> <EM>source</EM> <EM>pool-id</EM> <EM>event</EM> <EM><TT>&optional</TT></EM> <EM>pseudo-random-number-generator</EM> =&gt; <EM>pool-length</EM></TT><BR /></DIV><P>Add entropy to <EM>pseudo-random-number-generator</EM>.</P><P><EM>source</EM> is an integer in the range 0-255 specifiying the event's
+application-defined source.</P><P><EM>pool-id</EM> is an integer in the range 0-31 specifying the pool to top up.</P><P><EM>event</EM> is up to 32 bytes of data (for longer events, hash them
+down or break them up into chunks).</P><H2 ID="gray-streams">Gray Streams</H2><P>Ironclad includes support for several convenient stream
abstractions based on Gray streams. Gray streams support in Ironclad is
-included for SBCL, CMUCL, OpenMCL, Lispworks, and Allegro.</p><h3>Octet streams</h3><p>Octet streams are very similar to Common Lisp's <a href="#string-stream" style="symbol">string-stream</a>,
-except they deal in octets instead of characters.</p><div class="lisp-symbol"><a name="make-octet-input-stream"></a><tt><strong>make-octet-input-stream</strong> <em>buffer</em> <em><tt>&optional</tt></em> <em>start</em> <em>end</em> =&gt; <em>octet-input-stream</em></tt><br /></div><p>As <a href="#make-string-input-stream" style="symbol">make-string-input-stream</a>, only with octets instead of characters.</p><div class="lisp-symbol"><a name="make-octet-output-stream"></a><tt><strong>make-octet-output-stream</strong> =&gt; <em>octet-output-stream</em></tt><br /></div><p>As <a href="#make-string-output-stream" style="symbol">make-string-output-stream</a>, only with octets instead of characters.</p><div class="lisp-symbol"><a name="get-output-stream-octets"></a><tt><strong>get-output-stream-octets</strong> <em>stream</em> =&gt; <em>octet-vector</em></tt><br /></div><p>As <a href="#get-output-stream-string" style="symbol">get-output-stream-string</a>, only with an octet output-steam
-instead of a string output-stream.</p><h3>Digest streams</h3><p>Digest streams compute a digest of the data written to them
-according to a specific digest algorithm.</p><p>Example:</p><pre>(defun frobbing-function (stream)
+included for SBCL, CMUCL, OpenMCL, Lispworks, and Allegro.</P><H3>Octet streams</H3><P>Octet streams are very similar to Common Lisp's <A HREF="#string-stream" STYLE="symbol">string-stream</A>,
+except they deal in octets instead of characters.</P><DIV CLASS="lisp-symbol"><A NAME="make-octet-input-stream"></A><TT><STRONG>make-octet-input-stream</STRONG> <EM>buffer</EM> <EM><TT>&optional</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>octet-input-stream</EM></TT><BR /></DIV><P>As <A HREF="#make-string-input-stream" STYLE="symbol">make-string-input-stream</A>, only with octets instead of characters.</P><DIV CLASS="lisp-symbol"><A NAME="make-octet-output-stream"></A><TT><STRONG>make-octet-output-stream</STRONG> =&gt; <EM>octet-output-stream</EM></TT><BR /></DIV><P>As <A HREF="#make-string-output-stream" STYLE="symbol">make-string-output-stream</A>, only with octets instead of characters.</P><DIV CLASS="lisp-symbol"><A NAME="get-output-stream-octets"></A><TT><STRONG>get-output-stream-octets</STRONG> <EM>stream</EM> =&gt; <EM>octet-vector</EM></TT><BR /></DIV><P>As <A HREF="#get-output-stream-string" STYLE="symbol">get-output-stream-string</A>, only with an octet output-steam
+instead of a string output-stream.</P><H3>Digest streams</H3><P>Digest streams compute a digest of the data written to them
+according to a specific digest algorithm.</P><P>Example:</P><PRE>(defun frobbing-function (stream)
;; We want to compute a digest of the data being written to STREAM
;; without involving our callees in the process.
(let* ((digesting-stream (crypto:make-digesting-stream :sha1))
@@ -193,31 +226,31 @@
(frob-guts stream)
;; Do something with the digest computed.
(... (crypto:produce-digest digesting-stream) ...)
- ...))</pre><div class="lisp-symbol"><a name="make-digesting-stream"></a><tt><strong>make-digesting-stream</strong> <em>digest</em> =&gt; <em>stream</em></tt><br /></div><p>Make a stream that computes a digest of the data written to it
-according to the algorithm <em>digest-name</em>. <a href="#produce-digest" style="symbol">produce-digest</a> may
-be used to obtain a digest of all the data written to the stream.</p><table class="note"><tr><td class="title">Note</td><td class="content">Calling <a href="#produce-digest" style="symbol">produce-digest</a> on a digest stream does not alter
-the internal state of the digest.</td></tr></table><h2>Utility Functions</h2><div class="lisp-symbol"><a name="ub16ref/le"></a><tt><strong>ub16ref/le</strong> <em>vector</em> <em>index</em> =&gt; <em>value</em></tt><br /><a name="ub32ref/le"></a><tt><strong>ub32ref/le</strong> <em>vector</em> <em>index</em> =&gt; <em>value</em></tt><br /><a name="ub64ref/le"></a><tt><strong>ub64ref/le</strong> <em>vector</em> <em>index</em> =&gt; <em>value</em></tt><br /></div><p>This family of functions accesses an unsigned 16-bit, 32-bit or
-64-bit value stored in little-endian order starting at <em>index</em> in <em>array</em>. <em>array</em> must be a <tt>(SIMPLE-ARRAY (UNSIGNED-BYTE 8)
-(*))</tt>. These functions are SETFable.</p><div class="lisp-symbol"><a name="ub16ref/be"></a><tt><strong>ub16ref/be</strong> <em>vector</em> <em>index</em> =&gt; <em>value</em></tt><br /><a name="ub32ref/be"></a><tt><strong>ub32ref/be</strong> <em>vector</em> <em>index</em> =&gt; <em>value</em></tt><br /><a name="ub64ref/be"></a><tt><strong>ub64ref/be</strong> <em>vector</em> <em>index</em> =&gt; <em>value</em></tt><br /></div><p>As the above, only the value is stored in big-endian order.</p><div class="lisp-symbol"><a name="byte-array-to-hex-string"></a><tt><strong>byte-array-to-hex-string</strong> <em>vector</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> <em>element-type</em> =&gt; <em>string</em></tt><br /><a name="hex-string-to-byte-array"></a><tt><strong>hex-string-to-byte-array</strong> <em>string</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>string</em></tt><br /><a name="ascii-string-to-byte-array"></a><tt><strong>ascii-string-to-byte-array</strong> <em>string</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> =&gt; <em>vector</em></tt><br /></div><p><tt>byte-array-to-hex-string</tt> converts the bytes of <em>vector</em>
-between <em>start</em> and <em>end</em> into a hexadecimal string. It is
-useful for converting digests to a more readable form. <em>element-type</em> indicates the element-type of the returned string.</p><p><tt>hex-string-to-byte-array</tt> parses a substring of <em>string</em>
-delimited <em>start</em> and <em>end</em> of hexadecimal digits into a byte
-array.</p><p><tt>ascii-string-to-byte-array</tt> is provided as a quick and dirty way
-to convert a string to a byte array suitable for feeding to <a href="#update-digest" style="symbol">update-digest</a> or <a href="#encrypt" style="symbol">encrypt</a>. Care should be taken to ensure that
-the provided string is actually an ASCII string. <em>start</em> and <em>end</em> have their usual interpretations.</p><div class="lisp-symbol"><a name="octets-to-integer"></a><tt><strong>octets-to-integer</strong> <em>octet-vec</em> <em><tt>&key</tt></em> <em>start</em> <em>end</em> <em>big-endian</em> <em>n-bits</em> =&gt; <em>number</em></tt><br /><a name="integer-to-octets"></a><tt><strong>integer-to-octets</strong> <em>bignum</em> <em><tt>&key</tt></em> <em>n-bits</em> <em>big-endian</em> =&gt; <em>vector</em></tt><br /></div><p><tt>octets-to-integer</tt> converts the bytes of <em>octet-vec</em> between
-<em>start</em> and <em>end</em> to an integer as though the bytes denoted a
-number in base 256. <em>big-endian</em> is a boolean indicating whether
-the bytes are to be read in big-endian or little-endian order. <em>n-bits</em> specifies how many bits should be considered as significant
-in the resulting number.</p><p><tt>integer-to-octets</tt> is the reverse operation.</p><div class="lisp-symbol"><a name="expt-mod"></a><tt><strong>expt-mod</strong> =&gt; <em>number</em></tt><br /></div><p>Raises <em>n</em> to the <em>exponent</em> power modulo <em>modulus</em> in
-a more efficient fashion than <tt>(MOD (EXPT N EXPONENT) MODULUS)</tt>.</p><div class="lisp-symbol"><a name="make-random-salt"></a><tt><strong>make-random-salt</strong> <em><tt>&optional</tt></em> <em>size</em> =&gt; <em>size</em></tt><br /></div><p>Generate a byte vector of <em>size</em> (default 16) random bytes, suitable
-for use as a password salt.</p><h2>Conditions</h2><div class="lisp-symbol"><a name="ironclad-error"></a><tt><strong>ironclad-error</strong></tt><br /></div><p>All errors signaled by Ironclad are of this type. This type is a
-direct subtype of <tt>SIMPLE-ERROR</tt> without any extra slots or
-options.</p><div class="lisp-symbol"><a name="initialization-vector-not-supplied"></a><tt><strong>initialization-vector-not-supplied</strong></tt><br /></div><p>This error is signaled by <a href="#make-cipher" style="symbol">make-cipher</a> when an initialization
+ ...))</PRE><DIV CLASS="lisp-symbol"><A NAME="make-digesting-stream"></A><TT><STRONG>make-digesting-stream</STRONG> <EM>digest</EM> =&gt; <EM>stream</EM></TT><BR /></DIV><P>Make a stream that computes a digest of the data written to it
+according to the algorithm <EM>digest-name</EM>. <A HREF="#produce-digest" STYLE="symbol">produce-digest</A> may
+be used to obtain a digest of all the data written to the stream.</P><TABLE CLASS="note"><TR><TD CLASS="title">Note</TD><TD CLASS="content">Calling <A HREF="#produce-digest" STYLE="symbol">produce-digest</A> on a digest stream does not alter
+the internal state of the digest.</TD></TR></TABLE><H2>Utility Functions</H2><DIV CLASS="lisp-symbol"><A NAME="ub16ref/le"></A><TT><STRONG>ub16ref/le</STRONG> <EM>vector</EM> <EM>index</EM> =&gt; <EM>value</EM></TT><BR /><A NAME="ub32ref/le"></A><TT><STRONG>ub32ref/le</STRONG> <EM>vector</EM> <EM>index</EM> =&gt; <EM>value</EM></TT><BR /><A NAME="ub64ref/le"></A><TT><STRONG>ub64ref/le</STRONG> <EM>vector</EM> <EM>index</EM> =&gt; <EM>value</EM></TT><BR /></DIV><P>This family of functions accesses an unsigned 16-bit, 32-bit or
+64-bit value stored in little-endian order starting at <EM>index</EM> in <EM>array</EM>. <EM>array</EM> must be a <TT>(SIMPLE-ARRAY (UNSIGNED-BYTE 8)
+(*))</TT>. These functions are SETFable.</P><DIV CLASS="lisp-symbol"><A NAME="ub16ref/be"></A><TT><STRONG>ub16ref/be</STRONG> <EM>vector</EM> <EM>index</EM> =&gt; <EM>value</EM></TT><BR /><A NAME="ub32ref/be"></A><TT><STRONG>ub32ref/be</STRONG> <EM>vector</EM> <EM>index</EM> =&gt; <EM>value</EM></TT><BR /><A NAME="ub64ref/be"></A><TT><STRONG>ub64ref/be</STRONG> <EM>vector</EM> <EM>index</EM> =&gt; <EM>value</EM></TT><BR /></DIV><P>As the above, only the value is stored in big-endian order.</P><DIV CLASS="lisp-symbol"><A NAME="byte-array-to-hex-string"></A><TT><STRONG>byte-array-to-hex-string</STRONG> <EM>vector</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> <EM>element-type</EM> =&gt; <EM>string</EM></TT><BR /><A NAME="hex-string-to-byte-array"></A><TT><STRONG>hex-string-to-byte-array</STRONG> <EM>string</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>string</EM></TT><BR /><A NAME="ascii-string-to-byte-array"></A><TT><STRONG>ascii-string-to-byte-array</STRONG> <EM>string</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> =&gt; <EM>vector</EM></TT><BR /></DIV><P><TT>byte-array-to-hex-string</TT> converts the bytes of <EM>vector</EM>
+between <EM>start</EM> and <EM>end</EM> into a hexadecimal string. It is
+useful for converting digests to a more readable form. <EM>element-type</EM> indicates the element-type of the returned string.</P><P><TT>hex-string-to-byte-array</TT> parses a substring of <EM>string</EM>
+delimited <EM>start</EM> and <EM>end</EM> of hexadecimal digits into a byte
+array.</P><P><TT>ascii-string-to-byte-array</TT> is provided as a quick and dirty way
+to convert a string to a byte array suitable for feeding to <A HREF="#update-digest" STYLE="symbol">update-digest</A> or <A HREF="#encrypt" STYLE="symbol">encrypt</A>. Care should be taken to ensure that
+the provided string is actually an ASCII string. <EM>start</EM> and <EM>end</EM> have their usual interpretations.</P><DIV CLASS="lisp-symbol"><A NAME="octets-to-integer"></A><TT><STRONG>octets-to-integer</STRONG> <EM>octet-vec</EM> <EM><TT>&key</TT></EM> <EM>start</EM> <EM>end</EM> <EM>big-endian</EM> <EM>n-bits</EM> =&gt; <EM>number</EM></TT><BR /><A NAME="integer-to-octets"></A><TT><STRONG>integer-to-octets</STRONG> <EM>bignum</EM> <EM><TT>&key</TT></EM> <EM>n-bits</EM> <EM>big-endian</EM> =&gt; <EM>vector</EM></TT><BR /></DIV><P><TT>octets-to-integer</TT> converts the bytes of <EM>octet-vec</EM> between
+<EM>start</EM> and <EM>end</EM> to an integer as though the bytes denoted a
+number in base 256. <EM>big-endian</EM> is a boolean indicating whether
+the bytes are to be read in big-endian or little-endian order. <EM>n-bits</EM> specifies how many bits should be considered as significant
+in the resulting number.</P><P><TT>integer-to-octets</TT> is the reverse operation.</P><DIV CLASS="lisp-symbol"><A NAME="expt-mod"></A><TT><STRONG>expt-mod</STRONG> =&gt; <EM>number</EM></TT><BR /></DIV><P>Raises <EM>n</EM> to the <EM>exponent</EM> power modulo <EM>modulus</EM> in
+a more efficient fashion than <TT>(MOD (EXPT N EXPONENT) MODULUS)</TT>.</P><DIV CLASS="lisp-symbol"><A NAME="make-random-salt"></A><TT><STRONG>make-random-salt</STRONG> <EM><TT>&optional</TT></EM> <EM>size</EM> =&gt; <EM>size</EM></TT><BR /></DIV><P>Generate a byte vector of <EM>size</EM> (default 16) random bytes, suitable
+for use as a password salt.</P><H2>Conditions</H2><DIV CLASS="lisp-symbol"><A NAME="ironclad-error"></A><TT><STRONG>ironclad-error</STRONG></TT><BR /></DIV><P>All errors signaled by Ironclad are of this type. This type is a
+direct subtype of <TT>SIMPLE-ERROR</TT> without any extra slots or
+options.</P><DIV CLASS="lisp-symbol"><A NAME="initialization-vector-not-supplied"></A><TT><STRONG>initialization-vector-not-supplied</STRONG></TT><BR /></DIV><P>This error is signaled by <A HREF="#make-cipher" STYLE="symbol">make-cipher</A> when an initialization
vector is not provided and the requested mode requires an initialization
-vector.</p><div class="lisp-symbol"><a name="invalid-initialization-vector"></a><tt><strong>invalid-initialization-vector</strong></tt><br /></div><p>This error is signaled when an invalid initialization vector is
-supplied to <a href="#make-cipher" style="symbol">make-cipher</a> (e.g. when the length of the initialization
-vector does not match the block length of the cipher).</p><div class="lisp-symbol"><a name="invalid-key-length"></a><tt><strong>invalid-key-length</strong></tt><br /></div><p>This error is signaled when the key provided to <a href="#make-cipher" style="symbol">make-cipher</a> is
-not of an acceptable length for the requested cipher.</p><div class="lisp-symbol"><a name="unsupported-cipher"></a><tt><strong>unsupported-cipher</strong></tt><br /></div><p>This error is signaled when the <em>cipher-name</em> provided to <a href="#make-cipher" style="symbol">make-cipher</a> is not <a href="#cipher-supported-p" style="symbol">cipher-supported-p</a>.</p><div class="lisp-symbol"><a name="unsupported-mode"></a><tt><strong>unsupported-mode</strong></tt><br /></div><p>This error is signaled when the <em>mode</em> provided to <a href="#make-cipher" style="symbol">make-cipher</a> is not <a href="#mode-supported-p" style="symbol">mode-supported-p</a>.</p><div class="lisp-symbol"><a name="unsupported-digest"></a><tt><strong>unsupported-digest</strong></tt><br /></div><p>This error is signaled when the <em>digest-name</em> provided to <a href="#make-digest" style="symbol">make-digest</a> is not <a href="#digest-supported-p" style="symbol">digest-supported-p</a>.</p><div class="lisp-symbol"><a name="insufficient-buffer-space"></a><tt><strong>insufficient-buffer-space</strong></tt><br /></div><p>This error is signaled when Ironclad needs to stuff some data into a
-buffer (e.g. when the user provides <em>digest</em> to <a href="#produce-digest" style="symbol">produce-digest</a>) and
-there is insufficient space.</p><div class="lisp-symbol"><a name="key-not-supplied"></a><tt><strong>key-not-supplied</strong></tt><br /></div><p>This error is signaled when a <tt>:KEY</tt> argument is not provided
-to <a href="#make-cipher" style="symbol">make-cipher</a>.</p></body></html>
+vector.</P><DIV CLASS="lisp-symbol"><A NAME="invalid-initialization-vector"></A><TT><STRONG>invalid-initialization-vector</STRONG></TT><BR /></DIV><P>This error is signaled when an invalid initialization vector is
+supplied to <A HREF="#make-cipher" STYLE="symbol">make-cipher</A> (e.g. when the length of the initialization
+vector does not match the block length of the cipher).</P><DIV CLASS="lisp-symbol"><A NAME="invalid-key-length"></A><TT><STRONG>invalid-key-length</STRONG></TT><BR /></DIV><P>This error is signaled when the key provided to <A HREF="#make-cipher" STYLE="symbol">make-cipher</A> is
+not of an acceptable length for the requested cipher.</P><DIV CLASS="lisp-symbol"><A NAME="unsupported-cipher"></A><TT><STRONG>unsupported-cipher</STRONG></TT><BR /></DIV><P>This error is signaled when the <EM>cipher-name</EM> provided to <A HREF="#make-cipher" STYLE="symbol">make-cipher</A> is not <A HREF="#cipher-supported-p" STYLE="symbol">cipher-supported-p</A>.</P><DIV CLASS="lisp-symbol"><A NAME="unsupported-mode"></A><TT><STRONG>unsupported-mode</STRONG></TT><BR /></DIV><P>This error is signaled when the <EM>mode</EM> provided to <A HREF="#make-cipher" STYLE="symbol">make-cipher</A> is not <A HREF="#mode-supported-p" STYLE="symbol">mode-supported-p</A>.</P><DIV CLASS="lisp-symbol"><A NAME="unsupported-digest"></A><TT><STRONG>unsupported-digest</STRONG></TT><BR /></DIV><P>This error is signaled when the <EM>digest-name</EM> provided to <A HREF="#make-digest" STYLE="symbol">make-digest</A> is not <A HREF="#digest-supported-p" STYLE="symbol">digest-supported-p</A>.</P><DIV CLASS="lisp-symbol"><A NAME="insufficient-buffer-space"></A><TT><STRONG>insufficient-buffer-space</STRONG></TT><BR /></DIV><P>This error is signaled when Ironclad needs to stuff some data into a
+buffer (e.g. when the user provides <EM>digest</EM> to <A HREF="#produce-digest" STYLE="symbol">produce-digest</A>) and
+there is insufficient space.</P><DIV CLASS="lisp-symbol"><A NAME="key-not-supplied"></A><TT><STRONG>key-not-supplied</STRONG></TT><BR /></DIV><P>This error is signaled when a <TT>:KEY</TT> argument is not provided
+to <A HREF="#make-cipher" STYLE="symbol">make-cipher</A>.</P></BODY></HTML>
View
2  ironclad.asd
@@ -27,7 +27,7 @@
(defmethod source-file-type ((c css-file) (s module)) "css")
(asdf:defsystem :ironclad
- :version "0.30"
+ :version "0.31"
:author "Nathan Froyd <froydnj@gmail.com>"
:maintainer "Nathan Froyd <froydnj@gmail.com>"
:description "A cryptographic toolkit written in pure Common Lisp"

0 comments on commit 6fdafa1

Please sign in to comment.
Something went wrong with that request. Please try again.