digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
skein_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_SKEIN_CONSTANTS_HPP
6#define DIGESTPP_PROVIDERS_SKEIN_CONSTANTS_HPP
7
8namespace digestpp
9{
10
11namespace detail
12{
13
14template<typename T>
16{
17 const static unsigned C4[8][2];
18 const static unsigned C8[8][4];
19 const static unsigned C16[8][8];
20 const static unsigned I4[8][4];
21 const static unsigned I8[8][8];
22 const static unsigned I16[8][16];
23};
24
25template<typename T>
26const unsigned skein_constants<T>::C4[8][2] = {
27 { 14, 16 }, { 52, 57 }, { 23, 40 }, { 5, 37 }, { 25, 33 }, { 46, 12 }, { 58, 22 }, { 32, 32 }
28};
29
30template<typename T>
31const unsigned skein_constants<T>::C8[8][4] = {
32 { 46, 36, 19, 37 }, { 33, 27, 14, 42 }, { 17, 49, 36, 39 }, { 44, 9, 54, 56 },
33 { 39, 30, 34, 24 }, { 13, 50, 10, 17 }, { 25, 29, 39, 43 }, { 8, 35, 56, 22 }
34};
35
36template<typename T>
37const unsigned skein_constants<T>::C16[8][8]= {
38 { 24, 13, 8, 47, 8, 17, 22, 37 }, { 38, 19, 10, 55, 49, 18, 23, 52 },
39 { 33, 4, 51, 13, 34, 41, 59, 17 }, { 5, 20, 48, 41, 47, 28, 16, 25 },
40 { 41, 9, 37, 31, 12, 47, 44, 30 }, { 16, 34, 56, 51, 4, 53, 42, 41 },
41 { 31, 44, 47, 46, 19, 42, 44, 25 }, { 9, 48, 35, 52, 23, 31, 37, 20 }
42
43};
44
45template<typename T>
46const unsigned skein_constants<T>::I4[8][4]= {
47 { 0, 1, 2, 3 }, { 0, 3, 2, 1 }, { 0, 1, 2, 3 }, { 0, 3, 2, 1 },
48 { 0, 1, 2, 3 }, { 0, 3, 2, 1 }, { 0, 1, 2, 3 }, { 0, 3, 2, 1 }
49};
50
51template<typename T>
52const unsigned skein_constants<T>::I8[8][8]= {
53 { 0, 1, 2, 3, 4, 5, 6, 7 }, { 2, 1, 4, 7, 6, 5, 0, 3 },
54 { 4, 1, 6, 3, 0, 5, 2, 7 }, { 6, 1, 0, 7, 2, 5, 4, 3 },
55 { 0, 1, 2, 3, 4, 5, 6, 7 }, { 2, 1, 4, 7, 6, 5, 0, 3 },
56 { 4, 1, 6, 3, 0, 5, 2, 7 }, { 6, 1, 0, 7, 2, 5, 4, 3 }
57};
58
59template<typename T>
60const unsigned skein_constants<T>::I16[8][16] = {
61 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
62 { 0, 9, 2, 13, 6, 11, 4, 15, 10, 7, 12, 3, 14, 5, 8, 1 },
63 { 0, 7, 2, 5, 4, 3, 6, 1, 12, 15, 14, 13, 8, 11, 10, 9 },
64 { 0, 15, 2, 11, 6, 13, 4, 9, 14, 1, 8, 5, 10, 3, 12, 7 },
65 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
66 { 0, 9, 2, 13, 6, 11, 4, 15, 10, 7, 12, 3, 14, 5, 8, 1 },
67 { 0, 7, 2, 5, 4, 3, 6, 1, 12, 15, 14, 13, 8, 11, 10, 9 },
68 { 0, 15, 2, 11, 6, 13, 4, 9, 14, 1, 8, 5, 10, 3, 12, 7 }
69};
70
71} // namespace detail
72
73} // namespace digestpp
74
75#endif
digestpp namespace
Definition ascon.hpp:14
Definition skein_constants.hpp:16
static const unsigned I16[8][16]
Definition skein_constants.hpp:22
static const unsigned C8[8][4]
Definition skein_constants.hpp:18
static const unsigned C16[8][8]
Definition skein_constants.hpp:19
static const unsigned I4[8][4]
Definition skein_constants.hpp:20
static const unsigned C4[8][2]
Definition skein_constants.hpp:17
static const unsigned I8[8][8]
Definition skein_constants.hpp:21