Fabcoin Core  0.16.2
P2P Digital Currency
sosemanuk.h
Go to the documentation of this file.
1 // sosemanuk.h - written and placed in the public domain by Wei Dai
2 
6 
7 #ifndef CRYPTOPP_SOSEMANUK_H
8 #define CRYPTOPP_SOSEMANUK_H
9 
10 #include "strciphr.h"
11 #include "secblock.h"
12 
13 // Clang due to "Inline assembly operands don't work with .intel_syntax"
14 // https://llvm.org/bugs/show_bug.cgi?id=24232
15 #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM)
16 # define CRYPTOPP_DISABLE_SOSEMANUK_ASM
17 #endif
18 
20 
21 struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16>
25 {
26  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Sosemanuk";}
27 };
28 
33 {
34 protected:
35  void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
36  void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
37  void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length);
38  bool CipherIsRandomAccess() const {return false;}
39 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM)
40  unsigned int GetAlignment() const;
41  unsigned int GetOptimalBlockSize() const;
42 #endif
43 
46 };
47 
57 {
59  typedef Encryption Decryption;
60 };
61 
63 
64 #endif
virtual unsigned int GetOptimalBlockSize() const
Provides number of ideal bytes to process.
Definition: strciphr.h:125
uint8_t byte
Definition: Common.h:57
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
Sosemanuk stream cipher implementation.
Definition: sosemanuk.h:32
unsigned int GetAlignment() const
Provides data alignment requirements.
Definition: strciphr.h:196
Base class for additive stream ciphers.
Definition: strciphr.h:186
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
Key the cipher.
Definition: sosemanuk.cpp:22
void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
Resynchronize the cipher.
Definition: sosemanuk.cpp:28
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
Operates the keystream.
Definition: sosemanuk.cpp:327
Sosemanuk stream cipher.
Definition: sosemanuk.h:56
Classes and functions for secure memory allocations.
FixedSizeAlignedSecBlock< word32, 12 > m_state
Definition: sosemanuk.h:45
Interface for algorithms that take byte strings as keys.
Definition: cryptlib.h:524
SymmetricCipherFinal< ConcretePolicyHolder< SosemanukPolicy, AdditiveCipherTemplate<> >, SosemanukInfo > Encryption
Definition: sosemanuk.h:58
Sosemanuk stream cipher information.
Definition: sosemanuk.h:24
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:169
Classes for implementing stream ciphers.
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher...
Definition: seckey.h:424
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: sosemanuk.h:26
FixedSizeSecBlock< word32, 25 *4 > m_key
Definition: sosemanuk.h:44
#define NAMESPACE_END
Definition: config.h:201
KeystreamOperation
Keystream operation flags.
Definition: strciphr.h:90
SymmetricCipher implementation.
Definition: strciphr.h:584
Encryption Decryption
Definition: sosemanuk.h:59
Interface for retrieving values given their names.
Definition: cryptlib.h:279
bool CipherIsRandomAccess() const
Flag indicating random access.
Definition: sosemanuk.h:38