Crypto++
Main Page
Namespaces
Classes
Files
File List
File Members
3way.h
Go to the documentation of this file.
1
#ifndef CRYPTOPP_THREEWAY_H
2
#define CRYPTOPP_THREEWAY_H
3
4
/** \file
5
*/
6
7
#include "seckey.h"
8
#include "secblock.h"
9
10
NAMESPACE_BEGIN(CryptoPP)
11
12
//! _
13
struct
ThreeWay_Info
: public
FixedBlockSize
<12>, public
FixedKeyLength
<12>, public
VariableRounds
<11>
14
{
15
static
const
char
*StaticAlgorithmName() {
return
"3-Way"
;}
16
};
17
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#3-Way">3-Way</a>
19
class
ThreeWay
:
public
ThreeWay_Info
,
public
BlockCipherDocumentation
20
{
21
class
CRYPTOPP_NO_VTABLE Base :
public
BlockCipherImpl
<ThreeWay_Info>
22
{
23
public
:
24
void
UncheckedSetKey(
const
byte *key,
unsigned
int
length,
const
NameValuePairs
¶ms);
25
26
protected
:
27
unsigned
int
m_rounds;
28
FixedSizeSecBlock<word32, 3>
m_k;
29
};
30
31
class
CRYPTOPP_NO_VTABLE Enc :
public
Base
32
{
33
public
:
34
void
ProcessAndXorBlock(
const
byte *inBlock,
const
byte *xorBlock, byte *outBlock)
const
;
35
};
36
37
class
CRYPTOPP_NO_VTABLE Dec :
public
Base
38
{
39
public
:
40
void
ProcessAndXorBlock(
const
byte *inBlock,
const
byte *xorBlock, byte *outBlock)
const
;
41
};
42
43
public
:
44
typedef
BlockCipherFinal<ENCRYPTION, Enc>
Encryption
;
45
typedef
BlockCipherFinal<DECRYPTION, Dec>
Decryption
;
46
};
47
48
typedef
ThreeWay::Encryption
ThreeWayEncryption
;
49
typedef
ThreeWay::Decryption
ThreeWayDecryption
;
50
51
NAMESPACE_END
52
53
#endif
Generated on Sun Aug 18 2013 19:09:17 for Crypto++ by
1.8.4