PRCYCoin  2.0.0.7rc1
P2P Digital Currency
chacha20.h
Go to the documentation of this file.
1 // Copyright (c) 2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_CRYPTO_CHACHA20_H
6 #define BITCOIN_CRYPTO_CHACHA20_H
7 
8 #include <stdint.h>
9 #include <stdlib.h>
10 
12 class ChaCha20
13 {
14 private:
15  uint32_t input[16];
16 
17 public:
18  ChaCha20();
19  ChaCha20(const unsigned char* key, size_t keylen);
20  void SetKey(const unsigned char* key, size_t keylen);
21  void SetIV(uint64_t iv);
22  void Seek(uint64_t pos);
23  void Output(unsigned char* output, size_t bytes);
24 };
25 
26 #endif // BITCOIN_CRYPTO_CHACHA20_H
ChaCha20::SetKey
void SetKey(const unsigned char *key, size_t keylen)
Definition: chacha20.cpp:24
ChaCha20::Output
void Output(unsigned char *output, size_t bytes)
Definition: chacha20.cpp:74
ChaCha20::Seek
void Seek(uint64_t pos)
Definition: chacha20.cpp:68
ChaCha20::input
uint32_t input[16]
Definition: chacha20.h:15
ChaCha20::ChaCha20
ChaCha20()
Definition: chacha20.cpp:52
ChaCha20::SetIV
void SetIV(uint64_t iv)
Definition: chacha20.cpp:62
key
CKey key
Definition: bip38tooldialog.cpp:173
ChaCha20
A PRNG class for ChaCha20.
Definition: chacha20.h:12