-</code></pre></div><h2 id=description>DESCRIPTION<a class=headerlink href=#description title="Permanent link">¶</a></h2><p>The ChaCha20 stream cipher for EVP.</p><ul><li><p>EVP_chacha20()</p><p>The ChaCha20 stream cipher. The key length is 256 bits, the IV is 128 bits long. The first 64 bits consists of a counter in little-endian order followed by a 64 bit nonce. For example a nonce of:</p><p>0000000000000002</p><p>With an initial counter of 42 (2a in hex) would be expressed as:</p><p>2a000000000000000000000000000002</p></li><li><p>EVP_chacha20_poly1305()</p><p>Authenticated encryption with ChaCha20-Poly1305. Like EVP_chacha20(), the key is 256 bits and the IV is 96 bits. This supports additional authenticated data (AAD) and produces a 128-bit authentication tag. See the <a href=../EVP_EncryptInit/ >"AEAD Interface" in EVP_EncryptInit(3)</a> section for more information.</p></li></ul><h2 id=notes>NOTES<a class=headerlink href=#notes title="Permanent link">¶</a></h2><p>Developers should be aware of the negative performance implications of calling these functions multiple times and should consider using <a href=../EVP_EncryptInit/ >EVP_CIPHER_fetch(3)</a> with <a href=../../man7/EVP_CIPHER-CHACHA/ >EVP_CIPHER-CHACHA(7)</a> instead. See <a href=../../man7/ossl-guide-libcrypto-introduction/ >"Performance" in crypto(7)</a> for further information.</p><p><a href=https://www.rfc-editor.org/rfc/rfc7539.html#section-2.4>RFC 7539</a> uses a 32 bit counter and a 96 bit nonce for the IV.</p><h2 id=return-values>RETURN VALUES<a class=headerlink href=#return-values title="Permanent link">¶</a></h2><p>These functions return an <strong>EVP_CIPHER</strong> structure that contains the implementation of the symmetric cipher. See <a href=../EVP_CIPHER_meth_new/ >EVP_CIPHER_meth_new(3)</a> for details of the <strong>EVP_CIPHER</strong> structure.</p><h2 id=see-also>SEE ALSO<a class=headerlink href=#see-also title="Permanent link">¶</a></h2><p><a href=../../man7/evp/ >evp(7)</a>, <a href=../EVP_EncryptInit/ >EVP_EncryptInit(3)</a>, <a href=../EVP_CIPHER_meth_new/ >EVP_CIPHER_meth_new(3)</a></p><h2 id=copyright>COPYRIGHT<a class=headerlink href=#copyright title="Permanent link">¶</a></h2><p>Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.</p><p>Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <a href=https://www.openssl.org/source/license.html>https://www.openssl.org/source/license.html</a>.</p></article></div><script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script></div></main><footer class=md-footer><div class="md-footer-meta md-typeset"><div class="md-footer-meta__inner md-grid"><div class=md-copyright> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a></div></div></div></footer></div><div class=md-dialog data-md-component=dialog><div class="md-dialog__inner md-typeset"></div></div><script id=__config type=application/json>{"base": "../..", "features": ["navigation.indexes", "navigation.instant", "navigation.path", "navigation.prune", "navigation.tabs", "navigation.tabs.sticky", "navigation.tracking", "search.suggest", "toc.follow"], "search": "../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"default": "master", "provider": "mike"}}</script><script src=../../assets/javascripts/bundle.ad660dcc.min.js></script></body></html>
0 commit comments