<p>You can open the git history for each file and see when and why they were added.</p>
<p>chacha20.cpp was added in <a href="https://github.com/bitcoin/bitcoin/pull/9792" rel="nofollow noreferrer">PR #9792</a>, apparently to improve Bitcoin Core's random number generator. chacha_poly_aead.cpp was added in <a href="https://github.com/bitcoin/bitcoin/pull/15649" rel="nofollow noreferrer">PR #15649</a> as a preliminary step for implementing <a href="https://github.com/bitcoin/bips/pull/1378" rel="nofollow noreferrer">BIP324</a> (the P2P encrypted transport protocol).</p>

CC BY-SA 4.0
2022-10-30T17:46:58.547Z
2022-10-30T17:46:58.547Z
Vojtěch Strnad
<p>In the source code of Bitcoin Core there are these functions but no explanation of how and where they are used. I need to make a description for all crypto-functions used in Bitcoin Core (<a href="https://github.com/bitcoin/bitcoin/tree/master/src/crypto" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/tree/master/src/crypto</a>) but it's difficult to find information, so asking you here.</p>

<bitcoin-core-development><cryptography><bip324-p2p-encryption>
Where is chacha20 and chacha_poly_aead used in Bitcoin Core?
Gregory Morychev
# Where is chacha20 and chacha_poly_aead used in Bitcoin Core?

(Asked by: username_0 on 2022-10-30)

In the source code of Bitcoin Core there are these functions but no explanation of how and where they are used. I need to make a description for all crypto-functions used in Bitcoin Core (<https://github.com/bitcoin/bitcoin/tree/master/src/crypto>) but it's difficult to find information, so asking you here.

**Tags:** bitcoin-core-development, cryptography, bip324-p2p-encryption


---

## 1 answers

### Answer by username_1 on 2022-10-30. Score: 4 | Accepted answer

You can open the git history for each file and see when and why they were added.

chacha20.cpp was added in [PR #9792](https://github.com/bitcoin/bitcoin/pull/9792), apparently to improve Bitcoin Core's random number generator. chacha\_poly\_aead.cpp was added in [PR #15649](https://github.com/bitcoin/bitcoin/pull/15649) as a preliminary step for implementing [BIP324](https://github.com/bitcoin/bips/pull/1378) (the P2P encrypted transport protocol).


---

