Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

threefish_512.h
Go to the documentation of this file.
1 /*
2 * Threefish-512
3 * (C) 2013,2014 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_THREEFISH_512_H_
9 #define BOTAN_THREEFISH_512_H_
10
11 #include <botan/block_cipher.h>
12
13 BOTAN_FUTURE_INTERNAL_HEADER(threefish_512.h)
14
15 namespace Botan {
16
17 /**
18 * Threefish-512
19 */
20 class BOTAN_PUBLIC_API(2,0) Threefish_512 final :
21 public Block_Cipher_Fixed_Params<64, 64, 0, 1, Tweakable_Block_Cipher>
22 {
23 public:
24 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
25 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
26
27 void set_tweak(const uint8_t tweak[], size_t len) override;
28
29 void clear() override;
30 std::string provider() const override;
31 std::string name() const override { return "Threefish-512"; }
32 BlockCipher* clone() const override { return new Threefish_512; }
33 size_t parallelism() const override;
34
35 private:
36
37 #if defined(BOTAN_HAS_THREEFISH_512_AVX2)
38 void avx2_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
39 void avx2_decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
40 #endif
41
42 void key_schedule(const uint8_t key[], size_t key_len) override;
43
44 // Interface for Skein
45 friend class Skein_512;
46
47 void skein_feedfwd(const secure_vector<uint64_t>& M,
48 const secure_vector<uint64_t>& T);
49
50 // Private data
51 secure_vector<uint64_t> m_T;
52 secure_vector<uint64_t> m_K;
53 };
54
55 }
56
57 #endif
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::Threefish_512
Definition: threefish_512.h:20
Botan::Skein_512
Definition: skein_512.h:23
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::Threefish_512::clone
BlockCipher * clone() const override
Definition: threefish_512.h:32
Botan
Definition: alg_id.cpp:13
Botan::Threefish_512::name
std::string name() const override
Definition: threefish_512.h:31
T
fe T
Definition: ge.cpp:37
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:221
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
Botan::BlockCipher
Definition: block_cipher.h:21