Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Nettle
nettle
Commits
0e1108ba
Commit
0e1108ba
authored
Dec 25, 2019
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document SHAKE-256.
parent
64a6def6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
ChangeLog
ChangeLog
+1
-0
nettle.texinfo
nettle.texinfo
+22
-0
No files found.
ChangeLog
View file @
0e1108ba
...
...
@@ -8,6 +8,7 @@
* testsuite/shake.awk: New script to extract test vectors.
* testsuite/Makefile.in (TS_NETTLE_SOURCES): Add shake256-test.c.
(DISTFILES): Add shake.awk.
* nettle.texinfo (Recommended hash functions): Document SHAKE-256.
* sha3.c (_sha3_pad): Generalized with an argument for the magic
suffix defining the sha3 instance.
...
...
nettle.texinfo
View file @
0e1108ba
...
...
@@ -834,6 +834,28 @@ octets of the digest are written.
This function also resets the context.
@end deftypefun
@subsubsection @acronym
{
SHAKE-256
}
@cindex SHAKE
In addition to those SHA-3 hash functions, Nettle also provides a SHA-3
extendable-output function (XOF), SHAKE-256. Unlike SHA-3 hash functions,
SHAKE can produce an output digest of any desired length.
To use SHAKE256, the context struct, init and update functions are the
same as for SHA3-256. To get a SHAKE256 digest, the following function
is used instead of @code
{
sha3
_
256
_
digest
}
. For an output size of
@code
{
SHA3
_
256
_
DIGEST
_
SIZE
}
, security is equivalent to SHA3-256 (but the
digest is different). Increasing output size further does not increase
security in terms of collision or preimage resistance. It can be seen as
a built in pseudorandomness generator.
@deftypefun void sha3
_
256
_
shake (struct shake256
_
ctx *@var
{
ctx
}
, size
_
t @var
{
length
}
, uint8
_
t *@var
{
digest
}
)
Performs final processing and produces a SHAKE256 digest, writing it
to @var
{
digest
}
. @var
{
length
}
can be of arbitrary size.
This function also resets the context.
@end deftypefun
@node Legacy hash functions, nettle
_
hash abstraction, Recommended hash functions, Hash functions
@comment node-name, next, previous, up
@subsection Legacy hash functions
...
...
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