Skip to content

Commit

Permalink
Fix SIMON64 and SPECK64 self test failures (GH #945)
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jul 7, 2020
1 parent abe69c6 commit 84ab419
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions simon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ void SIMON64::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength,
CRYPTOPP_ASSERT(0);
}

#if CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS

// Pre-splat the round keys for Altivec forward transformation
#if CRYPTOPP_ALTIVEC_AVAILABLE
if (IsForwardTransformation() && HasAltivec())
Expand All @@ -330,6 +332,8 @@ void SIMON64::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength,
m_rkeys.swap(presplat);
}
#endif

#endif // CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS
}

void SIMON64::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Expand Down Expand Up @@ -453,6 +457,8 @@ void SIMON128::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength
CRYPTOPP_ASSERT(0);
}

#if CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS

// Pre-splat the round keys for Altivec forward transformation
#if CRYPTOPP_ALTIVEC_AVAILABLE
if (IsForwardTransformation() && HasAltivec())
Expand All @@ -471,6 +477,8 @@ void SIMON128::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength
m_rkeys.swap(presplat);
}
#endif

#endif // CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS
}

void SIMON128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Expand Down
8 changes: 8 additions & 0 deletions speck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ void SPECK64::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength,
CRYPTOPP_ASSERT(0);
}

#if CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS

// Pre-splat the round keys for Altivec forward transformation
#if CRYPTOPP_ALTIVEC_AVAILABLE
if (IsForwardTransformation() && HasAltivec())
Expand All @@ -302,6 +304,8 @@ void SPECK64::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength,
m_rkeys.swap(presplat);
}
#endif

#endif // CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS
}

void SPECK64::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Expand Down Expand Up @@ -425,6 +429,8 @@ void SPECK128::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength
CRYPTOPP_ASSERT(0);
}

#if CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS

// Pre-splat the round keys for Altivec forward transformation
#if CRYPTOPP_ALTIVEC_AVAILABLE
if (IsForwardTransformation() && HasAltivec())
Expand All @@ -443,6 +449,8 @@ void SPECK128::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength
m_rkeys.swap(presplat);
}
#endif

#endif // CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS
}

void SPECK128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Expand Down

0 comments on commit 84ab419

Please sign in to comment.