[WIP] Add Python ChaCha20 and bindings for CPP ChaCha20
In reference to,
We'll need a python chacha implementation when BIP324 lands, and the functionality in chacha20_doubleround() could be part of that, but until BIP324 I think it's fine to have it in the same file as the muhash code.
Originally posted in https://github.com/bitcoin/bitcoin/pull/19105#issuecomment-643458042
This PR implements the following:
- Adds Pyallowsthon ChaCha20 implementation with a 64-bit nonce.
- Creates Python bindings for the CPP implementation
chacha20.cppusing pybind11.
This will allow us to test both the Python chacha20 and CPP chacha20 against the same test vectors. Hence, increasing the test coverage for chacha20.
The idea of using Pybind11 was suggested in https://github.com/bitcoin/bitcoin/pull/19841#issuecomment-687667841. This PR is built on top of the PR draft #21301 using the changes suggested here.
To test this PR, build Bitcoin Core with(out) the wallet and run:
$ test/functional/test_runner.py