13 #ifndef CRYPTOPP_SPECK_H 14 #define CRYPTOPP_SPECK_H 20 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 21 # define CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS 1 24 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 25 # define CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS 1 36 template <
unsigned int L,
unsigned int D,
unsigned int N,
unsigned int M>
39 static const std::string StaticAlgorithmName()
58 mutable AlignedSecBlock m_wspace;
59 AlignedSecBlock m_rkeys;
60 unsigned int m_kwords;
61 unsigned int m_rounds;
82 std::string AlgorithmName()
const {
83 return StaticAlgorithmName() + (m_kwords == 0 ?
"" :
84 "(" +
IntToString(m_kwords*
sizeof(word32)*8) +
")");
88 void UncheckedSetKey(
const byte *userKey,
unsigned int keyLength,
const NameValuePairs ¶ms);
95 class CRYPTOPP_NO_VTABLE
Enc :
public Base 98 void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const;
99 #if CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS 100 size_t AdvancedProcessBlocks(
const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
const;
111 void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const;
112 #if CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS 113 size_t AdvancedProcessBlocks(
const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
const;
139 std::string AlgorithmName()
const {
140 return StaticAlgorithmName() + (m_kwords == 0 ?
"" :
141 "(" +
IntToString(m_kwords*
sizeof(word64)*8) +
")");
145 void UncheckedSetKey(
const byte *userKey,
unsigned int keyLength,
const NameValuePairs ¶ms);
155 void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const;
156 #if CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS 157 size_t AdvancedProcessBlocks(
const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
const;
168 void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const;
169 #if CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS 170 size_t AdvancedProcessBlocks(
const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
const;
180 #endif // CRYPTOPP_SPECK_H Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Provides implementation for encryption transformation.
Secure memory block with allocator and cleanup.
Library configuration file.
SPECK block cipher transformation functions.
Interface for one direction (encryption or decryption) of a block cipher.
SPECK block cipher base class.
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
SPECK block cipher transformation functions.
Classes and functions for implementing secret key algorithms.
Provides implementation for encryption transformation.
SPECK 128-bit block cipher.
Provides implementation for encryption transformation.
Inherited by keyed algorithms with variable key length.
std::string IntToString(T value, unsigned int base=10)
Converts a value to a string.
SPECK 64-bit block cipher.
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Crypto++ library namespace.
Provides implementation for encryption transformation.
SPECK block cipher information.
Interface for retrieving values given their names.