Cleared SunCC warning "key hides GOST::Base::key"

This commit is contained in:
Jeffrey Walton 2016-09-14 21:13:22 -04:00
parent 92ed8454c7
commit b69d904499
2 changed files with 34 additions and 34 deletions

View File

@ -36,7 +36,7 @@ void GOST::Base::UncheckedSetKey(const byte *userKey, unsigned int length, const
PrecalculateSTable(); PrecalculateSTable();
GetUserKey(LITTLE_ENDIAN_ORDER, key.begin(), 8, userKey, KEYLENGTH); GetUserKey(LITTLE_ENDIAN_ORDER, m_key.begin(), 8, userKey, KEYLENGTH);
} }
void GOST::Base::PrecalculateSTable() void GOST::Base::PrecalculateSTable()
@ -68,24 +68,24 @@ void GOST::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by
for (unsigned int i=0; i<3; i++) for (unsigned int i=0; i<3; i++)
{ {
n2 ^= f(n1+key[0]); n2 ^= f(n1+m_key[0]);
n1 ^= f(n2+key[1]); n1 ^= f(n2+m_key[1]);
n2 ^= f(n1+key[2]); n2 ^= f(n1+m_key[2]);
n1 ^= f(n2+key[3]); n1 ^= f(n2+m_key[3]);
n2 ^= f(n1+key[4]); n2 ^= f(n1+m_key[4]);
n1 ^= f(n2+key[5]); n1 ^= f(n2+m_key[5]);
n2 ^= f(n1+key[6]); n2 ^= f(n1+m_key[6]);
n1 ^= f(n2+key[7]); n1 ^= f(n2+m_key[7]);
} }
n2 ^= f(n1+key[7]); n2 ^= f(n1+m_key[7]);
n1 ^= f(n2+key[6]); n1 ^= f(n2+m_key[6]);
n2 ^= f(n1+key[5]); n2 ^= f(n1+m_key[5]);
n1 ^= f(n2+key[4]); n1 ^= f(n2+m_key[4]);
n2 ^= f(n1+key[3]); n2 ^= f(n1+m_key[3]);
n1 ^= f(n2+key[2]); n1 ^= f(n2+m_key[2]);
n2 ^= f(n1+key[1]); n2 ^= f(n1+m_key[1]);
n1 ^= f(n2+key[0]); n1 ^= f(n2+m_key[0]);
Block::Put(xorBlock, outBlock)(n2)(n1); Block::Put(xorBlock, outBlock)(n2)(n1);
} }
@ -96,25 +96,25 @@ void GOST::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, by
Block::Get(inBlock)(n1)(n2); Block::Get(inBlock)(n1)(n2);
n2 ^= f(n1+key[0]); n2 ^= f(n1+m_key[0]);
n1 ^= f(n2+key[1]); n1 ^= f(n2+m_key[1]);
n2 ^= f(n1+key[2]); n2 ^= f(n1+m_key[2]);
n1 ^= f(n2+key[3]); n1 ^= f(n2+m_key[3]);
n2 ^= f(n1+key[4]); n2 ^= f(n1+m_key[4]);
n1 ^= f(n2+key[5]); n1 ^= f(n2+m_key[5]);
n2 ^= f(n1+key[6]); n2 ^= f(n1+m_key[6]);
n1 ^= f(n2+key[7]); n1 ^= f(n2+m_key[7]);
for (unsigned int i=0; i<3; i++) for (unsigned int i=0; i<3; i++)
{ {
n2 ^= f(n1+key[7]); n2 ^= f(n1+m_key[7]);
n1 ^= f(n2+key[6]); n1 ^= f(n2+m_key[6]);
n2 ^= f(n1+key[5]); n2 ^= f(n1+m_key[5]);
n1 ^= f(n2+key[4]); n1 ^= f(n2+m_key[4]);
n2 ^= f(n1+key[3]); n2 ^= f(n1+m_key[3]);
n1 ^= f(n2+key[2]); n1 ^= f(n2+m_key[2]);
n2 ^= f(n1+key[1]); n2 ^= f(n1+m_key[1]);
n1 ^= f(n2+key[0]); n1 ^= f(n2+m_key[0]);
} }
Block::Put(xorBlock, outBlock)(n2)(n1); Block::Put(xorBlock, outBlock)(n2)(n1);

2
gost.h
View File

@ -37,7 +37,7 @@ class GOST : public GOST_Info, public BlockCipherDocumentation
static volatile bool sTableCalculated; static volatile bool sTableCalculated;
static word32 sTable[4][256]; static word32 sTable[4][256];
FixedSizeSecBlock<word32, 8> key; FixedSizeSecBlock<word32, 8> m_key;
}; };
//! \class Enc //! \class Enc