Botan  2.11.0
Crypto and TLS for C++11
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 namespace Botan {
14 
15 /**
16 * Threefish-512
17 */
18 class BOTAN_PUBLIC_API(2,0) Threefish_512 final :
19  public Block_Cipher_Fixed_Params<64, 64, 0, 1, Tweakable_Block_Cipher>
20  {
21  public:
22  void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
23  void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
24 
25  void set_tweak(const uint8_t tweak[], size_t len) override;
26 
27  void clear() override;
28  std::string provider() const override;
29  std::string name() const override { return "Threefish-512"; }
30  BlockCipher* clone() const override { return new Threefish_512; }
31  size_t parallelism() const override;
32 
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  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
std::string size_t len
Definition: pk_keys.h:305
class BOTAN_PUBLIC_API(2, 11) Argon2 final class BOTAN_PUBLIC_API(2, 11) Argon2_Family final void size_t const char size_t const uint8_t size_t const uint8_t size_t const uint8_t size_t uint8_t size_t size_t M
Definition: argon2.h:87
int(* final)(unsigned char *, CTX *)
void const uint8_t in[]
Definition: mgf1.h:26
char * name
Definition: ffi.h:330
BigInt const BigInt const SymmetricKey const std::vector< uint8_t > & tweak
Definition: fpe_fe1.h:101
const uint8_t uint8_t size_t blocks
Definition: ffi.h:691
class BOTAN_PUBLIC_API(2, 11) Argon2 final class BOTAN_PUBLIC_API(2, 11) Argon2_Family final void size_t const char size_t const uint8_t size_t const uint8_t key[]
Definition: argon2.h:87
Definition: alg_id.cpp:13
uint8_t out[]
Definition: pbkdf2.h:19
class BOTAN_PUBLIC_API(2, 0) AlgorithmIdentifier final bool BOTAN_PUBLIC_API(2, 0) operator
Name Constraints.
Definition: asn1_obj.h:66
fe T
Definition: ge.cpp:37
class BOTAN_PUBLIC_API(2, 11) Argon2 final class BOTAN_PUBLIC_API(2, 11) Argon2_Family final void size_t const char size_t const uint8_t size_t const uint8_t size_t key_len
Definition: argon2.h:87