Crypto++ 8.7
Free C++ class library of cryptographic schemes
3way.h
Go to the documentation of this file.
1// 3way.h - originally written and placed in the public domain by Wei Dai
2
3/// \file 3way.h
4/// \brief Classes for the 3-Way block cipher
5
6#ifndef CRYPTOPP_THREEWAY_H
7#define CRYPTOPP_THREEWAY_H
8
9#include "config.h"
10#include "seckey.h"
11#include "secblock.h"
12
13NAMESPACE_BEGIN(CryptoPP)
14
15/// \brief ThreeWay block cipher information
16struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
17{
18 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "3-Way";}
19};
20
21/// \brief ThreeWay block cipher
22/// \sa <a href="http://www.cryptopp.com/wiki/3-Way">3-Way</a>
24{
25 /// \brief Class specific implementation and overrides used to operate the cipher.
26 /// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
27 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<ThreeWay_Info>
28 {
29 public:
30 void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params);
31
32 protected:
33 unsigned int m_rounds;
35 };
36
37 /// \brief Class specific methods used to operate the cipher in the forward direction.
38 /// \details Implementations and overrides in \p Enc apply to \p ENCRYPTION.
39 class CRYPTOPP_NO_VTABLE Enc : public Base
40 {
41 public:
42 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
43 };
44
45 /// \brief Class specific methods used to operate the cipher in the reverse direction.
46 /// \details Implementations and overrides in \p Dec apply to \p DECRYPTION.
47 class CRYPTOPP_NO_VTABLE Dec : public Base
48 {
49 public:
50 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
51 };
52
53public:
56};
57
60
61NAMESPACE_END
62
63#endif
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:306
Inherited by algorithms with fixed block size.
Definition: seckey.h:41
Inherited by keyed algorithms with fixed key length.
Definition: seckey.h:125
Interface for retrieving values given their names.
Definition: cryptlib.h:322
ThreeWay block cipher.
Definition: 3way.h:24
Inherited by algorithms with variable number of rounds.
Definition: seckey.h:65
Library configuration file.
Crypto++ library namespace.
Classes and functions for secure memory allocations.
Classes and functions for implementing secret key algorithms.
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher.
Definition: seckey.h:399
ThreeWay block cipher information.
Definition: 3way.h:17