...
 
Commits (2)
/* cmac-des3.c
CMAC using TrippleDES as the underlying cipher.
CMAC using TripleDES as the underlying cipher.
Copyright (C) 2019 Dmitry Eremin-Solenikov
......
/*
AES-CMAC-128 (rfc 4493) / CMAC-64
CMAC-64, NIST SP 800-38B
Copyright (C) Stefan Metzmacher 2012
Copyright (C) Jeremy Allison 2012
Copyright (C) Michael Adam 2012
......
......@@ -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
......