/src/botan/build/include/botan/internal/shacal2.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * SHACAL-2 |
3 | | * (C) 2017 Jack Lloyd |
4 | | * |
5 | | * Botan is released under the Simplified BSD License (see license.txt) |
6 | | */ |
7 | | |
8 | | #ifndef BOTAN_SHACAL2_H_ |
9 | | #define BOTAN_SHACAL2_H_ |
10 | | |
11 | | #include <botan/block_cipher.h> |
12 | | |
13 | | namespace Botan { |
14 | | |
15 | | /** |
16 | | * SHACAL2 |
17 | | */ |
18 | | class SHACAL2 final : public Block_Cipher_Fixed_Params<32, 16, 64, 4> { |
19 | | public: |
20 | | void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; |
21 | | void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override; |
22 | | |
23 | | std::string provider() const override; |
24 | | void clear() override; |
25 | | |
26 | 0 | std::string name() const override { return "SHACAL2"; } |
27 | | |
28 | 0 | std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<SHACAL2>(); } |
29 | | |
30 | | size_t parallelism() const override; |
31 | | bool has_keying_material() const override; |
32 | | |
33 | | private: |
34 | | void key_schedule(const uint8_t[], size_t) override; |
35 | | |
36 | | #if defined(BOTAN_HAS_SHACAL2_SIMD) |
37 | | void simd_encrypt_4(const uint8_t in[], uint8_t out[]) const; |
38 | | void simd_decrypt_4(const uint8_t in[], uint8_t out[]) const; |
39 | | #endif |
40 | | |
41 | | #if defined(BOTAN_HAS_SHACAL2_AVX2) |
42 | | void avx2_encrypt_8(const uint8_t in[], uint8_t out[]) const; |
43 | | void avx2_decrypt_8(const uint8_t in[], uint8_t out[]) const; |
44 | | #endif |
45 | | |
46 | | #if defined(BOTAN_HAS_SHACAL2_X86) |
47 | | void x86_encrypt_blocks(const uint8_t in[], uint8_t out[], size_t blocks) const; |
48 | | #endif |
49 | | |
50 | | #if defined(BOTAN_HAS_SHACAL2_ARMV8) |
51 | | void armv8_encrypt_blocks(const uint8_t in[], uint8_t out[], size_t blocks) const; |
52 | | #endif |
53 | | |
54 | | secure_vector<uint32_t> m_RK; |
55 | | }; |
56 | | |
57 | | } // namespace Botan |
58 | | |
59 | | #endif |