Home | History | Annotate | Line # | Download | only in man3
      1      1.1  christos =pod
      2      1.1  christos 
      3      1.1  christos =head1 NAME
      4      1.1  christos 
      5      1.1  christos EVP_chacha20,
      6      1.1  christos EVP_chacha20_poly1305
      7      1.1  christos - EVP ChaCha20 stream cipher
      8      1.1  christos 
      9      1.1  christos =head1 SYNOPSIS
     10      1.1  christos 
     11      1.1  christos  #include <openssl/evp.h>
     12      1.1  christos 
     13  1.1.1.3  christos  const EVP_CIPHER *EVP_chacha20(void);
     14  1.1.1.3  christos  const EVP_CIPHER *EVP_chacha20_poly1305(void);
     15      1.1  christos 
     16      1.1  christos =head1 DESCRIPTION
     17      1.1  christos 
     18      1.1  christos The ChaCha20 stream cipher for EVP.
     19      1.1  christos 
     20      1.1  christos =over 4
     21      1.1  christos 
     22      1.1  christos =item EVP_chacha20()
     23      1.1  christos 
     24  1.1.1.2  christos The ChaCha20 stream cipher. The key length is 256 bits, the IV is 128 bits long.
     25  1.1.1.5  christos The first 64 bits consists of a counter in little-endian order followed by a 64
     26  1.1.1.2  christos bit nonce. For example a nonce of:
     27  1.1.1.2  christos 
     28  1.1.1.5  christos 0000000000000002
     29  1.1.1.2  christos 
     30  1.1.1.2  christos With an initial counter of 42 (2a in hex) would be expressed as:
     31  1.1.1.2  christos 
     32  1.1.1.2  christos 2a000000000000000000000000000002
     33      1.1  christos 
     34      1.1  christos =item EVP_chacha20_poly1305()
     35      1.1  christos 
     36      1.1  christos Authenticated encryption with ChaCha20-Poly1305. Like EVP_chacha20(), the key
     37      1.1  christos is 256 bits and the IV is 96 bits. This supports additional authenticated data
     38      1.1  christos (AAD) and produces a 128-bit authentication tag. See the
     39      1.1  christos L<EVP_EncryptInit(3)/AEAD Interface> section for more information.
     40      1.1  christos 
     41      1.1  christos =back
     42      1.1  christos 
     43  1.1.1.4  christos =head1 NOTES
     44  1.1.1.4  christos 
     45  1.1.1.4  christos Developers should be aware of the negative performance implications of
     46  1.1.1.4  christos calling these functions multiple times and should consider using
     47  1.1.1.5  christos L<EVP_CIPHER_fetch(3)> with L<EVP_CIPHER-CHACHA(7)> instead.
     48  1.1.1.4  christos See L<crypto(7)/Performance> for further information.
     49  1.1.1.4  christos 
     50  1.1.1.5  christos L<RFC 7539|https://www.rfc-editor.org/rfc/rfc7539.html#section-2.4>
     51  1.1.1.5  christos uses a 32 bit counter and a 96 bit nonce for the IV.
     52  1.1.1.5  christos 
     53      1.1  christos =head1 RETURN VALUES
     54      1.1  christos 
     55      1.1  christos These functions return an B<EVP_CIPHER> structure that contains the
     56      1.1  christos implementation of the symmetric cipher. See L<EVP_CIPHER_meth_new(3)> for
     57      1.1  christos details of the B<EVP_CIPHER> structure.
     58      1.1  christos 
     59      1.1  christos =head1 SEE ALSO
     60      1.1  christos 
     61      1.1  christos L<evp(7)>,
     62      1.1  christos L<EVP_EncryptInit(3)>,
     63      1.1  christos L<EVP_CIPHER_meth_new(3)>
     64      1.1  christos 
     65      1.1  christos =head1 COPYRIGHT
     66      1.1  christos 
     67  1.1.1.4  christos Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
     68      1.1  christos 
     69  1.1.1.3  christos Licensed under the Apache License 2.0 (the "License").  You may not use
     70      1.1  christos this file except in compliance with the License.  You can obtain a copy
     71      1.1  christos in the file LICENSE in the source distribution or at
     72      1.1  christos L<https://www.openssl.org/source/license.html>.
     73      1.1  christos 
     74      1.1  christos =cut
     75      1.1  christos 
     76