1
#ifndef CRYPTOPP_BLOWFISH_H
2
#define CRYPTOPP_BLOWFISH_H
9
NAMESPACE_BEGIN(CryptoPP)
12
struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 56>, public FixedRounds<16>
14
static const char *StaticAlgorithmName() {return "Blowfish";}
17
//! <a href="http://www.weidai.com/scan-mirror/cs.html#Blowfish">Blowfish</a>
18
class Blowfish : public Blowfish_Info, public BlockCipherDocumentation
20
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Blowfish_Info>
23
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
24
void UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs ¶ms);
27
void crypt_block(const word32 in[2], word32 out[2]) const;
29
static const word32 p_init[ROUNDS+2];
30
static const word32 s_init[4*256];
32
FixedSizeSecBlock<word32, ROUNDS+2> pbox;
33
FixedSizeSecBlock<word32, 4*256> sbox;
37
typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
38
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
41
typedef Blowfish::Encryption BlowfishEncryption;
42
typedef Blowfish::Decryption BlowfishDecryption;