Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

threefish.h
Go to the documentation of this file.
1 /*
2 * Threefish
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_H__
9 #define BOTAN_THREEFISH_H__
10
11 #include <botan/block_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * Threefish-512
17 */
18 class BOTAN_DLL Threefish_512 final : public Block_Cipher_Fixed_Params<64, 64>
19 {
20 public:
21 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
22 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
23
24 void set_tweak(const uint8_t tweak[], size_t len);
25
26 void clear() override;
27 std::string provider() const override;
28 std::string name() const override { return "Threefish-512"; }
29 BlockCipher* clone() const override { return new Threefish_512; }
30 protected:
31 const secure_vector<uint64_t>& get_T() const { return m_T; }
32 const secure_vector<uint64_t>& get_K() const { return m_K; }
33 private:
34
35 #if defined(BOTAN_HAS_THREEFISH_512_AVX2)
36 void avx2_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
37 void avx2_decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const;
38 #endif
39
40 void key_schedule(const uint8_t key[], size_t key_len) override;
41
42 // Interface for Skein
43 friend class Skein_512;
44
45 virtual void skein_feedfwd(const secure_vector<uint64_t>& M,
46 const secure_vector<uint64_t>& T);
47
48 // Private data
49 secure_vector<uint64_t> m_T;
50 secure_vector<uint64_t> m_K;
51 };
52
53 }
54
55 #endif
Botan::Threefish_512
Definition: threefish.h:18
Botan::Skein_512
Definition: skein_512.h:21
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::Threefish_512::get_K
const secure_vector< uint64_t > & get_K() const
Definition: threefish.h:32
Botan::Threefish_512::clone
BlockCipher * clone() const override
Definition: threefish.h:29
Botan
Definition: alg_id.cpp:13
Botan::Threefish_512::name
std::string name() const override
Definition: threefish.h:28
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:183
Botan::BlockCipher
Definition: block_cipher.h:19
Botan::Threefish_512::get_T
const secure_vector< uint64_t > & get_T() const
Definition: threefish.h:31