summaryrefslogtreecommitdiff
path: root/cast.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-04-07 11:41:00 -0400
committerJeffrey Walton <noloader@gmail.com>2018-04-07 11:41:00 -0400
commit71e9fece8795d6bc23e629b6ee00fa96f9d1d2f6 (patch)
tree020fe9a1464f1166e867a96cf2cb907756d1b11f /cast.cpp
parent11e076003a1a47a285c563735adc1ff474ec8153 (diff)
downloadcryptopp-git-71e9fece8795d6bc23e629b6ee00fa96f9d1d2f6.tar.gz
Make CAST temporaries class members
Diffstat (limited to 'cast.cpp')
-rw-r--r--cast.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/cast.cpp b/cast.cpp
index b0ad3127..a63e3f8b 100644
--- a/cast.cpp
+++ b/cast.cpp
@@ -35,8 +35,7 @@ typedef BlockGetAndPut<word32, BigEndian> Block;
void CAST128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
- // TODO: add a SecBlock workspace to the class when the ABI can change
- word32 t,l,r;
+ word32 &t=m_t[0], &l=m_t[1], &r=m_t[2];
/* Get inblock into l,r */
Block::Get(inBlock)(l)(r);
@@ -66,8 +65,7 @@ void CAST128::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock,
void CAST128::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
- // TODO: add a SecBlock workspace to the class when the ABI can change
- word32 t,l,r;
+ word32 &t=m_t[0], &l=m_t[1], &r=m_t[2];
/* Get inblock into l,r */
Block::Get(inBlock)(r)(l);
@@ -256,9 +254,7 @@ void CAST256::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength,
{
AssertValidKeyLength(keylength);
- // TODO: add a SecBlock workspace to the class when the ABI can change
- word32 kappa[8];
- GetUserKey(BIG_ENDIAN_ORDER, kappa, 8, userKey, keylength);
+ GetUserKey(BIG_ENDIAN_ORDER, kappa.begin(), 8, userKey, keylength);
for(int i=0; i<12; ++i)
{
@@ -291,8 +287,6 @@ void CAST256::Base::UncheckedSetKey(const byte *userKey, unsigned int keylength,
}
}
}
-
- SecureWipeBuffer(kappa, 8);
}
NAMESPACE_END