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