diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2019-07-22 08:37:12 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2019-07-22 08:37:12 +0200 |
commit | 41b6e72869877143a8ba56865bb8b92b3e6e97bf (patch) | |
tree | dd0ac256c372d27fcf2ce7c36a60fd4470436a87 | |
parent | e381cfeb37fafa4a96469f1a7d1baabe86f88ad9 (diff) | |
download | nettle-41b6e72869877143a8ba56865bb8b92b3e6e97bf.tar.gz |
Expand documentation to cover CMAC-64cmac64
-rw-r--r-- | nettle.texinfo | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/nettle.texinfo b/nettle.texinfo index 9cdec480..5e29018e 100644 --- a/nettle.texinfo +++ b/nettle.texinfo @@ -3815,14 +3815,21 @@ as described above, the new value is used unless you call the @node CMAC,, UMAC, Keyed hash functions @subsection @acronym{CMAC} @cindex CMAC +@cindex CMAC-128 +@cindex CMAC-64 @acronym{CMAC} is a message authentication code based on CBC encryption mode. It is suitable for systems where block ciphers are preferrable -and perform better than hash functions. @acronym{CMAC} is specified in +and perform better than hash functions. @acronym{CMAC-128} is specified in @cite{RFC4493}. The block size is always 128 bits (16 octets). +@acronym{CMAC-64} is specified by +@uref{https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38B.pdf, +NIST Special Publication 800-38B}. The block size is always 64 bits +(8 octets). -Nettle provides helper functions for @acronym{CMAC } with -the @acronym{AES} block cipher. +Nettle provides helper functions for @acronym{CMAC-128} with +the @acronym{AES} block cipher and for @acronym{CMAC-64} with +the @acronym{Tripple-DES} block cipher. Nettle defines @acronym{CMAC} in @file{<nettle/cmac.h>}. @@ -3831,7 +3838,7 @@ Nettle defines @acronym{CMAC} in @file{<nettle/cmac.h>}. @end deftp @defvr Constant CMAC128_DIGEST_SIZE -The size of an CMAC digest, 16. +The size of an CMAC-128 digest, 16. @end defvr @deftypefun void cmac_aes128_set_key (struct cmac_aes128_ctx *@var{ctx}, const uint8_t *@var{key}) @@ -3866,6 +3873,29 @@ provide a smaller value, only the first @var{length} octets of the processing of a new message with the same key. @end deftypefun +@deftp {Context struct} {struct cmac_des3_ctx} +@end deftp + +@defvr Constant CMAC64_DIGEST_SIZE +The size of an CMAC-64 digest, 8. +@end defvr + +@deftypefun void cmac_des3_set_key (struct cmac_des3_ctx *@var{ctx}, const uint8_t *@var{key}) +This function initializes the @acronym{CMAC} context struct for @acronym{Tripple-DES}. +@end deftypefun + +@deftypefun void cmac_des3_update (struct cmac_des3_ctx *@var{ctx},size_t @var{length}, const uint8_t *@var{data}) +This function is called zero or more times to process the message. +@end deftypefun + +@deftypefun void cmac_des3_digest (struct cmac_des3_ctx *@var{ctx}, size_t @var{length}, uint8_t *@var{digest}) +Extracts the @acronym{MAC} of the message, writing it to @var{digest}. +@var{length} is usually equal to the specified output size, but if you +provide a smaller value, only the first @var{length} octets of the +@acronym{MAC} are written. This function resets the context for +processing of a new message with the same key. +@end deftypefun + @node Poly1305,, CMAC, Keyed hash functions @comment node-name, next, previous, up @subsection Poly1305 |