Fabcoin Core  0.16.2
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 FABCOIN_CRYPTO_CHACHA20_H
6 #define FABCOIN_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 // FABCOIN_CRYPTO_CHACHA20_H
uint32_t input[16]
Definition: chacha20.h:15
void Output(unsigned char *output, size_t bytes)
Definition: chacha20.cpp:74
A PRNG class for ChaCha20.
Definition: chacha20.h:12
ChaCha20()
Definition: chacha20.cpp:52
std::vector< byte > bytes
Definition: Common.h:75
void Seek(uint64_t pos)
Definition: chacha20.cpp:68
void SetKey(const unsigned char *key, size_t keylen)
Definition: chacha20.cpp:24
void SetIV(uint64_t iv)
Definition: chacha20.cpp:62