EVP_chacha20.pod 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. =pod
  2. =head1 NAME
  3. EVP_chacha20,
  4. EVP_chacha20_poly1305
  5. - EVP ChaCha20 stream cipher
  6. =head1 SYNOPSIS
  7. #include <openssl/evp.h>
  8. const EVP_CIPHER *EVP_chacha20(void);
  9. const EVP_CIPHER *EVP_chacha20_poly1305(void);
  10. =head1 DESCRIPTION
  11. The ChaCha20 stream cipher for EVP.
  12. =over 4
  13. =item EVP_chacha20()
  14. The ChaCha20 stream cipher. The key length is 256 bits, the IV is 128 bits long.
  15. The first 32 bits consists of a counter in little-endian order followed by a 96
  16. bit nonce. For example a nonce of:
  17. 000000000000000000000002
  18. With an initial counter of 42 (2a in hex) would be expressed as:
  19. 2a000000000000000000000000000002
  20. =item EVP_chacha20_poly1305()
  21. Authenticated encryption with ChaCha20-Poly1305. Like EVP_chacha20(), the key
  22. is 256 bits and the IV is 96 bits. This supports additional authenticated data
  23. (AAD) and produces a 128-bit authentication tag. See the
  24. L<EVP_EncryptInit(3)/AEAD Interface> section for more information.
  25. =back
  26. =head1 RETURN VALUES
  27. These functions return an B<EVP_CIPHER> structure that contains the
  28. implementation of the symmetric cipher. See L<EVP_CIPHER_meth_new(3)> for
  29. details of the B<EVP_CIPHER> structure.
  30. =head1 SEE ALSO
  31. L<evp(7)>,
  32. L<EVP_EncryptInit(3)>,
  33. L<EVP_CIPHER_meth_new(3)>
  34. =head1 COPYRIGHT
  35. Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
  36. Licensed under the Apache License 2.0 (the "License"). You may not use
  37. this file except in compliance with the License. You can obtain a copy
  38. in the file LICENSE in the source distribution or at
  39. L<https://www.openssl.org/source/license.html>.
  40. =cut