xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/EVP_chacha20.pod (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos=pod
2*4724848cSchristos
3*4724848cSchristos=head1 NAME
4*4724848cSchristos
5*4724848cSchristosEVP_chacha20,
6*4724848cSchristosEVP_chacha20_poly1305
7*4724848cSchristos- EVP ChaCha20 stream cipher
8*4724848cSchristos
9*4724848cSchristos=head1 SYNOPSIS
10*4724848cSchristos
11*4724848cSchristos #include <openssl/evp.h>
12*4724848cSchristos
13*4724848cSchristos const EVP_CIPHER *EVP_chacha20(void)
14*4724848cSchristos const EVP_CIPHER *EVP_chacha20_poly1305(void)
15*4724848cSchristos
16*4724848cSchristos=head1 DESCRIPTION
17*4724848cSchristos
18*4724848cSchristosThe ChaCha20 stream cipher for EVP.
19*4724848cSchristos
20*4724848cSchristos=over 4
21*4724848cSchristos
22*4724848cSchristos=item EVP_chacha20()
23*4724848cSchristos
24*4724848cSchristosThe ChaCha20 stream cipher. The key length is 256 bits, the IV is 128 bits long.
25*4724848cSchristosThe first 32 bits consists of a counter in little-endian order followed by a 96
26*4724848cSchristosbit nonce. For example a nonce of:
27*4724848cSchristos
28*4724848cSchristos000000000000000000000002
29*4724848cSchristos
30*4724848cSchristosWith an initial counter of 42 (2a in hex) would be expressed as:
31*4724848cSchristos
32*4724848cSchristos2a000000000000000000000000000002
33*4724848cSchristos
34*4724848cSchristos=item EVP_chacha20_poly1305()
35*4724848cSchristos
36*4724848cSchristosAuthenticated encryption with ChaCha20-Poly1305. Like EVP_chacha20(), the key
37*4724848cSchristosis 256 bits and the IV is 96 bits. This supports additional authenticated data
38*4724848cSchristos(AAD) and produces a 128-bit authentication tag. See the
39*4724848cSchristosL<EVP_EncryptInit(3)/AEAD Interface> section for more information.
40*4724848cSchristos
41*4724848cSchristos=back
42*4724848cSchristos
43*4724848cSchristos=head1 RETURN VALUES
44*4724848cSchristos
45*4724848cSchristosThese functions return an B<EVP_CIPHER> structure that contains the
46*4724848cSchristosimplementation of the symmetric cipher. See L<EVP_CIPHER_meth_new(3)> for
47*4724848cSchristosdetails of the B<EVP_CIPHER> structure.
48*4724848cSchristos
49*4724848cSchristos=head1 SEE ALSO
50*4724848cSchristos
51*4724848cSchristosL<evp(7)>,
52*4724848cSchristosL<EVP_EncryptInit(3)>,
53*4724848cSchristosL<EVP_CIPHER_meth_new(3)>
54*4724848cSchristos
55*4724848cSchristos=head1 COPYRIGHT
56*4724848cSchristos
57*4724848cSchristosCopyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
58*4724848cSchristos
59*4724848cSchristosLicensed under the OpenSSL license (the "License").  You may not use
60*4724848cSchristosthis file except in compliance with the License.  You can obtain a copy
61*4724848cSchristosin the file LICENSE in the source distribution or at
62*4724848cSchristosL<https://www.openssl.org/source/license.html>.
63*4724848cSchristos
64*4724848cSchristos=cut
65*4724848cSchristos
66