Monero
Toggle main menu visibility
Loading...
Searching...
No Matches
external
randomx
src
blake2_generator.hpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2018-2019, tevador <tevador@gmail.com>
3
4
All rights reserved.
5
6
Redistribution and use in source and binary forms, with or without
7
modification, are permitted provided that the following conditions are met:
8
* Redistributions of source code must retain the above copyright
9
notice, this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in the
12
documentation and/or other materials provided with the distribution.
13
* Neither the name of the copyright holder nor the
14
names of its contributors may be used to endorse or promote products
15
derived from this software without specific prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
#pragma once
30
31
#include <cstdint>
32
33
namespace
randomx
{
34
35
class
Blake2Generator
{
36
public
:
37
Blake2Generator
(
const
void
*
seed
,
size_t
seedSize,
int
nonce = 0);
38
uint8_t
getByte
();
39
uint32_t
getUInt32
();
40
private
:
41
void
checkData
(
const
size_t
);
42
43
uint8_t
data
[64];
44
size_t
dataIndex
;
45
};
46
}
randomx::Blake2Generator::dataIndex
size_t dataIndex
Definition
blake2_generator.hpp:44
randomx::Blake2Generator::data
uint8_t data[64]
Definition
blake2_generator.hpp:43
randomx::Blake2Generator::Blake2Generator
Blake2Generator(const void *seed, size_t seedSize, int nonce=0)
Definition
blake2_generator.cpp:38
randomx::Blake2Generator::checkData
void checkData(const size_t)
Definition
blake2_generator.cpp:56
randomx::Blake2Generator::getUInt32
uint32_t getUInt32()
Definition
blake2_generator.cpp:49
randomx::Blake2Generator::getByte
uint8_t getByte()
Definition
blake2_generator.cpp:44
seed
const uint8_t seed[32]
Definition
code-generator.cpp:37
randomx
Definition
allocator.cpp:35
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
Generated on
for Monero by
1.17.0