Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
41b6e728
Commit
41b6e728
authored
Jul 22, 2019
by
Dmitry Baryshkov
Committed by
Niels Möller
Jul 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand documentation to cover CMAC-64
parent
e381cfeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
nettle.texinfo
nettle.texinfo
+34
-4
No files found.
nettle.texinfo
View file @
41b6e728
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment