From f0e49785f6b97b18dfd568beb5df99e595a80298 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 3 Dec 2017 09:00:39 -0500 Subject: Fix incorrect SPECK-128 decrypt when blocks >= 6 Add defines for CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS and CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS --- speck.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'speck.cpp') diff --git a/speck.cpp b/speck.cpp index f6762094..5acac044 100644 --- a/speck.cpp +++ b/speck.cpp @@ -364,7 +364,7 @@ void SPECK128::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock OutBlock oblk(xorBlock, outBlock); oblk(m_wspace[2])(m_wspace[3]); } -#if defined(CRYPTOPP_SPECK_ADVANCED_PROCESS_BLOCKS) +#if defined(CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS) size_t SPECK64::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const { @@ -386,7 +386,9 @@ size_t SPECK64::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xor #endif return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags); } +#endif // CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS +#if defined(CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS) size_t SPECK128::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const { @@ -418,6 +420,6 @@ size_t SPECK128::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xo #endif return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags); } -#endif +#endif // CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS NAMESPACE_END -- cgit v1.2.1