Crypto++  5.6.3
Free C++ class library of cryptographic schemes
sosemanuk.h
Go to the documentation of this file.
1 // sosemanuk.h - written and placed in the public domain by Wei Dai
2 
3 //! \file sosemanuk.h
4 //! \brief Classes for Sosemanuk stream cipher
5 
6 #ifndef CRYPTOPP_SOSEMANUK_H
7 #define CRYPTOPP_SOSEMANUK_H
8 
9 #include "strciphr.h"
10 #include "secblock.h"
11 
12 // Clang due to "Inline assembly operands don't work with .intel_syntax"
13 // https://llvm.org/bugs/show_bug.cgi?id=24232
14 #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM)
15 # define CRYPTOPP_DISABLE_SOSEMANUK_ASM
16 #endif
17 
18 NAMESPACE_BEGIN(CryptoPP)
19 
20 //! algorithm info
21 struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16>
22 {
23  static const char * StaticAlgorithmName() {return "Sosemanuk";}
24 };
25 
26 //! _
28 {
29 protected:
30  void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length);
31  void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
32  void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length);
33  bool CipherIsRandomAccess() const {return false;}
34 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM)
35  unsigned int GetAlignment() const;
36  unsigned int GetOptimalBlockSize() const;
37 #endif
38 
41 };
42 
43 //! <a href="http://www.cryptolounge.org/wiki/Sosemanuk">Sosemanuk</a>
45 {
47  typedef Encryption Decryption;
48 };
49 
50 NAMESPACE_END
51 
52 #endif
Sosemanuk
Definition: sosemanuk.h:44
Classes and functions for secure memory allocations.
Interface for one direction (encryption or decryption) of a stream cipher or cipher mode...
Definition: cryptlib.h:1089
Interface for algorithms that take byte strings as keys.
Definition: cryptlib.h:514
algorithm info
Definition: sosemanuk.h:21
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:157
Provides Encryption and Decryption typedefs used by derived classes to implement a symmetric cipher...
Definition: seckey.h:412
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:277