Crypto++
Main Page
Namespaces
Classes
Files
File List
File Members
blowfish.h
Go to the documentation of this file.
1
#ifndef CRYPTOPP_BLOWFISH_H
2
#define CRYPTOPP_BLOWFISH_H
3
4
/** \file */
5
6
#include "seckey.h"
7
#include "secblock.h"
8
9
NAMESPACE_BEGIN(CryptoPP)
10
11
//! _
12
struct
Blowfish_Info
: public
FixedBlockSize
<8>, public
VariableKeyLength
<16, 1, 56>, public
FixedRounds
<16>
13
{
14
static
const
char
*StaticAlgorithmName() {
return
"Blowfish"
;}
15
};
16
17
//! <a href="http://www.weidai.com/scan-mirror/cs.html#Blowfish">Blowfish</a>
18
class
Blowfish
:
public
Blowfish_Info
,
public
BlockCipherDocumentation
19
{
20
class
CRYPTOPP_NO_VTABLE Base :
public
BlockCipherImpl
<Blowfish_Info>
21
{
22
public
:
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);
25
26
private
:
27
void
crypt_block(
const
word32 in[2], word32 out[2])
const
;
28
29
static
const
word32 p_init[ROUNDS+2];
30
static
const
word32 s_init[4*256];
31
32
FixedSizeSecBlock<word32, ROUNDS+2>
pbox;
33
FixedSizeSecBlock<word32, 4*256>
sbox;
34
};
35
36
public
:
37
typedef
BlockCipherFinal<ENCRYPTION, Base>
Encryption
;
38
typedef
BlockCipherFinal<DECRYPTION, Base>
Decryption
;
39
};
40
41
typedef
Blowfish::Encryption
BlowfishEncryption
;
42
typedef
Blowfish::Decryption
BlowfishDecryption
;
43
44
NAMESPACE_END
45
46
#endif
Generated on Tue Mar 1 2016 22:47:13 for Crypto++ by
1.8.4