Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
blake2.hpp
Go to the documentation of this file.
1
// Snark - Wrapper for alt_bn128 add mul pair and modexp
2
3
#pragma once
4
5
#include <functional>
6
#include <cstdint>
7
#include <variant>
8
#include <vector>
9
#include <
fc/utility.hpp
>
10
11
namespace
fc
{
12
using
bytes
= std::vector<char>;
13
14
enum class
blake2b_error
:
int32_t
{
15
input_len_error
16
};
17
18
std::variant<blake2b_error, bytes>
blake2b
(
uint32_t
_rounds,
const
bytes
& _h,
const
bytes
& _m,
const
bytes
& _t0_offset,
const
bytes
& _t1_offset,
bool
_f,
const
yield_function_t
& yield);
19
20
typedef
struct
{
21
uint64_t
h[8] = {0,0,0,0,0,0,0,0};
22
uint64_t
t[2] = {0,0};
23
uint64_t
f
[1] = {0};
24
} blake2b_state;
25
26
class
blake2b_wrapper
{
27
public
:
28
enum
blake2b_constant
{
BLAKE2B_BLOCKBYTES
= 128 };
29
void
blake2b_compress
(
blake2b_state
*
S
,
const
uint8_t
block[
BLAKE2B_BLOCKBYTES
],
size_t
r
,
const
yield_function_t
& yield );
30
31
private
:
32
uint64_t
m[16];
33
uint64_t
v[16];
34
size_t
i;
35
36
inline
void
G(
uint8_t
r
,
uint8_t
i,
uint64_t
&
a
,
uint64_t
& b,
uint64_t
& c,
uint64_t
& d)
noexcept
;
37
inline
void
ROUND(
uint8_t
r
)
noexcept
;
38
39
void
blake2b_compress_init(
blake2b_state
*
S
,
const
uint8_t
block[
BLAKE2B_BLOCKBYTES
],
size_t
r
);
40
void
blake2b_compress_end(
blake2b_state
*
S
);
41
};
42
}
f
foo f
Definition
X02-DisabledMacros.cpp:25
r
const mie::Vuint & r
Definition
bn.cpp:28
fc::blake2b_wrapper
Definition
blake2.hpp:26
fc::blake2b_wrapper::blake2b_compress
void blake2b_compress(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES], size_t r, const yield_function_t &yield)
Definition
blake2.cpp:67
fc::blake2b_wrapper::blake2b_constant
blake2b_constant
Definition
blake2.hpp:28
fc::blake2b_wrapper::BLAKE2B_BLOCKBYTES
@ BLAKE2B_BLOCKBYTES
Definition
blake2.hpp:28
fc::optional_delegate
Definition
utility.hpp:183
fc
namespace sysio::chain
Definition
authority.cpp:3
fc::bytes
std::vector< char > bytes
Definition
alt_bn128.hpp:10
fc::blake2b
std::variant< blake2b_error, bytes > blake2b(uint32_t _rounds, const bytes &_h, const bytes &_m, const bytes &_t0_offset, const bytes &_t1_offset, bool _f, const yield_function_t &yield)
Definition
blake2.cpp:105
fc::yield_function_t
optional_delegate< void()> yield_function_t
Definition
utility.hpp:205
fc::blake2b_error
blake2b_error
Definition
blake2.hpp:14
fc::alt_bn128_error::input_len_error
@ input_len_error
a
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition
pointer.h:1181
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
int32_t
signed int int32_t
Definition
stdint.h:123
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
uint64_t
unsigned __int64 uint64_t
Definition
stdint.h:136
S
Definition
Tricky.tests.cpp:326
fc::blake2b_state
Definition
blake2.hpp:20
utility.hpp
libraries
fc
include
fc
crypto
blake2.hpp
Generated by
1.12.0