aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-28 20:18:44 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-28 20:18:44 +0200
commit29c6ce57dbf03feade1335aad5ff5b39a5b0c89c (patch)
tree9e34d4771ab1602311f781e33b3883c737809b8e
parentinfo: hashing files (diff)
downloadlibkeccak-29c6ce57dbf03feade1335aad5ff5b39a5b0c89c.tar.gz
libkeccak-29c6ce57dbf03feade1335aad5ff5b39a5b0c89c.tar.bz2
libkeccak-29c6ce57dbf03feade1335aad5ff5b39a5b0c89c.tar.xz
todo + info: hmac
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--TODO3
-rw-r--r--doc/info/libkeccak.texinfo91
2 files changed, 94 insertions, 0 deletions
diff --git a/TODO b/TODO
index d2f56d0..728454b 100644
--- a/TODO
+++ b/TODO
@@ -10,3 +10,6 @@ Test parallelisation and acceleration.
Measure cycles per byte.
+Fix todos in the texinfo file.
+Add man pages.
+
diff --git a/doc/info/libkeccak.texinfo b/doc/info/libkeccak.texinfo
index 6b238d7..da754ec 100644
--- a/doc/info/libkeccak.texinfo
+++ b/doc/info/libkeccak.texinfo
@@ -74,6 +74,7 @@ with support for bit-oriented data.
* Hashing messages:: Functions used to hash a message.
* Hexadecimal hashes:: Converting between binary and hexadecimal.
* Hashing files:: Functions used to hash entire files.
+* Message authentication:: Functions used for message authentication codes.
* GNU Affero General Public License:: Copying and sharing libkeccak.
* GNU Free Documentation License:: Copying and sharing this manual.
@@ -628,6 +629,93 @@ otherwise identical to @code{libkeccak_rawshakesum_fd}.
+@node Message authentication
+@chapter Message authentication
+
+libkeccak supports HMAC. Note that secure message
+authentication codes can be trivially be created
+with Keccak by simple prepending the key to the
+message; although it will not be HMAC. This makes
+Keccak a good hash function alternative for people
+who knows next to nothing about cryptography.
+
+To keep track of the hashing state, the structure
+@code{libkeccak_hmac_state_t} (@code{struct libkeccak_hmac_state})
+is used. It has a number of methods analogous to
+those for @code{libkeccak_state_t}:
+@table @code
+@item libkeccak_hmac_initialise
+Has for parameters: pointer to a @code{libkeccak_hmac_state_t}
+to initialise, hashing specifications (@code{const libkeccak_spec_t*}),
+binary key, and the length of the key.
+
+@item libkeccak_hmac_create
+Similar to @code{libkeccak_hmac_initialise}. It does
+not have a @code{libkeccak_hmac_state_t*} as an output
+parameter, rather it returns one.
+
+@item libkeccak_hmac_reset
+Resets the sponge and the sets the key, by
+calling @code{libkeccak_hmac_set_key}. IT
+has three paramters: pointer to the
+@code{libkeccak_hmac_state_t}, the binary key,
+and the length of the key.
+The key will not be set if the second
+argument is @code{NULL}.
+
+@item libkeccak_hmac_wipe
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_fast_destroy
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_destroy
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_fast_free
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item void libkeccak_hmac_free
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_copy
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_duplicate
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_marshal_size
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_marshal
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_unmarshal
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_unmarshal_skip
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_fast_update
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_update
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_fast_digest
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+
+@item libkeccak_hmac_digest
+Perfectly analogous to the @code{libkeccak_state_t} counterpart.
+@end table
+
+It also has the method @code{libkeccak_hmac_set_key} which
+can be used set the key. This function is identical to
+@code{libkeccak_hmac_reset}, except it will not reset the
+sponge, and the second argument must not be @code{NULL}.
+
+
+
@node GNU Affero General Public License
@appendix GNU Affero General Public License
@include agpl-3.0.texinfo
@@ -651,3 +739,6 @@ otherwise identical to @code{libkeccak_rawshakesum_fd}.
@bye
+TODO add indices
+TODO examples
+