Fabcoin Core  0.16.2
P2P Digital Currency
blowfish.h
Go to the documentation of this file.
1 // blowfish.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_BLOWFISH_H
7 #define CRYPTOPP_BLOWFISH_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 
13 
14 struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4, 56>, public FixedRounds<16>
17 {
18  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Blowfish";}
19 };
20 
21 // <a href="http://www.weidai.com/scan-mirror/cs.html#Blowfish">Blowfish</a>
22 
27 {
31  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Blowfish_Info>
32  {
33  public:
34  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
35  void UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &params);
36 
37  private:
38  void crypt_block(const word32 in[2], word32 out[2]) const;
39 
40  static const word32 p_init[ROUNDS+2];
41  static const word32 s_init[4*256];
42 
45  };
46 
47 public:
50 };
51 
54 
56 
57 #endif
FixedSizeSecBlock< word32, 4 *256 > sbox
Definition: blowfish.h:44
uint8_t byte
Definition: Common.h:57
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:408
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
BlockCipherFinal< DECRYPTION, Base > Decryption
Definition: blowfish.h:49
Blowfish block cipher.
Definition: blowfish.h:26
Classes and functions for secure memory allocations.
BlockCipherFinal< ENCRYPTION, Base > Encryption
Definition: blowfish.h:48
Inherited by algorithms with fixed block size.
Definition: seckey.h:40
Classes and functions for implementing secret key algorithms.
FixedSizeSecBlock< word32, ROUNDS+2 > pbox
Definition: blowfish.h:43
Provides class member functions to key a block cipher.
Definition: seckey.h:324
Blowfish block cipher information.
Definition: blowfish.h:16
Inherited by algorithms with fixed number of rounds.
Definition: seckey.h:53
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:169
#define CRYPTOPP_NO_VTABLE
Definition: config.h:369
Blowfish::Encryption BlowfishEncryption
Definition: blowfish.h:52
#define NAMESPACE_END
Definition: config.h:201
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:311
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: blowfish.h:18
Blowfish::Decryption BlowfishDecryption
Definition: blowfish.h:53
Class specific implementation and overrides used to operate the cipher.
Definition: blowfish.h:31
unsigned int word32
Definition: config.h:231
Interface for retrieving values given their names.
Definition: cryptlib.h:279