Botan 3.6.1
Crypto and TLS for C&
shacal2.h
Go to the documentation of this file.
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
13namespace Botan {
14
15/**
16* SHACAL2
17*/
18class 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 std::string name() const override { return "SHACAL2"; }
27
28 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(std::span<const uint8_t> key) 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
55};
56
57} // namespace Botan
58
59#endif
std::string provider() const override
Definition shacal2.cpp:230
std::string name() const override
Definition shacal2.h:26
bool has_keying_material() const override
Definition shacal2.cpp:165
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition shacal2.cpp:112
std::unique_ptr< BlockCipher > new_object() const override
Definition shacal2.h:28
size_t parallelism() const override
Definition shacal2.cpp:202
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition shacal2.cpp:44
void clear() override
Definition shacal2.cpp:261
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61