/src/botan/src/lib/hash/sha3/sha3_bmi2/sha3_bmi2.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * SHA-3 |
3 | | * (C) 2019 Jack Lloyd |
4 | | * |
5 | | * Botan is released under the Simplified BSD License (see license.txt) |
6 | | */ |
7 | | |
8 | | #include <botan/internal/sha3.h> |
9 | | #include <botan/internal/sha3_round.h> |
10 | | |
11 | | namespace Botan { |
12 | | |
13 | | void SHA_3::permute_bmi2(uint64_t A[25]) |
14 | 0 | { |
15 | 0 | static const uint64_t RC[24] = { |
16 | 0 | 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, |
17 | 0 | 0x8000000080008000, 0x000000000000808B, 0x0000000080000001, |
18 | 0 | 0x8000000080008081, 0x8000000000008009, 0x000000000000008A, |
19 | 0 | 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, |
20 | 0 | 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, |
21 | 0 | 0x8000000000008003, 0x8000000000008002, 0x8000000000000080, |
22 | 0 | 0x000000000000800A, 0x800000008000000A, 0x8000000080008081, |
23 | 0 | 0x8000000000008080, 0x0000000080000001, 0x8000000080008008 |
24 | 0 | }; |
25 | |
|
26 | 0 | uint64_t T[25]; |
27 | |
|
28 | 0 | for(size_t i = 0; i != 24; i += 2) |
29 | 0 | { |
30 | 0 | SHA3_round(T, A, RC[i+0]); |
31 | 0 | SHA3_round(A, T, RC[i+1]); |
32 | 0 | } |
33 | 0 | } |
34 | | |
35 | | } |