From 45323bddd83982a183714d91167194f73bab1440 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 6 Sep 2016 02:51:16 -0400 Subject: Initial fix for older Apple ld's non_lazy_ptr missing symbols (Issue 255) --- gost.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gost.cpp') diff --git a/gost.cpp b/gost.cpp index f502f8a1..f60cf031 100644 --- a/gost.cpp +++ b/gost.cpp @@ -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); -- cgit v1.2.1