diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-09-06 02:51:16 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-09-06 02:51:16 -0400 |
commit | 45323bddd83982a183714d91167194f73bab1440 (patch) | |
tree | 8b6d2543d1fba8a03b12572b8571155a8e972df7 /gost.cpp | |
parent | 33522b39b1de5806798bded49e481baecb56dc58 (diff) | |
download | cryptopp-git-45323bddd83982a183714d91167194f73bab1440.tar.gz |
Initial fix for older Apple ld's non_lazy_ptr missing symbols (Issue 255)
Diffstat (limited to 'gost.cpp')
-rw-r--r-- | gost.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -4,6 +4,9 @@ NAMESPACE_BEGIN(CryptoPP)
+// Hack for OS X 10.5 ld, http://github.com/weidai11/cryptopp/issues/255
+static const size_t s_unused = GOST::KEYLENGTH;
+
// these are the S-boxes given in Applied Cryptography 2nd Ed., p. 333
const byte GOST::Base::sBox[8][16]={
{4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3},
@@ -24,7 +27,7 @@ const byte GOST::Base::sBox[8][16]={ { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 },
{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 },
{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 },
- {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }};
+ {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 }};
*/
volatile bool GOST::Base::sTableCalculated = false;
@@ -44,7 +47,7 @@ void GOST::Base::PrecalculateSTable() if (!sTableCalculated)
{
for (unsigned i = 0; i < 4; i++)
- for (unsigned j = 0; j < 256; j++)
+ for (unsigned j = 0; j < 256; j++)
{
word32 temp = sBox[2*i][j%16] | (sBox[2*i+1][j/16] << 4);
sTable[i][j] = rotlMod(temp, 11+8*i);
|