Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
fd0413bb
Commit
fd0413bb
authored
Jan 01, 2013
by
Niels Möller
Browse files
Document additional sha3 functions.
parent
61002bdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
fd0413bb
2013-01-01 Niels Möller <nisse@lysator.liu.se>
* nettle.texinfo (Recommended hash functions): Document additional
sha3 functions.
* examples/nettle-benchmark.c (main): Benchmark additional sha3
functions.
...
...
nettle.texinfo
View file @
fd0413bb
...
...
@@ -542,23 +542,59 @@ This function also resets the context in the same way as
@code
{
sha384
_
init
}
.
@end deftypefun
@subsubsection @acronym
{
SHA3-2
56
}
@subsubsection @acronym
{
SHA3-2
24
}
The SHA3 hash functions were specified by NIST in repsonse to weaknesses
in SHA1, and doubts about SHA2 hashfunctions which structurally are very
similar to SHA1. The standard is a result of a competition, where the
winning design, also known as Keccak, was designed by Guido Bertoni,
Joan Daemen, Michaël Peeters and Gilles Van Assche. It is structurally
very different from all widely used earlier hash functions. Nettle's
current implementation is pretty slow.
in SHA1, and doubts about SHA2 hash functions which structurally are
very similar to SHA1. The standard is a result of a competition, where
the winner, also known as Keccak, was designed by Guido Bertoni, Joan
Daemen, Michaël Peeters and Gilles Van Assche. It is structurally very
different from all widely used earlier hash functions. Like SHA2, there
are several variants, with output sizes of 224, 256, 384 and 512 bits
(28, 32, 48 and 64 octets, respectively).
Nettle defines SHA3-2
56
in @file
{
<nettle/sha3.h>
}
.
Nettle defines SHA3-2
24
in @file
{
<nettle/sha3.h>
}
.
@deftp
{
Context struct
}
{
struct sha3
_
224
_
ctx
}
@end deftp
@defvr Constant SHA3
_
224
_
DIGEST
_
SIZE
The size of a SHA3
_
224 digest, i.e., 28.
@end defvr
@defvr Constant SHA3
_
224
_
DATA
_
SIZE
The internal block size of SHA3
_
224.
@end defvr
@deftypefun void sha3
_
224
_
init (struct sha3
_
224
_
ctx *@var
{
ctx
}
)
Initialize the SHA3-224 state.
@end deftypefun
@deftypefun void sha3
_
224
_
update (struct sha3
_
224
_
ctx *@var
{
ctx
}
, unsigned @var
{
length
}
, const uint8
_
t *@var
{
data
}
)
Hash some more data.
@end deftypefun
@deftypefun void sha3
_
224
_
digest (struct sha3
_
224
_
ctx *@var
{
ctx
}
, unsigned @var
{
length
}
, uint8
_
t *@var
{
digest
}
)
Performs final processing and extracts the message digest, writing it
to @var
{
digest
}
. @var
{
length
}
may be smaller than
@code
{
SHA3
_
224
_
DIGEST
_
SIZE
}
, in which case only the first @var
{
length
}
octets of the digest are written.
This function also resets the context.
@end deftypefun
@subsubsection @acronym
{
SHA3-256
}
This is SHA3 with 256-bit output size, and possibly the most useful
of the SHA3 hash functions.
Nettle defines SHA3-256 in @file
{
<nettle/sha3.h>
}
.
@deftp
{
Context struct
}
{
struct sha3
_
256
_
ctx
}
@end deftp
@defvr Constant SHA3
_
256
_
DIGEST
_
SIZE
The size of a
n
SHA3
_
256 digest, i.e. 32.
The size of a SHA3
_
256 digest, i.e.
,
32.
@end defvr
@defvr Constant SHA3
_
256
_
DATA
_
SIZE
...
...
@@ -579,8 +615,75 @@ to @var{digest}. @var{length} may be smaller than
@code
{
SHA3
_
256
_
DIGEST
_
SIZE
}
, in which case only the first @var
{
length
}
octets of the digest are written.
This function also resets the context in the same way as
@code
{
sha3
_
256
_
init
}
.
This function also resets the context.
@end deftypefun
@subsubsection @acronym
{
SHA3-384
}
This is SHA3 with 384-bit output size.
Nettle defines SHA3-384 in @file
{
<nettle/sha3.h>
}
.
@deftp
{
Context struct
}
{
struct sha3
_
384
_
ctx
}
@end deftp
@defvr Constant SHA3
_
384
_
DIGEST
_
SIZE
The size of a SHA3
_
384 digest, i.e., 48.
@end defvr
@defvr Constant SHA3
_
384
_
DATA
_
SIZE
The internal block size of SHA3
_
384.
@end defvr
@deftypefun void sha3
_
384
_
init (struct sha3
_
384
_
ctx *@var
{
ctx
}
)
Initialize the SHA3-384 state.
@end deftypefun
@deftypefun void sha3
_
384
_
update (struct sha3
_
384
_
ctx *@var
{
ctx
}
, unsigned @var
{
length
}
, const uint8
_
t *@var
{
data
}
)
Hash some more data.
@end deftypefun
@deftypefun void sha3
_
384
_
digest (struct sha3
_
384
_
ctx *@var
{
ctx
}
, unsigned @var
{
length
}
, uint8
_
t *@var
{
digest
}
)
Performs final processing and extracts the message digest, writing it
to @var
{
digest
}
. @var
{
length
}
may be smaller than
@code
{
SHA3
_
384
_
DIGEST
_
SIZE
}
, in which case only the first @var
{
length
}
octets of the digest are written.
This function also resets the context.
@end deftypefun
@subsubsection @acronym
{
SHA3-512
}
This is SHA3 with 512-bit output size.
Nettle defines SHA3-512 in @file
{
<nettle/sha3.h>
}
.
@deftp
{
Context struct
}
{
struct sha3
_
512
_
ctx
}
@end deftp
@defvr Constant SHA3
_
512
_
DIGEST
_
SIZE
The size of a SHA3
_
512 digest, i.e. 64.
@end defvr
@defvr Constant SHA3
_
512
_
DATA
_
SIZE
The internal block size of SHA3
_
512.
@end defvr
@deftypefun void sha3
_
512
_
init (struct sha3
_
512
_
ctx *@var
{
ctx
}
)
Initialize the SHA3-512 state.
@end deftypefun
@deftypefun void sha3
_
512
_
update (struct sha3
_
512
_
ctx *@var
{
ctx
}
, unsigned @var
{
length
}
, const uint8
_
t *@var
{
data
}
)
Hash some more data.
@end deftypefun
@deftypefun void sha3
_
512
_
digest (struct sha3
_
512
_
ctx *@var
{
ctx
}
, unsigned @var
{
length
}
, uint8
_
t *@var
{
digest
}
)
Performs final processing and extracts the message digest, writing it
to @var
{
digest
}
. @var
{
length
}
may be smaller than
@code
{
SHA3
_
512
_
DIGEST
_
SIZE
}
, in which case only the first @var
{
length
}
octets of the digest are written.
This function also resets the context.
@end deftypefun
@node Legacy hash functions, nettle
_
hash abstraction, Recommended hash functions, Hash functions
...
...
Write
Preview
Supports
Markdown
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