digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
blake_constants.hpp
Go to the documentation of this file.
1/*
2This code is written by kerukuro and released into public domain.
3*/
4
5#ifndef DIGESTPP_PROVIDERS_BLAKE_CONSTANTS_HPP
6#define DIGESTPP_PROVIDERS_BLAKE_CONSTANTS_HPP
7
8namespace digestpp
9{
10
11namespace detail
12{
13
14template<typename T>
16{
17 static const uint32_t c[16];
18 static const uint64_t c512[16];
19 static const uint32_t S[10][16];
20
21};
22
23template<typename T>
24const uint32_t blake_constants<T>::c[16] = {
25 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
26 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917
27};
28
29template<typename T>
30const uint64_t blake_constants<T>::c512[16] = {
31 0x243F6A8885A308D3ull, 0x13198A2E03707344ull, 0xA4093822299F31D0ull, 0x082EFA98EC4E6C89ull,
32 0x452821E638D01377ull, 0xBE5466CF34E90C6Cull, 0xC0AC29B7C97C50DDull, 0x3F84D5B5B5470917ull,
33 0x9216D5D98979FB1Bull, 0xD1310BA698DFB5ACull, 0x2FFD72DBD01ADFB7ull, 0xB8E1AFED6A267E96ull,
34 0xBA7C9045F12C7F99ull, 0x24A19947B3916CF7ull, 0x0801F2E2858EFC16ull, 0x636920D871574E69ull
35};
36
37template<typename T>
38const uint32_t blake_constants<T>::S[10][16] = {
39 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
40 { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
41 { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
42 { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 },
43 { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 },
44 { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 },
45 { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 },
46 { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 },
47 { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 },
48 { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }
49};
50
51} // namespace detail
52
53} // namespace digestpp
54
55#endif
digestpp namespace
Definition ascon.hpp:14
Definition blake_constants.hpp:16
static const uint32_t c[16]
Definition blake_constants.hpp:17
static const uint32_t S[10][16]
Definition blake_constants.hpp:19
static const uint64_t c512[16]
Definition blake_constants.hpp:18