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
Brian Smith
nettle
Commits
ca1ffaf8
Commit
ca1ffaf8
authored
May 04, 2014
by
Niels Möller
Browse files
Document ChaCha.
parent
0a68c384
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
ca1ffaf8
...
...
@@ -2,6 +2,7 @@
* nettle.texinfo (DSA): Document new DSA interface.
(Salsa20): Update salsa20 docs.
(ChaCha): Document ChaCha.
2014-05-03 Niels Möller <nisse@lysator.liu.se>
...
...
nettle.texinfo
View file @
ca1ffaf8
...
...
@@ -1463,6 +1463,46 @@ in any other way.
Analogous to @code
{
cast128
_
encrypt
}
@end deftypefun
@subsection ChaCha
ChaCha is a variant of the stream cipher Salsa20, also designed by D. J.
Bernstein. For more information on Salsa20, see below. Nettle defines
Chacha in @file
{
<nettle/chacha.h>
}
.
@deftp
{
Context struct
}
{
struct chacha
_
ctx
}
@end deftp
@defvr Constant CHACHA
_
KEY
_
SIZE
ChaCha key size, 32.
@end defvr
@defvr Constant CHACHA
_
BLOCK
_
SIZE
ChaCha block size, 64.
@end defvr
@defvr Constant CHACHA
_
NONCE
_
SIZE
Size of the nonce, 8.
@end defvr
@deftypefun void chacha
_
set
_
key (struct chacha
_
ctx *@var
{
ctx
}
, const uint8
_
t *@var
{
key
}
)
Initialize the cipher. The same function is used for both encryption and
decryption. Before using the cipher,
you @emph
{
must
}
also call @code
{
chacha
_
set
_
nonce
}
, see below.
@end deftypefun
@deftypefun void chacha
_
set
_
nonce (struct chacha
_
ctx *@var
{
ctx
}
, const uint8
_
t *@var
{
nonce
}
)
Sets the nonce. It is always of size @code
{
CHACHA
_
NONCE
_
SIZE
}
, 8
octets. This function also initializes the block counter, setting it to
zero.
@end deftypefun
@deftypefun void chacha
_
crypt (struct chacha
_
ctx *@var
{
ctx
}
, size
_
t @var
{
length
}
, uint8
_
t *@var
{
dst
}
, const uint8
_
t *@var
{
src
}
)
Encrypts or decrypts the data of a message, using ChaCha. When a
message is encrypted using a sequence of calls to @code
{
chacha
_
crypt
}
,
all but the last call @emph
{
must
}
use a length that is a multiple of
@code
{
CHACHA
_
BLOCK
_
SIZE
}
.
@end deftypefun
@subsection DES
DES is the old Data Encryption Standard, specified by NIST. It uses a
block size of 64 bits (8 octets), and a key size of 56 bits. However,
...
...
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