Reference
-* Hash functions::
-* Cipher functions::
-* Cipher modes::
-* Keyed hash functions::
-* Key derivation functions::
-* Public-key algorithms::
-* Randomness::
-* ASCII encoding::
-* Miscellaneous functions::
-* Compatibility functions::
+* Hash functions::
+* Cipher functions::
+* Cipher modes::
+* Authenticated encryption::
+* Keyed hash functions::
+* Key derivation functions::
+* Public-key algorithms::
+* Randomness::
+* ASCII encoding::
+* Miscellaneous functions::
+* Compatibility functions::
Hash functions
* Legacy hash functions::
* nettle_hash abstraction::
+Cipher functions
+
+* AES::
+* Arcfour::
+* Arctwo::
+* Blowfish::
+* Camellia::
+* CAST128::
+* ChaCha::
+* DES::
+* DES3::
+* Salsa20::
+* Serpent::
+* Twofish::
+* nettle_cipher abstraction::
+
Cipher modes
* CBC::
Authenticated encryption with associated data
* EAX::
-* GCM::
-* CCM::
+* GCM::
+* CCM::
* ChaCha-Poly1305::
* SIV-CMAC::
* nettle_aead abstraction::
* DSA:: The DSA digital signature algorithm.
* Elliptic curves:: Elliptic curves and ECDSA
-@acronym{Elliptic curves}
+Elliptic curves
* Side-channel silence::
* ECDSA::
This chapter describes all the Nettle functions, grouped by family.
@menu
-* Hash functions::
-* Cipher functions::
-* Cipher modes::
+* Hash functions::
+* Cipher functions::
+* Cipher modes::
* Authenticated encryption::
-* Keyed hash functions::
-* Key derivation functions::
-* Public-key algorithms::
-* Randomness::
-* ASCII encoding::
-* Miscellaneous functions::
-* Compatibility functions::
+* Keyed hash functions::
+* Key derivation functions::
+* Public-key algorithms::
+* Randomness::
+* ASCII encoding::
+* Miscellaneous functions::
+* Compatibility functions::
@end menu
@node Hash functions
-
@section Hash functions
@cindex Hash function
+
A cryptographic @dfn{hash function} is a function that takes variable
size strings, and maps them to strings of fixed, short, length. There
are naturally lots of collisions, as there are more possible 1MB files
single key setup function that can be used for both encryption and
decryption.
+@menu
+* AES::
+* Arcfour::
+* Arctwo::
+* Blowfish::
+* Camellia::
+* CAST128::
+* ChaCha::
+* DES::
+* DES3::
+* Salsa20::
+* Serpent::
+* Twofish::
+* nettle_cipher abstraction::
+@end menu
+
+@node AES
@subsection AES
@cindex AES
Analogous to the encryption functions above.
@end deftypefun
-@subsection ARCFOUR
+@node Arcfour
+@subsection Arcfour
@cindex Arcfour
@cindex RC4
+
ARCFOUR is a stream cipher, also known under the trade marked name RC4,
and it is one of the fastest ciphers around. A problem is that the key
setup of ARCFOUR is quite weak, you should never use keys with
@code{arcfour_crypt} only once with all the data.
@end deftypefun
-@subsection ARCTWO
+@node Arctwo
+@subsection Arctwo
@cindex Arctwo
@cindex RC2
+
ARCTWO (also known as the trade marked name RC2) is a block cipher
specified in RFC 2268. Nettle also include a variation of the ARCTWO
set key operation that lack one step, to be compatible with the
Analogous to @code{arctwo_encrypt}
@end deftypefun
-@subsection BLOWFISH
+@node Blowfish
+@subsection Blowfish
@cindex Blowfish
BLOWFISH is a block cipher designed by Bruce Schneier. It uses a block
@end example
@end deftypefun
+@node Camellia
@subsection Camellia
@cindex Camellia
@code{dst} may be equal, but they must not overlap in any other way.
@end deftypefun
+@node CAST128
@subsection CAST128
@cindex CAST
decryption.
@end deftypefun
+@node ChaCha
@subsection ChaCha
@cindex 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>}.
+ChaCha is a variant of the stream cipher Salsa20 (@pxref{Salsa20}),
+below, also designed by D. J. Bernstein. Nettle defines ChaCha in
+@file{<nettle/chacha.h>}.
@deftp {Context struct} {struct chacha_ctx}
@end deftp
long and the nonce is 96-bit long.
@end deftypefun
+@node DES
@subsection DES
@cindex 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,
the key bits are distributed over 8 octets, where the least significant
be equal.
@end deftypefun
+@node DES3
@subsection DES3
@cindex DES3
@cindex 3DES
Analogous to @code{des_encrypt}
@end deftypefun
+@node Salsa20
@subsection Salsa20
@cindex Salsa20
+
Salsa20 is a fairly recent stream cipher designed by D. J. Bernstein. It
is built on the observation that a cryptographic hash function can be
used for encryption: Form the hash input from the secret key and a
counter, xor the hash output and the first block of the plaintext, then
-increment the counter to process the next block (similar to CTR mode, see
+increment the counter to process the next block (similar to CTR mode,
@pxref{CTR}). Bernstein defined an encryption algorithm, Snuffle,
in this way to ridicule United States export restrictions which treated hash
functions as nice and harmless, but ciphers as dangerous munitions.
rounds.
@end deftypefun
-@subsection SERPENT
+@node Serpent
+@subsection Serpent
@cindex Serpent
SERPENT is one of the AES finalists, designed by Ross Anderson, Eli
Analogous to @code{serpent_encrypt}
@end deftypefun
-
-@subsection TWOFISH
+@node Twofish
+@subsection Twofish
@cindex Twofish
Another AES finalist, this one designed by Bruce Schneier and others.
authenticate the message.
@menu
-* CBC::
-* CTR::
+* CBC::
+* CTR::
* CFB and CFB8::
* XTS::
@end menu
more adventurous alternative, in particular if performance is important.
@menu
-* EAX::
-* GCM::
-* CCM::
+* EAX::
+* GCM::
+* CCM::
* ChaCha-Poly1305::
* SIV-CMAC::
* nettle_aead abstraction::
@end deftypefun
@node Elliptic curves
-@subsection @acronym{Elliptic curves}
+@subsection Elliptic curves
For cryptographic purposes, an elliptic curve is a mathematical group of
points, and computing logarithms in this group is computationally