mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 01:49:41 +00:00
Whitespace checkin
This commit is contained in:
parent
4414b864cf
commit
894874fe75
@ -176,7 +176,7 @@ public:
|
||||
|
||||
if (!m_found && searchFirst)
|
||||
m_found = searchFirst->GetVoidValue(m_name, valueType, pValue);
|
||||
|
||||
|
||||
if (!m_found && typeid(T) != typeid(BASE))
|
||||
m_found = pObject->BASE::GetVoidValue(m_name, valueType, pValue);
|
||||
}
|
||||
@ -378,7 +378,7 @@ public:
|
||||
//! \brief Exception thrown when an AlgorithmParameter is unused
|
||||
class ParameterNotUsed : public Exception
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ParameterNotUsed(const char *name) : Exception(OTHER_ERROR, std::string("AlgorithmParametersBase: parameter \"") + name + "\" not used") {}
|
||||
};
|
||||
|
||||
@ -417,7 +417,7 @@ public:
|
||||
}
|
||||
|
||||
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const;
|
||||
|
||||
|
||||
protected:
|
||||
friend class AlgorithmParameters;
|
||||
void operator=(const AlgorithmParametersBase& rhs); // assignment not allowed, declare this for VC60
|
||||
|
6
asn.cpp
6
asn.cpp
@ -266,7 +266,7 @@ void OID::BERDecode(BufferedTransformation &bt)
|
||||
|
||||
if (!bt.Get(b))
|
||||
BERDecodeError();
|
||||
|
||||
|
||||
length--;
|
||||
m_values.resize(2);
|
||||
m_values[0] = b / 40;
|
||||
@ -292,7 +292,7 @@ void OID::BERDecodeAndCheck(BufferedTransformation &bt) const
|
||||
|
||||
inline BufferedTransformation & EncodedObjectFilter::CurrentTarget()
|
||||
{
|
||||
if (m_flags & PUT_OBJECTS)
|
||||
if (m_flags & PUT_OBJECTS)
|
||||
return *AttachedTransformation();
|
||||
else
|
||||
return TheBitBucket();
|
||||
@ -352,7 +352,7 @@ void EncodedObjectFilter::Put(const byte *inString, size_t length)
|
||||
|
||||
case TAIL: // silence warnings
|
||||
case ALL_DONE:
|
||||
default: ;;
|
||||
default: ;;
|
||||
}
|
||||
|
||||
if (m_state == IDENTIFIER && m_level == 0)
|
||||
|
4
asn.h
4
asn.h
@ -82,7 +82,7 @@ CRYPTOPP_DLL size_t CRYPTOPP_API DERLengthEncode(BufferedTransformation &bt, lwo
|
||||
//! \brief BER decode a length
|
||||
//! \param bt BufferedTransformation object for reading
|
||||
//! \param length the decoded size
|
||||
//! \returns true if the value was decoded
|
||||
//! \returns true if the value was decoded
|
||||
//! \throws BERDecodeError if the value fails to decode or is too large for size_t
|
||||
//! \details BERLengthDecode() returns false if the encoding is indefinite length.
|
||||
CRYPTOPP_DLL bool CRYPTOPP_API BERLengthDecode(BufferedTransformation &bt, size_t &length);
|
||||
@ -174,7 +174,7 @@ public:
|
||||
//! \brief DER encode this OID
|
||||
//! \param bt BufferedTransformation object
|
||||
void DEREncode(BufferedTransformation &bt) const;
|
||||
|
||||
|
||||
//! \brief BER decode an OID
|
||||
//! \param bt BufferedTransformation object
|
||||
void BERDecode(BufferedTransformation &bt);
|
||||
|
10
base64.cpp
10
base64.cpp
@ -19,7 +19,7 @@ void Base64Encoder::IsolatedInitialize(const NameValuePairs ¶meters)
|
||||
int maxLineLength = parameters.GetIntValueWithDefault(Name::MaxLineLength(), 72);
|
||||
|
||||
const char *lineBreak = insertLineBreaks ? "\n" : "";
|
||||
|
||||
|
||||
m_filter->Initialize(CombinedNameValuePairs(
|
||||
parameters,
|
||||
MakeParameters(Name::EncodingLookupArray(), &s_stdVec[0], false)
|
||||
@ -34,9 +34,9 @@ void Base64URLEncoder::IsolatedInitialize(const NameValuePairs ¶meters)
|
||||
{
|
||||
bool insertLineBreaks = parameters.GetValueWithDefault(Name::InsertLineBreaks(), true);
|
||||
int maxLineLength = parameters.GetIntValueWithDefault(Name::MaxLineLength(), 72);
|
||||
|
||||
|
||||
const char *lineBreak = insertLineBreaks ? "\n" : "";
|
||||
|
||||
|
||||
m_filter->Initialize(CombinedNameValuePairs(
|
||||
parameters,
|
||||
MakeParameters(Name::EncodingLookupArray(), &s_urlVec[0], false)
|
||||
@ -58,7 +58,7 @@ const int *Base64Decoder::GetDecodingLookupArray()
|
||||
{
|
||||
static volatile bool s_initialized = false;
|
||||
static int s_array[256];
|
||||
|
||||
|
||||
if (!s_initialized)
|
||||
{
|
||||
InitializeDecodingLookupArray(s_array, s_stdVec, 64, false);
|
||||
@ -78,7 +78,7 @@ const int *Base64URLDecoder::GetDecodingLookupArray()
|
||||
{
|
||||
static volatile bool s_initialized = false;
|
||||
static int s_array[256];
|
||||
|
||||
|
||||
if (!s_initialized)
|
||||
{
|
||||
InitializeDecodingLookupArray(s_array, s_urlVec, 64, false);
|
||||
|
8
base64.h
8
base64.h
@ -64,7 +64,7 @@ public:
|
||||
//! \sa IsolatedInitialize() for an example of modifying an encoder after construction.
|
||||
Base64Decoder(BufferedTransformation *attachment = NULL)
|
||||
: BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
|
||||
|
||||
|
||||
//! \brief Initialize or reinitialize this object, without signal propagation
|
||||
//! \param parameters a set of NameValuePairs used to initialize this object
|
||||
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
|
||||
@ -115,7 +115,7 @@ public:
|
||||
CRYPTOPP_UNUSED(insertLineBreaks), CRYPTOPP_UNUSED(maxLineLength);
|
||||
IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false));
|
||||
}
|
||||
|
||||
|
||||
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
|
||||
//! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
|
||||
//! transformations. If initialization should be propagated, then use the Initialize() function.
|
||||
@ -141,7 +141,7 @@ public:
|
||||
//! \sa Base64Decoder for a decoder that provides a classic alphabet.
|
||||
Base64URLDecoder(BufferedTransformation *attachment = NULL)
|
||||
: BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
|
||||
|
||||
|
||||
//! \brief Initialize or reinitialize this object, without signal propagation
|
||||
//! \param parameters a set of NameValuePairs used to initialize this object
|
||||
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
|
||||
@ -150,7 +150,7 @@ public:
|
||||
//! \sa Base64Decoder for a decoder that provides a classic alphabet, and Base64URLEncoder::IsolatedInitialize
|
||||
//! for an example of modifying an encoder after construction.
|
||||
void IsolatedInitialize(const NameValuePairs ¶meters);
|
||||
|
||||
|
||||
private:
|
||||
//! \brief Provides the default decoding lookup table
|
||||
//! \return default decoding lookup table
|
||||
|
@ -88,7 +88,7 @@ size_t BaseN_Encoder::Put2(const byte *begin, size_t length, int messageEnd, boo
|
||||
m_outBuf[i] = m_alphabet[m_outBuf[i]];
|
||||
}
|
||||
FILTER_OUTPUT(1, m_outBuf, m_outputBlockSize, 0);
|
||||
|
||||
|
||||
m_bytePos = m_bitPos = 0;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
|
||||
bool IsSelfInverting() const {return true;}
|
||||
bool IsForwardTransformation() const {return true;}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~PublicBlumBlumShub() {}
|
||||
#endif
|
||||
@ -45,7 +45,7 @@ public:
|
||||
// Make sure p and q are both primes congruent to 3 mod 4 and at least 512 bits long,
|
||||
// seed is the secret key and should be about as big as p*q
|
||||
BlumBlumShub(const Integer &p, const Integer &q, const Integer &seed);
|
||||
|
||||
|
||||
bool IsRandomAccess() const {return true;}
|
||||
void Seek(lword index);
|
||||
|
||||
|
4
ccm.cpp
4
ccm.cpp
@ -44,7 +44,7 @@ void CCM_Base::Resync(const byte *iv, size_t len)
|
||||
m_ctr.SetCipherWithIV(cipher, m_buffer);
|
||||
|
||||
m_ctr.Seek(REQUIRED_BLOCKSIZE);
|
||||
m_aadLength = 0;
|
||||
m_aadLength = 0;
|
||||
m_messageLength = 0;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ void CCM_Base::UncheckedSpecifyDataLengths(lword headerLength, lword messageLeng
|
||||
if (m_state != State_IVSet)
|
||||
throw BadState(AlgorithmName(), "SpecifyDataLengths", "or after State_IVSet");
|
||||
|
||||
m_aadLength = headerLength;
|
||||
m_aadLength = headerLength;
|
||||
m_messageLength = messageLength;
|
||||
|
||||
byte *cbcBuffer = CBC_Buffer();
|
||||
|
@ -298,7 +298,7 @@ void ChannelSwitch::RemoveRoute(const std::string &inChannel, BufferedTransforma
|
||||
{
|
||||
typedef ChannelSwitch::RouteMap::iterator MapIterator;
|
||||
pair<MapIterator, MapIterator> range = m_routeMap.equal_range(inChannel);
|
||||
|
||||
|
||||
for (MapIterator it = range.first; it != range.second; ++it)
|
||||
if (it->second.first == &destination && it->second.second == outChannel)
|
||||
{
|
||||
|
@ -76,13 +76,13 @@ public:
|
||||
void Next();
|
||||
BufferedTransformation & Destination();
|
||||
const std::string & Channel();
|
||||
|
||||
|
||||
ChannelSwitch& m_cs;
|
||||
std::string m_channel;
|
||||
bool m_useDefault;
|
||||
MapIterator m_itMapCurrent, m_itMapEnd;
|
||||
ListIterator m_itListCurrent, m_itListEnd;
|
||||
|
||||
|
||||
protected:
|
||||
// Hide this to see if we break something...
|
||||
ChannelRouteIterator();
|
||||
@ -111,7 +111,7 @@ public:
|
||||
bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true);
|
||||
|
||||
byte * ChannelCreatePutSpace(const std::string &channel, size_t &size);
|
||||
|
||||
|
||||
void AddDefaultRoute(BufferedTransformation &destination);
|
||||
void RemoveDefaultRoute(BufferedTransformation &destination);
|
||||
void AddDefaultRoute(BufferedTransformation &destination, const std::string &outChannel);
|
||||
|
2
cmac.cpp
2
cmac.cpp
@ -31,7 +31,7 @@ static void MulU(byte *k, unsigned int length)
|
||||
k[15] ^= 0x87;
|
||||
break;
|
||||
case 32:
|
||||
k[30] ^= 4;
|
||||
k[30] ^= 4;
|
||||
k[31] ^= 0x23;
|
||||
break;
|
||||
default:
|
||||
|
8
dh.h
8
dh.h
@ -45,7 +45,7 @@ public:
|
||||
|
||||
//! \brief Construct a Diffie-Hellman domain
|
||||
//! \tparam T2 template parameter used as a constructor parameter
|
||||
//! \param v1 RandomNumberGenerator derived class
|
||||
//! \param v1 RandomNumberGenerator derived class
|
||||
//! \param v2 second parameter
|
||||
//! \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
|
||||
template <class T2>
|
||||
@ -55,7 +55,7 @@ public:
|
||||
//! \brief Construct a Diffie-Hellman domain
|
||||
//! \tparam T2 template parameter used as a constructor parameter
|
||||
//! \tparam T3 template parameter used as a constructor parameter
|
||||
//! \param v1 RandomNumberGenerator derived class
|
||||
//! \param v1 RandomNumberGenerator derived class
|
||||
//! \param v2 second parameter
|
||||
//! \param v3 third parameter
|
||||
//! \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
|
||||
@ -67,7 +67,7 @@ public:
|
||||
//! \tparam T2 template parameter used as a constructor parameter
|
||||
//! \tparam T3 template parameter used as a constructor parameter
|
||||
//! \tparam T4 template parameter used as a constructor parameter
|
||||
//! \param v1 RandomNumberGenerator derived class
|
||||
//! \param v1 RandomNumberGenerator derived class
|
||||
//! \param v2 second parameter
|
||||
//! \param v3 third parameter
|
||||
//! \param v4 fourth parameter
|
||||
@ -152,7 +152,7 @@ public:
|
||||
static std::string CRYPTOPP_API StaticAlgorithmName()
|
||||
{return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();}
|
||||
std::string AlgorithmName() const {return StaticAlgorithmName();}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DH_Domain() {}
|
||||
#endif
|
||||
|
2
dh2.cpp
2
dh2.cpp
@ -13,7 +13,7 @@ void DH2_TestInstantiations()
|
||||
#endif
|
||||
|
||||
bool DH2::Agree(byte *agreedValue,
|
||||
const byte *staticSecretKey, const byte *ephemeralSecretKey,
|
||||
const byte *staticSecretKey, const byte *ephemeralSecretKey,
|
||||
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
|
||||
bool validateStaticOtherPublicKey) const
|
||||
{
|
||||
|
2
dh2.h
2
dh2.h
@ -48,7 +48,7 @@ public:
|
||||
{d2.GenerateKeyPair(rng, privateKey, publicKey);}
|
||||
|
||||
bool Agree(byte *agreedValue,
|
||||
const byte *staticPrivateKey, const byte *ephemeralPrivateKey,
|
||||
const byte *staticPrivateKey, const byte *ephemeralPrivateKey,
|
||||
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
|
||||
bool validateStaticOtherPublicKey=true) const;
|
||||
|
||||
|
2
dsa.h
2
dsa.h
@ -33,7 +33,7 @@ enum DSASignatureFormat {
|
||||
//! \details This function converts between these formats, and returns length
|
||||
//! of signature in the target format. If <tt>toFormat == DSA_P1363</tt>, then
|
||||
//! <tt>bufferSize</tt> must equal <tt>publicKey.SignatureLength()</tt>
|
||||
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
|
||||
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
|
||||
const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat);
|
||||
|
||||
NAMESPACE_END
|
||||
|
6
ec2n.cpp
6
ec2n.cpp
@ -62,7 +62,7 @@ bool EC2N::DecodePoint(EC2N::Point &P, BufferedTransformation &bt, size_t encode
|
||||
return false;
|
||||
|
||||
P.identity = false;
|
||||
P.x.Decode(bt, m_field->MaxElementByteLength());
|
||||
P.x.Decode(bt, m_field->MaxElementByteLength());
|
||||
|
||||
if (P.x.IsZero())
|
||||
{
|
||||
@ -148,14 +148,14 @@ bool EC2N::ValidateParameters(RandomNumberGenerator &rng, unsigned int level) co
|
||||
|
||||
if (level >= 1)
|
||||
pass = pass && m_field->GetModulus().IsIrreducible();
|
||||
|
||||
|
||||
return pass;
|
||||
}
|
||||
|
||||
bool EC2N::VerifyPoint(const Point &P) const
|
||||
{
|
||||
const FieldElement &x = P.x, &y = P.y;
|
||||
return P.identity ||
|
||||
return P.identity ||
|
||||
(x.CoefficientCount() <= m_field->MaxElementBitLength()
|
||||
&& y.CoefficientCount() <= m_field->MaxElementBitLength()
|
||||
&& !(((x+m_a)*x*x+m_b-(x+y)*y)%m_field->GetModulus()));
|
||||
|
6
ec2n.h
6
ec2n.h
@ -29,7 +29,7 @@ struct CRYPTOPP_DLL EC2NPoint
|
||||
{return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);}
|
||||
bool operator< (const EC2NPoint &t) const
|
||||
{return identity ? !t.identity : (!t.identity && (x<t.x || (x==t.x && y<t.y)));}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~EC2NPoint() {}
|
||||
#endif
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
bool operator==(const EC2N &rhs) const
|
||||
{return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~EC2N() {}
|
||||
#endif
|
||||
@ -121,7 +121,7 @@ public:
|
||||
// non-inherited
|
||||
void SetCurve(const EC2N &ec) {m_ec = ec;}
|
||||
const EC2N & GetCurve() const {return m_ec;}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~EcPrecomputation() {}
|
||||
#endif
|
||||
|
34
eccrypto.cpp
34
eccrypto.cpp
@ -136,21 +136,21 @@ static void GetRecommendedParameters(const EcRecommendedParameters<EC2N> *&begin
|
||||
{
|
||||
// this array must be sorted by OID
|
||||
static const EcRecommendedParameters<EC2N> rec[] = {
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect163k1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect163k1(),
|
||||
163, 7, 6, 3, 0,
|
||||
"000000000000000000000000000000000000000001",
|
||||
"000000000000000000000000000000000000000001",
|
||||
"0402FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE80289070FB05D38FF58321F2E800536D538CCDAA3D9",
|
||||
"04000000000000000000020108A2E0CC0D99F8A5EF",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect163r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect163r1(),
|
||||
163, 7, 6, 3, 0,
|
||||
"07B6882CAAEFA84F9554FF8428BD88E246D2782AE2",
|
||||
"0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9",
|
||||
"040369979697AB43897789566789567F787A7876A65400435EDB42EFAFB2989D51FEFCE3C80988F41FF883",
|
||||
"03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect239k1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect239k1(),
|
||||
239, 158, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000000",
|
||||
"000000000000000000000000000000000000000000000000000000000001",
|
||||
@ -164,98 +164,98 @@ static void GetRecommendedParameters(const EcRecommendedParameters<EC2N> *&begin
|
||||
"04009D73616F35F4AB1407D73562C10F00A52830277958EE84D1315ED31886",
|
||||
"0100000000000000D9CCEC8A39E56F",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect113r2(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect113r2(),
|
||||
113, 9, 0,
|
||||
"00689918DBEC7E5A0DD6DFC0AA55C7",
|
||||
"0095E9A9EC9B297BD4BF36E059184F",
|
||||
"0401A57A6A7B26CA5EF52FCDB816479700B3ADC94ED1FE674C06E695BABA1D",
|
||||
"010000000000000108789B2496AF93",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect163r2(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect163r2(),
|
||||
163, 7, 6, 3, 0,
|
||||
"000000000000000000000000000000000000000001",
|
||||
"020A601907B8C953CA1481EB10512F78744A3205FD",
|
||||
"0403F0EBA16286A2D57EA0991168D4994637E8343E3600D51FBC6C71A0094FA2CDD545B11C5C0C797324F1",
|
||||
"040000000000000000000292FE77E70C12A4234C33",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect283k1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect283k1(),
|
||||
283, 12, 7, 5, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
"040503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC245849283601CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259",
|
||||
"01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61",
|
||||
4),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect283r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect283r1(),
|
||||
283, 12, 7, 5, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
"027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5",
|
||||
"0405F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B1205303676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4",
|
||||
"03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect131r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect131r1(),
|
||||
131, 8, 3, 2, 0,
|
||||
"07A11B09A76B562144418FF3FF8C2570B8",
|
||||
"0217C05610884B63B9C6C7291678F9D341",
|
||||
"040081BAF91FDF9833C40F9C181343638399078C6E7EA38C001F73C8134B1B4EF9E150",
|
||||
"0400000000000000023123953A9464B54D",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect131r2(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect131r2(),
|
||||
131, 8, 3, 2, 0,
|
||||
"03E5A88919D7CAFCBF415F07C2176573B2",
|
||||
"04B8266A46C55657AC734CE38F018F2192",
|
||||
"040356DCD8F2F95031AD652D23951BB366A80648F06D867940A5366D9E265DE9EB240F",
|
||||
"0400000000000000016954A233049BA98F",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect193r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect193r1(),
|
||||
193, 15, 0,
|
||||
"0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01",
|
||||
"00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814",
|
||||
"0401F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E10025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05",
|
||||
"01000000000000000000000000C7F34A778F443ACC920EBA49",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect193r2(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect193r2(),
|
||||
193, 15, 0,
|
||||
"0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B",
|
||||
"00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE",
|
||||
"0400D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C",
|
||||
"010000000000000000000000015AAB561B005413CCD4EE99D5",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect233k1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect233k1(),
|
||||
233, 74, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000000",
|
||||
"000000000000000000000000000000000000000000000000000000000001",
|
||||
"04017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD612601DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3",
|
||||
"8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF",
|
||||
4),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect233r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect233r1(),
|
||||
233, 74, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000001",
|
||||
"0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD",
|
||||
"0400FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052",
|
||||
"01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect409k1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect409k1(),
|
||||
409, 87, 0,
|
||||
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
"040060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE902374601E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B",
|
||||
"7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF",
|
||||
4),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect409r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect409r1(),
|
||||
409, 87, 0,
|
||||
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
"0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F",
|
||||
"04015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A70061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706",
|
||||
"010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173",
|
||||
2),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect571k1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect571k1(),
|
||||
571, 10, 5, 2, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
"04026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C89720349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3",
|
||||
"020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001",
|
||||
4),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect571r1(),
|
||||
EcRecommendedParameters<EC2N>(ASN1::sect571r1(),
|
||||
571, 10, 5, 2, 0,
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
|
||||
"02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A",
|
||||
|
6
ecp.h
6
ecp.h
@ -93,7 +93,7 @@ public:
|
||||
|
||||
bool operator==(const ECP &rhs) const
|
||||
{return GetField() == rhs.GetField() && m_a == rhs.m_a && m_b == rhs.m_b;}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~ECP() {}
|
||||
#endif
|
||||
@ -114,7 +114,7 @@ template<> class EcPrecomputation<ECP> : public DL_GroupPrecomputation<ECP::Poin
|
||||
{
|
||||
public:
|
||||
typedef ECP EllipticCurve;
|
||||
|
||||
|
||||
// DL_GroupPrecomputation
|
||||
bool NeedConversions() const {return true;}
|
||||
Element ConvertIn(const Element &P) const
|
||||
@ -132,7 +132,7 @@ public:
|
||||
m_ecOriginal = ec;
|
||||
}
|
||||
const ECP & GetCurve() const {return *m_ecOriginal;}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~EcPrecomputation() {}
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator& /*rng*/,
|
||||
void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator& /*rng*/,
|
||||
const byte* recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const
|
||||
|
4
emsa2.h
4
emsa2.h
@ -62,11 +62,11 @@ class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup<PK_DeterministicSignature
|
||||
{
|
||||
public:
|
||||
CRYPTOPP_CONSTEXPR static const char * CRYPTOPP_API StaticAlgorithmName() {return "EMSA2";}
|
||||
|
||||
|
||||
size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const
|
||||
{CRYPTOPP_UNUSED(hashIdentifierLength); return 8*digestLength + 31;}
|
||||
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const;
|
||||
|
@ -97,8 +97,8 @@ template <class T> T DL_FixedBasePrecomputationImpl<T>::Exponentiate(const DL_Gr
|
||||
return group.ConvertOut(GeneralCascadeMultiplication<Element>(group.GetGroup(), eb.begin(), eb.end()));
|
||||
}
|
||||
|
||||
template <class T> T
|
||||
DL_FixedBasePrecomputationImpl<T>::CascadeExponentiate(const DL_GroupPrecomputation<Element> &group, const Integer &exponent,
|
||||
template <class T> T
|
||||
DL_FixedBasePrecomputationImpl<T>::CascadeExponentiate(const DL_GroupPrecomputation<Element> &group, const Integer &exponent,
|
||||
const DL_FixedBasePrecomputation<T> &i_pc2, const Integer &exponent2) const
|
||||
{
|
||||
std::vector<BaseAndExponent<Element> > eb; // array of segments of the exponent and precalculated bases
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
virtual const AbstractGroup<Element> & GetGroup() const =0;
|
||||
virtual Element BERDecodeElement(BufferedTransformation &bt) const =0;
|
||||
virtual void DEREncodeElement(BufferedTransformation &bt, const Element &P) const =0;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_GroupPrecomputation() {}
|
||||
#endif
|
||||
|
@ -148,7 +148,7 @@ void InvertibleESIGNFunction::DEREncode(BufferedTransformation &bt) const
|
||||
privateKey.MessageEnd();
|
||||
}
|
||||
|
||||
Integer InvertibleESIGNFunction::CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
Integer InvertibleESIGNFunction::CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
{
|
||||
DoQuickSanityCheck();
|
||||
|
||||
|
2
files.h
2
files.h
@ -43,7 +43,7 @@ public:
|
||||
|
||||
private:
|
||||
void StoreInitialize(const NameValuePairs ¶meters);
|
||||
|
||||
|
||||
member_ptr<std::ifstream> m_file;
|
||||
std::istream *m_stream;
|
||||
byte *m_space;
|
||||
|
10
filters.cpp
10
filters.cpp
@ -346,11 +346,11 @@ bool FilterWithBufferedInput::IsolatedFlush(bool hardFlush, bool blocking)
|
||||
{
|
||||
if (!blocking)
|
||||
throw BlockingInputOnly("FilterWithBufferedInput");
|
||||
|
||||
|
||||
if (hardFlush)
|
||||
ForceNextPut();
|
||||
FlushDerived();
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ void FilterWithBufferedInput::ForceNextPut()
|
||||
{
|
||||
if (!m_firstInputDone)
|
||||
return;
|
||||
|
||||
|
||||
if (m_blockSize > 1)
|
||||
{
|
||||
while (m_queue.CurrentSize() >= m_blockSize)
|
||||
@ -669,7 +669,7 @@ void StreamTransformationFilter::NextPutModifiable(byte *inString, size_t length
|
||||
void StreamTransformationFilter::LastPut(const byte *inString, size_t length)
|
||||
{
|
||||
byte *space = NULL;
|
||||
|
||||
|
||||
switch (m_padding)
|
||||
{
|
||||
case NO_PADDING:
|
||||
@ -855,7 +855,7 @@ void HashVerificationFilter::LastPut(const byte *inString, size_t length)
|
||||
|
||||
// *************************************************************
|
||||
|
||||
AuthenticatedEncryptionFilter::AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment,
|
||||
AuthenticatedEncryptionFilter::AuthenticatedEncryptionFilter(AuthenticatedSymmetricCipher &c, BufferedTransformation *attachment,
|
||||
bool putAAD, int truncatedDigestSize, const std::string &macChannel, BlockPaddingScheme padding)
|
||||
: StreamTransformationFilter(c, attachment, padding, true)
|
||||
, m_hf(c, new OutputProxy(*this, false), putAAD, truncatedDigestSize, AAD_CHANNEL, macChannel)
|
||||
|
36
filters.h
36
filters.h
@ -39,7 +39,7 @@ public:
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~Filter() {}
|
||||
#endif
|
||||
|
||||
|
||||
//! \name ATTACHMENT
|
||||
//@{
|
||||
|
||||
@ -52,23 +52,23 @@ public:
|
||||
//! \returns \p true if the object allows attached transformations, \p false otherwise.
|
||||
//! \note Source and Filter offer attached transformations; while Sink does not.
|
||||
bool Attachable() {return true;}
|
||||
|
||||
|
||||
//! \brief Retrieve attached transformation
|
||||
//! \returns pointer to a BufferedTransformation if there is an attached transformation, \p NULL otherwise.
|
||||
BufferedTransformation *AttachedTransformation();
|
||||
|
||||
|
||||
//! \brief Retrieve attached transformation
|
||||
//! \returns pointer to a BufferedTransformation if there is an attached transformation, \p NULL otherwise.
|
||||
const BufferedTransformation *AttachedTransformation() const;
|
||||
|
||||
|
||||
//! \brief Replace an attached transformation
|
||||
//! \param newAttachment an optional attached transformation
|
||||
//! \details newAttachment can be a single filter, a chain of filters or \p NULL.
|
||||
//! Pass \p NULL to remove an existing BufferedTransformation or chain of filters
|
||||
void Detach(BufferedTransformation *newAttachment = NULL);
|
||||
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
// See the documentation for BufferedTransformation in cryptlib.h
|
||||
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
|
||||
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const;
|
||||
@ -77,7 +77,7 @@ public:
|
||||
void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1);
|
||||
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true);
|
||||
bool MessageSeriesEnd(int propagation=-1, bool blocking=true);
|
||||
|
||||
|
||||
protected:
|
||||
virtual BufferedTransformation * NewDefaultAttachment() const;
|
||||
void Insert(Filter *nextFilter); // insert filter after this one
|
||||
@ -96,7 +96,7 @@ protected:
|
||||
//! \param channel the channel to process the data
|
||||
//! \returns the number of bytes that remain in the block (i.e., bytes not processed)
|
||||
size_t Output(int outputSite, const byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL);
|
||||
|
||||
|
||||
//! \brief Output multiple bytes that may be modified by callee.
|
||||
//! \param outputSite unknown, system crash between keyboard and chair...
|
||||
//! \param inString the byte buffer to process
|
||||
@ -106,7 +106,7 @@ protected:
|
||||
//! \param channel the channel to process the data
|
||||
//! \returns the number of bytes that remain in the block (i.e., bytes not processed)
|
||||
size_t OutputModifiable(int outputSite, byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL);
|
||||
|
||||
|
||||
//! \brief Signals the end of messages to the object
|
||||
//! \param outputSite unknown, system crash between keyboard and chair...
|
||||
//! \param propagation the number of attached transformations the MessageEnd() signal should be passed
|
||||
@ -116,7 +116,7 @@ protected:
|
||||
//! \details propagation count includes this object. Setting propagation to <tt>1</tt> means this
|
||||
//! object only. Setting propagation to <tt>-1</tt> means unlimited propagation.
|
||||
bool OutputMessageEnd(int outputSite, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL);
|
||||
|
||||
|
||||
//! \brief Flush buffered input and/or output, with signal propagation
|
||||
//! \param outputSite unknown, system crash between keyboard and chair...
|
||||
//! \param hardFlush is used to indicate whether all data should be flushed
|
||||
@ -135,7 +135,7 @@ protected:
|
||||
//! example ZlibCompressor. This is useful when zlib compressed data is moved across a
|
||||
//! network in packets and compression state is preserved across packets, as in the SSH2 protocol.
|
||||
bool OutputFlush(int outputSite, bool hardFlush, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL);
|
||||
|
||||
|
||||
//! \brief Marks the end of a series of messages, with signal propagation
|
||||
//! \param outputSite unknown, system crash between keyboard and chair...
|
||||
//! \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed
|
||||
@ -146,12 +146,12 @@ protected:
|
||||
//! propagation, and then pass the signal on to attached transformations if the value is not 0.
|
||||
//! \details propagation count includes this object. Setting propagation to <tt>1</tt> means this
|
||||
//! object only. Setting propagation to <tt>-1</tt> means unlimited propagation.
|
||||
//! \note There should be a MessageEnd() immediately before MessageSeriesEnd().
|
||||
//! \note There should be a MessageEnd() immediately before MessageSeriesEnd().
|
||||
bool OutputMessageSeriesEnd(int outputSite, int propagation, bool blocking, const std::string &channel=DEFAULT_CHANNEL);
|
||||
|
||||
private:
|
||||
member_ptr<BufferedTransformation> m_attachment;
|
||||
|
||||
|
||||
protected:
|
||||
size_t m_inputPosition;
|
||||
int m_continueAt;
|
||||
@ -427,7 +427,7 @@ public:
|
||||
{
|
||||
if (!blocking)
|
||||
throw BlockingInputOnly("FilterWithInputQueue");
|
||||
|
||||
|
||||
m_inQueue.Put(inString, length);
|
||||
if (messageEnd)
|
||||
{
|
||||
@ -779,7 +779,7 @@ public:
|
||||
Redirector(BufferedTransformation &target, Behavior behavior=PASS_EVERYTHING)
|
||||
: m_target(&target), m_behavior(behavior) {}
|
||||
|
||||
//! \brief Redirect input to another BufferedTransformation
|
||||
//! \brief Redirect input to another BufferedTransformation
|
||||
//! \param target the destination BufferedTransformation
|
||||
void Redirect(BufferedTransformation &target) {m_target = ⌖}
|
||||
//! \brief Stop redirecting input
|
||||
@ -983,7 +983,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
T *m_output;
|
||||
};
|
||||
|
||||
@ -1256,7 +1256,7 @@ public:
|
||||
//! \param attachment an optional attached transformation
|
||||
StringSource(BufferedTransformation *attachment = NULL)
|
||||
: SourceTemplate<StringStore>(attachment) {}
|
||||
|
||||
|
||||
//! \brief Construct a StringSource
|
||||
//! \param string C-String
|
||||
//! \param pumpAll C-String
|
||||
@ -1279,7 +1279,7 @@ class CRYPTOPP_DLL RandomNumberSource : public SourceTemplate<RandomNumberStore>
|
||||
{
|
||||
public:
|
||||
RandomNumberSource(RandomNumberGenerator &rng, int length, bool pumpAll, BufferedTransformation *attachment = NULL)
|
||||
: SourceTemplate<RandomNumberStore>(attachment)
|
||||
: SourceTemplate<RandomNumberStore>(attachment)
|
||||
{SourceInitialize(pumpAll, MakeParameters("RandomNumberGeneratorPointer", &rng)("RandomNumberStoreSize", length));}
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
// Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during
|
||||
// Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during
|
||||
// startup, random number generation, and key generation. These tests may affect performance.
|
||||
#ifndef CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
|
||||
#define CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 0
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "secblock.h"
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
|
||||
//! \class SelfTestFailure
|
||||
//! Exception thrown when a crypto algorithm is used after a self test fails
|
||||
//! \details The self tests for an algorithm are performed by Algortihm class
|
||||
@ -36,7 +36,7 @@ CRYPTOPP_DLL bool CRYPTOPP_API FIPS_140_2_ComplianceEnabled();
|
||||
|
||||
//! \brief Status of the power-up self test
|
||||
enum PowerUpSelfTestStatus {
|
||||
|
||||
|
||||
//! \brief The self tests have not been performed.
|
||||
POWER_UP_SELF_TEST_NOT_DONE,
|
||||
//! \brief The self tests were executed via DoPowerUpSelfTest() or
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
{
|
||||
if (!blocking)
|
||||
throw BlockingInputOnly("LineBreakParser");
|
||||
|
||||
|
||||
unsigned int i, last = 0;
|
||||
for (i=0; i<length; i++)
|
||||
{
|
||||
@ -456,7 +456,7 @@ protected:
|
||||
{
|
||||
Integer p, q, h, g;
|
||||
int counter;
|
||||
|
||||
|
||||
SecByteBlock seed(SHA::DIGESTSIZE);
|
||||
do
|
||||
{
|
||||
|
10
gf2n.cpp
10
gf2n.cpp
@ -89,14 +89,14 @@ void PolynomialMod2::SetByte(size_t n, byte value)
|
||||
reg[n/WORD_SIZE] |= (word(value) << 8*(n%WORD_SIZE));
|
||||
}
|
||||
|
||||
PolynomialMod2 PolynomialMod2::Monomial(size_t i)
|
||||
PolynomialMod2 PolynomialMod2::Monomial(size_t i)
|
||||
{
|
||||
PolynomialMod2 r((word)0, i+1);
|
||||
r.SetBit(i);
|
||||
PolynomialMod2 r((word)0, i+1);
|
||||
r.SetBit(i);
|
||||
return r;
|
||||
}
|
||||
|
||||
PolynomialMod2 PolynomialMod2::Trinomial(size_t t0, size_t t1, size_t t2)
|
||||
PolynomialMod2 PolynomialMod2::Trinomial(size_t t0, size_t t1, size_t t2)
|
||||
{
|
||||
PolynomialMod2 r((word)0, t0+1);
|
||||
r.SetBit(t0);
|
||||
@ -547,7 +547,7 @@ bool PolynomialMod2::IsIrreducible() const
|
||||
// ********************************************************
|
||||
|
||||
GF2NP::GF2NP(const PolynomialMod2 &modulus)
|
||||
: QuotientRing<EuclideanDomainOf<PolynomialMod2> >(EuclideanDomainOf<PolynomialMod2>(), modulus), m(modulus.Degree())
|
||||
: QuotientRing<EuclideanDomainOf<PolynomialMod2> >(EuclideanDomainOf<PolynomialMod2>(), modulus), m(modulus.Degree())
|
||||
{
|
||||
}
|
||||
|
||||
|
2
gf2n.h
2
gf2n.h
@ -87,7 +87,7 @@ public:
|
||||
|
||||
//!
|
||||
void Decode(const byte *input, size_t inputLen);
|
||||
//!
|
||||
//!
|
||||
//* Precondition: bt.MaxRetrievable() >= inputLen
|
||||
void Decode(BufferedTransformation &bt, size_t inputLen);
|
||||
|
||||
|
@ -75,7 +75,7 @@ bool DL_GroupParameters_DSA::ValidateGroup(RandomNumberGenerator &rng, unsigned
|
||||
return pass;
|
||||
}
|
||||
|
||||
void DL_SignatureMessageEncodingMethod_DSA::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void DL_SignatureMessageEncodingMethod_DSA::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const
|
||||
@ -100,7 +100,7 @@ void DL_SignatureMessageEncodingMethod_DSA::ComputeMessageRepresentative(RandomN
|
||||
}
|
||||
}
|
||||
|
||||
void DL_SignatureMessageEncodingMethod_NR::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void DL_SignatureMessageEncodingMethod_NR::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const
|
||||
@ -179,7 +179,7 @@ bool DL_GroupParameters_IntegerBased::ValidateElement(unsigned int level, const
|
||||
void DL_GroupParameters_IntegerBased::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
|
||||
{
|
||||
Integer p, q, g;
|
||||
|
||||
|
||||
if (alg.GetValue("Modulus", p) && alg.GetValue("SubgroupGenerator", g))
|
||||
{
|
||||
q = alg.GetValueWithDefault("SubgroupOrder", ComputeGroupOrder(p)/2);
|
||||
@ -208,7 +208,7 @@ void DL_GroupParameters_IntegerBased::GenerateRandom(RandomNumberGenerator &rng,
|
||||
void DL_GroupParameters_IntegerBased::EncodeElement(bool reversible, const Element &element, byte *encoded) const
|
||||
{
|
||||
CRYPTOPP_UNUSED(reversible);
|
||||
element.Encode(encoded, GetModulus().ByteCount());
|
||||
element.Encode(encoded, GetModulus().ByteCount());
|
||||
}
|
||||
|
||||
unsigned int DL_GroupParameters_IntegerBased::GetEncodedElementSize(bool reversible) const
|
||||
|
52
gfpcrypt.h
52
gfpcrypt.h
@ -31,7 +31,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters<Integer>;
|
||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBased : public ASN1CryptoMaterial<DL_GroupParameters<Integer> >
|
||||
{
|
||||
typedef DL_GroupParameters_IntegerBased ThisClass;
|
||||
|
||||
|
||||
public:
|
||||
void Initialize(const DL_GroupParameters_IntegerBased ¶ms)
|
||||
{Initialize(params.GetModulus(), params.GetSubgroupOrder(), params.GetSubgroupGenerator());}
|
||||
@ -51,7 +51,7 @@ public:
|
||||
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg);
|
||||
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const;
|
||||
void AssignFrom(const NameValuePairs &source);
|
||||
|
||||
|
||||
// DL_GroupParameters
|
||||
const Integer & GetSubgroupOrder() const {return m_q;}
|
||||
Integer GetGroupOrder() const {return GetFieldType() == 1 ? GetModulus()-Integer::One() : GetModulus()+Integer::One();}
|
||||
@ -83,7 +83,7 @@ public:
|
||||
|
||||
void SetSubgroupOrder(const Integer &q)
|
||||
{m_q = q; ParametersChanged();}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_GroupParameters_IntegerBased() {}
|
||||
#endif
|
||||
@ -132,7 +132,7 @@ public:
|
||||
{return GetModulus() == rhs.GetModulus() && GetGenerator() == rhs.GetGenerator() && this->GetSubgroupOrder() == rhs.GetSubgroupOrder();}
|
||||
bool operator!=(const DL_GroupParameters_IntegerBasedImpl<GROUP_PRECOMP, BASE_PRECOMP> &rhs) const
|
||||
{return !operator==(rhs);}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_GroupParameters_IntegerBasedImpl() {}
|
||||
#endif
|
||||
@ -157,7 +157,7 @@ public:
|
||||
// used by MQV
|
||||
Element MultiplyElements(const Element &a, const Element &b) const;
|
||||
Element CascadeExponentiate(const Element &element1, const Integer &exponent1, const Element &element2, const Integer &exponent2) const;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_GroupParameters_GFP() {}
|
||||
#endif
|
||||
@ -171,7 +171,7 @@ class CRYPTOPP_DLL DL_GroupParameters_GFP_DefaultSafePrime : public DL_GroupPara
|
||||
{
|
||||
public:
|
||||
typedef NoCofactorMultiplication DefaultCofactorOption;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_GroupParameters_GFP_DefaultSafePrime() {}
|
||||
#endif
|
||||
@ -240,7 +240,7 @@ public:
|
||||
// check r == (m_g^s * m_y^r + m) mod m_q
|
||||
return r == (params.ConvertElementToInteger(publicKey.CascadeExponentiateBaseAndPublicElement(s, r)) + e) % q;
|
||||
}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_Algorithm_NR() {}
|
||||
#endif
|
||||
@ -264,7 +264,7 @@ public:
|
||||
{this->SetPublicElement(Integer(bt));}
|
||||
void DEREncodePublicKey(BufferedTransformation &bt) const
|
||||
{this->GetPublicElement().DEREncode(bt);}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_PublicKey_GFP() {}
|
||||
#endif
|
||||
@ -287,7 +287,7 @@ public:
|
||||
{this->AccessGroupParameters().Initialize(p, g); this->SetPrivateExponent(x);}
|
||||
void Initialize(const Integer &p, const Integer &q, const Integer &g, const Integer &x)
|
||||
{this->AccessGroupParameters().Initialize(p, q, g); this->SetPrivateExponent(x);}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_PrivateKey_GFP() {}
|
||||
#endif
|
||||
@ -299,7 +299,7 @@ struct DL_SignatureKeys_GFP
|
||||
typedef DL_GroupParameters_GFP GroupParameters;
|
||||
typedef DL_PublicKey_GFP<GroupParameters> PublicKey;
|
||||
typedef DL_PrivateKey_GFP<GroupParameters> PrivateKey;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_SignatureKeys_GFP() {}
|
||||
#endif
|
||||
@ -311,7 +311,7 @@ struct DL_CryptoKeys_GFP
|
||||
typedef DL_GroupParameters_GFP_DefaultSafePrime GroupParameters;
|
||||
typedef DL_PublicKey_GFP<GroupParameters> PublicKey;
|
||||
typedef DL_PrivateKey_GFP<GroupParameters> PrivateKey;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_CryptoKeys_GFP() {}
|
||||
#endif
|
||||
@ -354,7 +354,7 @@ public:
|
||||
this->GetPublicElement().DEREncode(seq);
|
||||
seq.MessageEnd();
|
||||
}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_PublicKey_GFP_OldFormat() {}
|
||||
#endif
|
||||
@ -399,7 +399,7 @@ public:
|
||||
this->GetPrivateExponent().DEREncode(seq);
|
||||
seq.MessageEnd();
|
||||
}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_PrivateKey_GFP_OldFormat() {}
|
||||
#endif
|
||||
@ -408,8 +408,8 @@ public:
|
||||
//! <a href="http://www.weidai.com/scan-mirror/sig.html#DSA-1363">DSA-1363</a>
|
||||
template <class H>
|
||||
struct GDSA : public DL_SS<
|
||||
DL_SignatureKeys_GFP,
|
||||
DL_Algorithm_GDSA<Integer>,
|
||||
DL_SignatureKeys_GFP,
|
||||
DL_Algorithm_GDSA<Integer>,
|
||||
DL_SignatureMessageEncodingMethod_DSA,
|
||||
H>
|
||||
{
|
||||
@ -421,8 +421,8 @@ struct GDSA : public DL_SS<
|
||||
//! <a href="http://www.weidai.com/scan-mirror/sig.html#NR">NR</a>
|
||||
template <class H>
|
||||
struct NR : public DL_SS<
|
||||
DL_SignatureKeys_GFP,
|
||||
DL_Algorithm_NR<Integer>,
|
||||
DL_SignatureKeys_GFP,
|
||||
DL_Algorithm_NR<Integer>,
|
||||
DL_SignatureMessageEncodingMethod_NR,
|
||||
H>
|
||||
{
|
||||
@ -445,7 +445,7 @@ public:
|
||||
{return pbits >= MIN_PRIME_LENGTH && pbits <= MAX_PRIME_LENGTH && pbits % PRIME_LENGTH_MULTIPLE == 0;}
|
||||
|
||||
enum {MIN_PRIME_LENGTH = 1024, MAX_PRIME_LENGTH = 3072, PRIME_LENGTH_MULTIPLE = 1024};
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_GroupParameters_DSA() {}
|
||||
#endif
|
||||
@ -459,7 +459,7 @@ struct DL_Keys_DSA
|
||||
{
|
||||
typedef DL_PublicKey_GFP<DL_GroupParameters_DSA> PublicKey;
|
||||
typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest<DL_PrivateKey_GFP<DL_GroupParameters_DSA>, DSA2<SHA> > PrivateKey;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_Keys_DSA() {}
|
||||
#endif
|
||||
@ -469,10 +469,10 @@ struct DL_Keys_DSA
|
||||
// class named DSA2 instead of DSA for backwards compatibility (DSA was a non-template class)
|
||||
template <class H>
|
||||
class DSA2 : public DL_SS<
|
||||
DL_Keys_DSA,
|
||||
DL_Algorithm_GDSA<Integer>,
|
||||
DL_Keys_DSA,
|
||||
DL_Algorithm_GDSA<Integer>,
|
||||
DL_SignatureMessageEncodingMethod_DSA,
|
||||
H,
|
||||
H,
|
||||
DSA2<H> >
|
||||
{
|
||||
public:
|
||||
@ -573,7 +573,7 @@ public:
|
||||
|
||||
return DecodingResult(plaintextLength);
|
||||
}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_EncryptionAlgorithm_Xor() {}
|
||||
#endif
|
||||
@ -604,7 +604,7 @@ public:
|
||||
parameters.GetValue(Name::KeyDerivationParameters(), derivationParameters);
|
||||
KDF::DeriveKey(derivedKey, derivedLength, agreedSecret, agreedSecret.size(), derivationParameters.begin(), derivationParameters.size());
|
||||
}
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_KeyDerivationAlgorithm_P1363() {}
|
||||
#endif
|
||||
@ -621,14 +621,14 @@ struct DLIES
|
||||
DLIES<> >
|
||||
{
|
||||
static std::string CRYPTOPP_API StaticAlgorithmName() {return "DLIES";} // TODO: fix this after name is standardized
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DLIES() {}
|
||||
#endif
|
||||
};
|
||||
|
||||
NAMESPACE_END
|
||||
|
||||
|
||||
#if CRYPTOPP_MSC_VERSION
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
@ -144,7 +144,7 @@ GetCurrentThreadNotImplemented:
|
||||
if (!QueryPerformanceCounter(&now))
|
||||
{
|
||||
const DWORD lastError = GetLastError();
|
||||
throw Exception(Exception::OTHER_ERROR, "ThreadUserTimer: QueryPerformanceCounter failed with error " + IntToString(lastError));
|
||||
throw Exception(Exception::OTHER_ERROR, "ThreadUserTimer: QueryPerformanceCounter failed with error " + IntToString(lastError));
|
||||
}
|
||||
return now.QuadPart;
|
||||
#elif defined(CRYPTOPP_UNIX_AVAILABLE)
|
||||
|
2
ida.cpp
2
ida.cpp
@ -318,7 +318,7 @@ size_t InformationDispersal::Put2(const byte *begin, size_t length, int messageE
|
||||
{
|
||||
if (!blocking)
|
||||
throw BlockingInputOnly("InformationDispersal");
|
||||
|
||||
|
||||
while (length--)
|
||||
{
|
||||
m_ida.ChannelData(m_nextChannel, begin, 1, false);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
//! \file lubyrack.h
|
||||
//! \brief Classes for the Luby-Rackoff block cipher
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_LUBYRACK_H
|
||||
#define CRYPTOPP_LUBYRACK_H
|
||||
|
||||
|
256
marss.cpp
256
marss.cpp
@ -7,134 +7,134 @@
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
const word32 MARS::Base::Sbox[512] = {
|
||||
0x09d0c479, 0x28c8ffe0, 0x84aa6c39, 0x9dad7287,
|
||||
0x7dff9be3, 0xd4268361, 0xc96da1d4, 0x7974cc93,
|
||||
0x85d0582e, 0x2a4b5705, 0x1ca16a62, 0xc3bd279d,
|
||||
0x0f1f25e5, 0x5160372f, 0xc695c1fb, 0x4d7ff1e4,
|
||||
0xae5f6bf4, 0x0d72ee46, 0xff23de8a, 0xb1cf8e83,
|
||||
0xf14902e2, 0x3e981e42, 0x8bf53eb6, 0x7f4bf8ac,
|
||||
0x83631f83, 0x25970205, 0x76afe784, 0x3a7931d4,
|
||||
0x4f846450, 0x5c64c3f6, 0x210a5f18, 0xc6986a26,
|
||||
0x28f4e826, 0x3a60a81c, 0xd340a664, 0x7ea820c4,
|
||||
0x526687c5, 0x7eddd12b, 0x32a11d1d, 0x9c9ef086,
|
||||
0x80f6e831, 0xab6f04ad, 0x56fb9b53, 0x8b2e095c,
|
||||
0xb68556ae, 0xd2250b0d, 0x294a7721, 0xe21fb253,
|
||||
0xae136749, 0xe82aae86, 0x93365104, 0x99404a66,
|
||||
0x78a784dc, 0xb69ba84b, 0x04046793, 0x23db5c1e,
|
||||
0x46cae1d6, 0x2fe28134, 0x5a223942, 0x1863cd5b,
|
||||
0xc190c6e3, 0x07dfb846, 0x6eb88816, 0x2d0dcc4a,
|
||||
0xa4ccae59, 0x3798670d, 0xcbfa9493, 0x4f481d45,
|
||||
0xeafc8ca8, 0xdb1129d6, 0xb0449e20, 0x0f5407fb,
|
||||
0x6167d9a8, 0xd1f45763, 0x4daa96c3, 0x3bec5958,
|
||||
0xababa014, 0xb6ccd201, 0x38d6279f, 0x02682215,
|
||||
0x8f376cd5, 0x092c237e, 0xbfc56593, 0x32889d2c,
|
||||
0x854b3e95, 0x05bb9b43, 0x7dcd5dcd, 0xa02e926c,
|
||||
0xfae527e5, 0x36a1c330, 0x3412e1ae, 0xf257f462,
|
||||
0x3c4f1d71, 0x30a2e809, 0x68e5f551, 0x9c61ba44,
|
||||
0x5ded0ab8, 0x75ce09c8, 0x9654f93e, 0x698c0cca,
|
||||
0x243cb3e4, 0x2b062b97, 0x0f3b8d9e, 0x00e050df,
|
||||
0xfc5d6166, 0xe35f9288, 0xc079550d, 0x0591aee8,
|
||||
0x8e531e74, 0x75fe3578, 0x2f6d829a, 0xf60b21ae,
|
||||
0x95e8eb8d, 0x6699486b, 0x901d7d9b, 0xfd6d6e31,
|
||||
0x1090acef, 0xe0670dd8, 0xdab2e692, 0xcd6d4365,
|
||||
0xe5393514, 0x3af345f0, 0x6241fc4d, 0x460da3a3,
|
||||
0x7bcf3729, 0x8bf1d1e0, 0x14aac070, 0x1587ed55,
|
||||
0x3afd7d3e, 0xd2f29e01, 0x29a9d1f6, 0xefb10c53,
|
||||
0xcf3b870f, 0xb414935c, 0x664465ed, 0x024acac7,
|
||||
0x59a744c1, 0x1d2936a7, 0xdc580aa6, 0xcf574ca8,
|
||||
0x040a7a10, 0x6cd81807, 0x8a98be4c, 0xaccea063,
|
||||
0xc33e92b5, 0xd1e0e03d, 0xb322517e, 0x2092bd13,
|
||||
0x386b2c4a, 0x52e8dd58, 0x58656dfb, 0x50820371,
|
||||
0x41811896, 0xe337ef7e, 0xd39fb119, 0xc97f0df6,
|
||||
0x68fea01b, 0xa150a6e5, 0x55258962, 0xeb6ff41b,
|
||||
0xd7c9cd7a, 0xa619cd9e, 0xbcf09576, 0x2672c073,
|
||||
0xf003fb3c, 0x4ab7a50b, 0x1484126a, 0x487ba9b1,
|
||||
0xa64fc9c6, 0xf6957d49, 0x38b06a75, 0xdd805fcd,
|
||||
0x63d094cf, 0xf51c999e, 0x1aa4d343, 0xb8495294,
|
||||
0xce9f8e99, 0xbffcd770, 0xc7c275cc, 0x378453a7,
|
||||
0x7b21be33, 0x397f41bd, 0x4e94d131, 0x92cc1f98,
|
||||
0x5915ea51, 0x99f861b7, 0xc9980a88, 0x1d74fd5f,
|
||||
0xb0a495f8, 0x614deed0, 0xb5778eea, 0x5941792d,
|
||||
0xfa90c1f8, 0x33f824b4, 0xc4965372, 0x3ff6d550,
|
||||
0x4ca5fec0, 0x8630e964, 0x5b3fbbd6, 0x7da26a48,
|
||||
0xb203231a, 0x04297514, 0x2d639306, 0x2eb13149,
|
||||
0x16a45272, 0x532459a0, 0x8e5f4872, 0xf966c7d9,
|
||||
0x07128dc0, 0x0d44db62, 0xafc8d52d, 0x06316131,
|
||||
0xd838e7ce, 0x1bc41d00, 0x3a2e8c0f, 0xea83837e,
|
||||
0xb984737d, 0x13ba4891, 0xc4f8b949, 0xa6d6acb3,
|
||||
0xa215cdce, 0x8359838b, 0x6bd1aa31, 0xf579dd52,
|
||||
0x21b93f93, 0xf5176781, 0x187dfdde, 0xe94aeb76,
|
||||
0x2b38fd54, 0x431de1da, 0xab394825, 0x9ad3048f,
|
||||
0xdfea32aa, 0x659473e3, 0x623f7863, 0xf3346c59,
|
||||
0xab3ab685, 0x3346a90b, 0x6b56443e, 0xc6de01f8,
|
||||
0x8d421fc0, 0x9b0ed10c, 0x88f1a1e9, 0x54c1f029,
|
||||
0x7dead57b, 0x8d7ba426, 0x4cf5178a, 0x551a7cca,
|
||||
0x1a9a5f08, 0xfcd651b9, 0x25605182, 0xe11fc6c3,
|
||||
0xb6fd9676, 0x337b3027, 0xb7c8eb14, 0x9e5fd030,
|
||||
0x6b57e354, 0xad913cf7, 0x7e16688d, 0x58872a69,
|
||||
0x2c2fc7df, 0xe389ccc6, 0x30738df1, 0x0824a734,
|
||||
0xe1797a8b, 0xa4a8d57b, 0x5b5d193b, 0xc8a8309b,
|
||||
0x73f9a978, 0x73398d32, 0x0f59573e, 0xe9df2b03,
|
||||
0xe8a5b6c8, 0x848d0704, 0x98df93c2, 0x720a1dc3,
|
||||
0x684f259a, 0x943ba848, 0xa6370152, 0x863b5ea3,
|
||||
0xd17b978b, 0x6d9b58ef, 0x0a700dd4, 0xa73d36bf,
|
||||
0x8e6a0829, 0x8695bc14, 0xe35b3447, 0x933ac568,
|
||||
0x8894b022, 0x2f511c27, 0xddfbcc3c, 0x006662b6,
|
||||
0x117c83fe, 0x4e12b414, 0xc2bca766, 0x3a2fec10,
|
||||
0xf4562420, 0x55792e2a, 0x46f5d857, 0xceda25ce,
|
||||
0xc3601d3b, 0x6c00ab46, 0xefac9c28, 0xb3c35047,
|
||||
0x611dfee3, 0x257c3207, 0xfdd58482, 0x3b14d84f,
|
||||
0x23becb64, 0xa075f3a3, 0x088f8ead, 0x07adf158,
|
||||
0x7796943c, 0xfacabf3d, 0xc09730cd, 0xf7679969,
|
||||
0xda44e9ed, 0x2c854c12, 0x35935fa3, 0x2f057d9f,
|
||||
0x690624f8, 0x1cb0bafd, 0x7b0dbdc6, 0x810f23bb,
|
||||
0xfa929a1a, 0x6d969a17, 0x6742979b, 0x74ac7d05,
|
||||
0x010e65c4, 0x86a3d963, 0xf907b5a0, 0xd0042bd3,
|
||||
0x158d7d03, 0x287a8255, 0xbba8366f, 0x096edc33,
|
||||
0x21916a7b, 0x77b56b86, 0x951622f9, 0xa6c5e650,
|
||||
0x8cea17d1, 0xcd8c62bc, 0xa3d63433, 0x358a68fd,
|
||||
0x0f9b9d3c, 0xd6aa295b, 0xfe33384a, 0xc000738e,
|
||||
0xcd67eb2f, 0xe2eb6dc2, 0x97338b02, 0x06c9f246,
|
||||
0x419cf1ad, 0x2b83c045, 0x3723f18a, 0xcb5b3089,
|
||||
0x160bead7, 0x5d494656, 0x35f8a74b, 0x1e4e6c9e,
|
||||
0x000399bd, 0x67466880, 0xb4174831, 0xacf423b2,
|
||||
0xca815ab3, 0x5a6395e7, 0x302a67c5, 0x8bdb446b,
|
||||
0x108f8fa4, 0x10223eda, 0x92b8b48b, 0x7f38d0ee,
|
||||
0xab2701d4, 0x0262d415, 0xaf224a30, 0xb3d88aba,
|
||||
0xf8b2c3af, 0xdaf7ef70, 0xcc97d3b7, 0xe9614b6c,
|
||||
0x2baebff4, 0x70f687cf, 0x386c9156, 0xce092ee5,
|
||||
0x01e87da6, 0x6ce91e6a, 0xbb7bcc84, 0xc7922c20,
|
||||
0x9d3b71fd, 0x060e41c6, 0xd7590f15, 0x4e03bb47,
|
||||
0x183c198e, 0x63eeb240, 0x2ddbf49a, 0x6d5cba54,
|
||||
0x923750af, 0xf9e14236, 0x7838162b, 0x59726c72,
|
||||
0x81b66760, 0xbb2926c1, 0x48a0ce0d, 0xa6c0496d,
|
||||
0xad43507b, 0x718d496a, 0x9df057af, 0x44b1bde6,
|
||||
0x054356dc, 0xde7ced35, 0xd51a138b, 0x62088cc9,
|
||||
0x35830311, 0xc96efca2, 0x686f86ec, 0x8e77cb68,
|
||||
0x63e1d6b8, 0xc80f9778, 0x79c491fd, 0x1b4c67f2,
|
||||
0x72698d7d, 0x5e368c31, 0xf7d95e2e, 0xa1d3493f,
|
||||
0xdcd9433e, 0x896f1552, 0x4bc4ca7a, 0xa6d1baf4,
|
||||
0xa5a96dcc, 0x0bef8b46, 0xa169fda7, 0x74df40b7,
|
||||
0x4e208804, 0x9a756607, 0x038e87c8, 0x20211e44,
|
||||
0x8b7ad4bf, 0xc6403f35, 0x1848e36d, 0x80bdb038,
|
||||
0x1e62891c, 0x643d2107, 0xbf04d6f8, 0x21092c8c,
|
||||
0xf644f389, 0x0778404e, 0x7b78adb8, 0xa2c52d53,
|
||||
0x42157abe, 0xa2253e2e, 0x7bf3f4ae, 0x80f594f9,
|
||||
0x953194e7, 0x77eb92ed, 0xb3816930, 0xda8d9336,
|
||||
0xbf447469, 0xf26d9483, 0xee6faed5, 0x71371235,
|
||||
0xde425f73, 0xb4e59f43, 0x7dbe2d4e, 0x2d37b185,
|
||||
0x49dc9a63, 0x98c39d98, 0x1301c9a2, 0x389b1bbf,
|
||||
0x0c18588d, 0xa421c1ba, 0x7aa3865c, 0x71e08558,
|
||||
0x3c5cfcaa, 0x7d239ca4, 0x0297d9dd, 0xd7dc2830,
|
||||
0x4b37802b, 0x7428ab54, 0xaeee0347, 0x4b3fbb85,
|
||||
0x692f2f08, 0x134e578e, 0x36d9e0bf, 0xae8b5fcf,
|
||||
0xedb93ecf, 0x2b27248e, 0x170eb1ef, 0x7dc57fd6,
|
||||
0x1e760f16, 0xb1136601, 0x864e1b9b, 0xd7ea7319,
|
||||
0x3ab871bd, 0xcfa4d76f, 0xe31bd782, 0x0dbeb469,
|
||||
0xabb96061, 0x5370f85d, 0xffb07e37, 0xda30d0fb,
|
||||
0xebc977b6, 0x0b98b40f, 0x3a4d0fe6, 0xdf4fc26b,
|
||||
0x159cf22a, 0xc298d6e2, 0x2b78ef6a, 0x61a94ac0,
|
||||
0xab561187, 0x14eea0f0, 0xdf0d4164, 0x19af70ee
|
||||
0x09d0c479, 0x28c8ffe0, 0x84aa6c39, 0x9dad7287,
|
||||
0x7dff9be3, 0xd4268361, 0xc96da1d4, 0x7974cc93,
|
||||
0x85d0582e, 0x2a4b5705, 0x1ca16a62, 0xc3bd279d,
|
||||
0x0f1f25e5, 0x5160372f, 0xc695c1fb, 0x4d7ff1e4,
|
||||
0xae5f6bf4, 0x0d72ee46, 0xff23de8a, 0xb1cf8e83,
|
||||
0xf14902e2, 0x3e981e42, 0x8bf53eb6, 0x7f4bf8ac,
|
||||
0x83631f83, 0x25970205, 0x76afe784, 0x3a7931d4,
|
||||
0x4f846450, 0x5c64c3f6, 0x210a5f18, 0xc6986a26,
|
||||
0x28f4e826, 0x3a60a81c, 0xd340a664, 0x7ea820c4,
|
||||
0x526687c5, 0x7eddd12b, 0x32a11d1d, 0x9c9ef086,
|
||||
0x80f6e831, 0xab6f04ad, 0x56fb9b53, 0x8b2e095c,
|
||||
0xb68556ae, 0xd2250b0d, 0x294a7721, 0xe21fb253,
|
||||
0xae136749, 0xe82aae86, 0x93365104, 0x99404a66,
|
||||
0x78a784dc, 0xb69ba84b, 0x04046793, 0x23db5c1e,
|
||||
0x46cae1d6, 0x2fe28134, 0x5a223942, 0x1863cd5b,
|
||||
0xc190c6e3, 0x07dfb846, 0x6eb88816, 0x2d0dcc4a,
|
||||
0xa4ccae59, 0x3798670d, 0xcbfa9493, 0x4f481d45,
|
||||
0xeafc8ca8, 0xdb1129d6, 0xb0449e20, 0x0f5407fb,
|
||||
0x6167d9a8, 0xd1f45763, 0x4daa96c3, 0x3bec5958,
|
||||
0xababa014, 0xb6ccd201, 0x38d6279f, 0x02682215,
|
||||
0x8f376cd5, 0x092c237e, 0xbfc56593, 0x32889d2c,
|
||||
0x854b3e95, 0x05bb9b43, 0x7dcd5dcd, 0xa02e926c,
|
||||
0xfae527e5, 0x36a1c330, 0x3412e1ae, 0xf257f462,
|
||||
0x3c4f1d71, 0x30a2e809, 0x68e5f551, 0x9c61ba44,
|
||||
0x5ded0ab8, 0x75ce09c8, 0x9654f93e, 0x698c0cca,
|
||||
0x243cb3e4, 0x2b062b97, 0x0f3b8d9e, 0x00e050df,
|
||||
0xfc5d6166, 0xe35f9288, 0xc079550d, 0x0591aee8,
|
||||
0x8e531e74, 0x75fe3578, 0x2f6d829a, 0xf60b21ae,
|
||||
0x95e8eb8d, 0x6699486b, 0x901d7d9b, 0xfd6d6e31,
|
||||
0x1090acef, 0xe0670dd8, 0xdab2e692, 0xcd6d4365,
|
||||
0xe5393514, 0x3af345f0, 0x6241fc4d, 0x460da3a3,
|
||||
0x7bcf3729, 0x8bf1d1e0, 0x14aac070, 0x1587ed55,
|
||||
0x3afd7d3e, 0xd2f29e01, 0x29a9d1f6, 0xefb10c53,
|
||||
0xcf3b870f, 0xb414935c, 0x664465ed, 0x024acac7,
|
||||
0x59a744c1, 0x1d2936a7, 0xdc580aa6, 0xcf574ca8,
|
||||
0x040a7a10, 0x6cd81807, 0x8a98be4c, 0xaccea063,
|
||||
0xc33e92b5, 0xd1e0e03d, 0xb322517e, 0x2092bd13,
|
||||
0x386b2c4a, 0x52e8dd58, 0x58656dfb, 0x50820371,
|
||||
0x41811896, 0xe337ef7e, 0xd39fb119, 0xc97f0df6,
|
||||
0x68fea01b, 0xa150a6e5, 0x55258962, 0xeb6ff41b,
|
||||
0xd7c9cd7a, 0xa619cd9e, 0xbcf09576, 0x2672c073,
|
||||
0xf003fb3c, 0x4ab7a50b, 0x1484126a, 0x487ba9b1,
|
||||
0xa64fc9c6, 0xf6957d49, 0x38b06a75, 0xdd805fcd,
|
||||
0x63d094cf, 0xf51c999e, 0x1aa4d343, 0xb8495294,
|
||||
0xce9f8e99, 0xbffcd770, 0xc7c275cc, 0x378453a7,
|
||||
0x7b21be33, 0x397f41bd, 0x4e94d131, 0x92cc1f98,
|
||||
0x5915ea51, 0x99f861b7, 0xc9980a88, 0x1d74fd5f,
|
||||
0xb0a495f8, 0x614deed0, 0xb5778eea, 0x5941792d,
|
||||
0xfa90c1f8, 0x33f824b4, 0xc4965372, 0x3ff6d550,
|
||||
0x4ca5fec0, 0x8630e964, 0x5b3fbbd6, 0x7da26a48,
|
||||
0xb203231a, 0x04297514, 0x2d639306, 0x2eb13149,
|
||||
0x16a45272, 0x532459a0, 0x8e5f4872, 0xf966c7d9,
|
||||
0x07128dc0, 0x0d44db62, 0xafc8d52d, 0x06316131,
|
||||
0xd838e7ce, 0x1bc41d00, 0x3a2e8c0f, 0xea83837e,
|
||||
0xb984737d, 0x13ba4891, 0xc4f8b949, 0xa6d6acb3,
|
||||
0xa215cdce, 0x8359838b, 0x6bd1aa31, 0xf579dd52,
|
||||
0x21b93f93, 0xf5176781, 0x187dfdde, 0xe94aeb76,
|
||||
0x2b38fd54, 0x431de1da, 0xab394825, 0x9ad3048f,
|
||||
0xdfea32aa, 0x659473e3, 0x623f7863, 0xf3346c59,
|
||||
0xab3ab685, 0x3346a90b, 0x6b56443e, 0xc6de01f8,
|
||||
0x8d421fc0, 0x9b0ed10c, 0x88f1a1e9, 0x54c1f029,
|
||||
0x7dead57b, 0x8d7ba426, 0x4cf5178a, 0x551a7cca,
|
||||
0x1a9a5f08, 0xfcd651b9, 0x25605182, 0xe11fc6c3,
|
||||
0xb6fd9676, 0x337b3027, 0xb7c8eb14, 0x9e5fd030,
|
||||
0x6b57e354, 0xad913cf7, 0x7e16688d, 0x58872a69,
|
||||
0x2c2fc7df, 0xe389ccc6, 0x30738df1, 0x0824a734,
|
||||
0xe1797a8b, 0xa4a8d57b, 0x5b5d193b, 0xc8a8309b,
|
||||
0x73f9a978, 0x73398d32, 0x0f59573e, 0xe9df2b03,
|
||||
0xe8a5b6c8, 0x848d0704, 0x98df93c2, 0x720a1dc3,
|
||||
0x684f259a, 0x943ba848, 0xa6370152, 0x863b5ea3,
|
||||
0xd17b978b, 0x6d9b58ef, 0x0a700dd4, 0xa73d36bf,
|
||||
0x8e6a0829, 0x8695bc14, 0xe35b3447, 0x933ac568,
|
||||
0x8894b022, 0x2f511c27, 0xddfbcc3c, 0x006662b6,
|
||||
0x117c83fe, 0x4e12b414, 0xc2bca766, 0x3a2fec10,
|
||||
0xf4562420, 0x55792e2a, 0x46f5d857, 0xceda25ce,
|
||||
0xc3601d3b, 0x6c00ab46, 0xefac9c28, 0xb3c35047,
|
||||
0x611dfee3, 0x257c3207, 0xfdd58482, 0x3b14d84f,
|
||||
0x23becb64, 0xa075f3a3, 0x088f8ead, 0x07adf158,
|
||||
0x7796943c, 0xfacabf3d, 0xc09730cd, 0xf7679969,
|
||||
0xda44e9ed, 0x2c854c12, 0x35935fa3, 0x2f057d9f,
|
||||
0x690624f8, 0x1cb0bafd, 0x7b0dbdc6, 0x810f23bb,
|
||||
0xfa929a1a, 0x6d969a17, 0x6742979b, 0x74ac7d05,
|
||||
0x010e65c4, 0x86a3d963, 0xf907b5a0, 0xd0042bd3,
|
||||
0x158d7d03, 0x287a8255, 0xbba8366f, 0x096edc33,
|
||||
0x21916a7b, 0x77b56b86, 0x951622f9, 0xa6c5e650,
|
||||
0x8cea17d1, 0xcd8c62bc, 0xa3d63433, 0x358a68fd,
|
||||
0x0f9b9d3c, 0xd6aa295b, 0xfe33384a, 0xc000738e,
|
||||
0xcd67eb2f, 0xe2eb6dc2, 0x97338b02, 0x06c9f246,
|
||||
0x419cf1ad, 0x2b83c045, 0x3723f18a, 0xcb5b3089,
|
||||
0x160bead7, 0x5d494656, 0x35f8a74b, 0x1e4e6c9e,
|
||||
0x000399bd, 0x67466880, 0xb4174831, 0xacf423b2,
|
||||
0xca815ab3, 0x5a6395e7, 0x302a67c5, 0x8bdb446b,
|
||||
0x108f8fa4, 0x10223eda, 0x92b8b48b, 0x7f38d0ee,
|
||||
0xab2701d4, 0x0262d415, 0xaf224a30, 0xb3d88aba,
|
||||
0xf8b2c3af, 0xdaf7ef70, 0xcc97d3b7, 0xe9614b6c,
|
||||
0x2baebff4, 0x70f687cf, 0x386c9156, 0xce092ee5,
|
||||
0x01e87da6, 0x6ce91e6a, 0xbb7bcc84, 0xc7922c20,
|
||||
0x9d3b71fd, 0x060e41c6, 0xd7590f15, 0x4e03bb47,
|
||||
0x183c198e, 0x63eeb240, 0x2ddbf49a, 0x6d5cba54,
|
||||
0x923750af, 0xf9e14236, 0x7838162b, 0x59726c72,
|
||||
0x81b66760, 0xbb2926c1, 0x48a0ce0d, 0xa6c0496d,
|
||||
0xad43507b, 0x718d496a, 0x9df057af, 0x44b1bde6,
|
||||
0x054356dc, 0xde7ced35, 0xd51a138b, 0x62088cc9,
|
||||
0x35830311, 0xc96efca2, 0x686f86ec, 0x8e77cb68,
|
||||
0x63e1d6b8, 0xc80f9778, 0x79c491fd, 0x1b4c67f2,
|
||||
0x72698d7d, 0x5e368c31, 0xf7d95e2e, 0xa1d3493f,
|
||||
0xdcd9433e, 0x896f1552, 0x4bc4ca7a, 0xa6d1baf4,
|
||||
0xa5a96dcc, 0x0bef8b46, 0xa169fda7, 0x74df40b7,
|
||||
0x4e208804, 0x9a756607, 0x038e87c8, 0x20211e44,
|
||||
0x8b7ad4bf, 0xc6403f35, 0x1848e36d, 0x80bdb038,
|
||||
0x1e62891c, 0x643d2107, 0xbf04d6f8, 0x21092c8c,
|
||||
0xf644f389, 0x0778404e, 0x7b78adb8, 0xa2c52d53,
|
||||
0x42157abe, 0xa2253e2e, 0x7bf3f4ae, 0x80f594f9,
|
||||
0x953194e7, 0x77eb92ed, 0xb3816930, 0xda8d9336,
|
||||
0xbf447469, 0xf26d9483, 0xee6faed5, 0x71371235,
|
||||
0xde425f73, 0xb4e59f43, 0x7dbe2d4e, 0x2d37b185,
|
||||
0x49dc9a63, 0x98c39d98, 0x1301c9a2, 0x389b1bbf,
|
||||
0x0c18588d, 0xa421c1ba, 0x7aa3865c, 0x71e08558,
|
||||
0x3c5cfcaa, 0x7d239ca4, 0x0297d9dd, 0xd7dc2830,
|
||||
0x4b37802b, 0x7428ab54, 0xaeee0347, 0x4b3fbb85,
|
||||
0x692f2f08, 0x134e578e, 0x36d9e0bf, 0xae8b5fcf,
|
||||
0xedb93ecf, 0x2b27248e, 0x170eb1ef, 0x7dc57fd6,
|
||||
0x1e760f16, 0xb1136601, 0x864e1b9b, 0xd7ea7319,
|
||||
0x3ab871bd, 0xcfa4d76f, 0xe31bd782, 0x0dbeb469,
|
||||
0xabb96061, 0x5370f85d, 0xffb07e37, 0xda30d0fb,
|
||||
0xebc977b6, 0x0b98b40f, 0x3a4d0fe6, 0xdf4fc26b,
|
||||
0x159cf22a, 0xc298d6e2, 0x2b78ef6a, 0x61a94ac0,
|
||||
0xab561187, 0x14eea0f0, 0xdf0d4164, 0x19af70ee
|
||||
};
|
||||
|
||||
NAMESPACE_END
|
||||
|
14
md2.cpp
14
md2.cpp
@ -8,8 +8,8 @@
|
||||
*
|
||||
* Part of the Python Cryptography Toolkit, version 1.1
|
||||
*
|
||||
* Distribute and use freely; there are no restrictions on further
|
||||
* dissemination and usage except those imposed by the laws of your
|
||||
* Distribute and use freely; there are no restrictions on further
|
||||
* dissemination and usage except those imposed by the laws of your
|
||||
* country of residence.
|
||||
*
|
||||
*/
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
namespace Weak1 {
|
||||
|
||||
|
||||
MD2::MD2()
|
||||
: m_X(48), m_C(16), m_buf(16)
|
||||
{
|
||||
@ -58,18 +58,18 @@ void MD2::Update(const byte *buf, size_t len)
|
||||
31, 26, 219, 153, 141, 51, 159, 17, 131, 20
|
||||
};
|
||||
|
||||
while (len)
|
||||
while (len)
|
||||
{
|
||||
unsigned int L = UnsignedMin(16U-m_count, len);
|
||||
memcpy(m_buf+m_count, buf, L);
|
||||
m_count+=L;
|
||||
buf+=L;
|
||||
len-=L;
|
||||
if (m_count==16)
|
||||
if (m_count==16)
|
||||
{
|
||||
byte t;
|
||||
int i,j;
|
||||
|
||||
|
||||
m_count=0;
|
||||
memcpy(m_X+16, m_buf, 16);
|
||||
t=m_C[15];
|
||||
@ -78,7 +78,7 @@ void MD2::Update(const byte *buf, size_t len)
|
||||
m_X[32+i]=m_X[16+i]^m_X[i];
|
||||
t=m_C[i]^=S[m_buf[i]^t];
|
||||
}
|
||||
|
||||
|
||||
t=0;
|
||||
for(i=0; i<18; i++)
|
||||
{
|
||||
|
14
md4.cpp
14
md4.cpp
@ -8,8 +8,8 @@
|
||||
*
|
||||
* Part of the Python Cryptography Toolkit, version 1.1
|
||||
*
|
||||
* Distribute and use freely; there are no restrictions on further
|
||||
* dissemination and usage except those imposed by the laws of your
|
||||
* Distribute and use freely; there are no restrictions on further
|
||||
* dissemination and usage except those imposed by the laws of your
|
||||
* country of residence.
|
||||
*
|
||||
*/
|
||||
@ -44,7 +44,7 @@ void MD4::Transform (word32 *digest, const word32 *in)
|
||||
C=digest[2];
|
||||
D=digest[3];
|
||||
|
||||
#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+in[k],s);
|
||||
#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+in[k],s);
|
||||
function(A,B,C,D, 0, 3);
|
||||
function(D,A,B,C, 1, 7);
|
||||
function(C,D,A,B, 2,11);
|
||||
@ -62,8 +62,8 @@ void MD4::Transform (word32 *digest, const word32 *in)
|
||||
function(C,D,A,B,14,11);
|
||||
function(B,C,D,A,15,19);
|
||||
|
||||
#undef function
|
||||
#define function(a,b,c,d,k,s) a=rotlFixed(a+G(b,c,d)+in[k]+0x5a827999,s);
|
||||
#undef function
|
||||
#define function(a,b,c,d,k,s) a=rotlFixed(a+G(b,c,d)+in[k]+0x5a827999,s);
|
||||
function(A,B,C,D, 0, 3);
|
||||
function(D,A,B,C, 4, 5);
|
||||
function(C,D,A,B, 8, 9);
|
||||
@ -81,8 +81,8 @@ void MD4::Transform (word32 *digest, const word32 *in)
|
||||
function(C,D,A,B,11, 9);
|
||||
function(B,C,D,A,15,13);
|
||||
|
||||
#undef function
|
||||
#define function(a,b,c,d,k,s) a=rotlFixed(a+H(b,c,d)+in[k]+0x6ed9eba1,s);
|
||||
#undef function
|
||||
#define function(a,b,c,d,k,s) a=rotlFixed(a+H(b,c,d)+in[k]+0x6ed9eba1,s);
|
||||
function(A,B,C,D, 0, 3);
|
||||
function(D,A,B,C, 8, 9);
|
||||
function(C,D,A,B, 4,11);
|
||||
|
@ -241,8 +241,8 @@ public:
|
||||
// left RandomizationParameter arg as ref in case RandomizationParameter becomes a more complicated struct
|
||||
{
|
||||
CRYPTOPP_UNUSED(ignore_for_now);
|
||||
return Element(rng, Integer::Zero(), m_modulus - Integer::One()) ;
|
||||
}
|
||||
return Element(rng, Integer::Zero(), m_modulus - Integer::One()) ;
|
||||
}
|
||||
|
||||
//! \brief Compares two ModularArithmetic for equality
|
||||
//! \param rhs other ModularArithmetic
|
||||
|
12
nbtheory.cpp
12
nbtheory.cpp
@ -34,7 +34,7 @@ struct NewPrimeTable
|
||||
|
||||
primeTable.push_back(2);
|
||||
unsigned int testEntriesEnd = 1;
|
||||
|
||||
|
||||
for (unsigned int p=3; p<=s_lastSmallPrime; p+=2)
|
||||
{
|
||||
unsigned int j;
|
||||
@ -175,7 +175,7 @@ bool IsLucasProbablePrime(const Integer &n)
|
||||
++b; ++b;
|
||||
}
|
||||
|
||||
if (j==0)
|
||||
if (j==0)
|
||||
return false;
|
||||
else
|
||||
return Lucas(n+1, b, n)==2;
|
||||
@ -202,7 +202,7 @@ bool IsStrongLucasProbablePrime(const Integer &n)
|
||||
++b; ++b;
|
||||
}
|
||||
|
||||
if (j==0)
|
||||
if (j==0)
|
||||
return false;
|
||||
|
||||
Integer n1 = n+1;
|
||||
@ -460,10 +460,10 @@ static bool ProvePrime(const Integer &p, const Integer &q)
|
||||
const word16 * primeTable = GetPrimeTable(primeTableSize);
|
||||
|
||||
assert(primeTableSize >= 50);
|
||||
for (int i=0; i<50; i++)
|
||||
for (int i=0; i<50; i++)
|
||||
{
|
||||
Integer b = a_exp_b_mod_c(primeTable[i], r, p);
|
||||
if (b != 1)
|
||||
if (b != 1)
|
||||
return a_exp_b_mod_c(b, q, p) == 1;
|
||||
}
|
||||
return false;
|
||||
@ -1076,7 +1076,7 @@ void PrimeAndGenerator::Generate(signed int delta, RandomNumberGenerator &rng, u
|
||||
else
|
||||
{
|
||||
assert(delta == -1);
|
||||
// find g such that g*g-4 is a quadratic non-residue,
|
||||
// find g such that g*g-4 is a quadratic non-residue,
|
||||
// and such that g has order q
|
||||
for (g=3; ; ++g)
|
||||
if (Jacobi(g*g-4, p)==-1 && Lucas(q, g, p)==2)
|
||||
|
@ -38,7 +38,7 @@ CRYPTOPP_DLL Integer CRYPTOPP_API MihailescuProvablePrime(RandomNumberGenerator
|
||||
//! in the table.
|
||||
CRYPTOPP_DLL bool CRYPTOPP_API IsSmallPrime(const Integer &p);
|
||||
|
||||
//!
|
||||
//!
|
||||
//! \returns true if p is divisible by some prime less than bound.
|
||||
//! \details TrialDivision() true if p is divisible by some prime less than bound. bound not be
|
||||
//! greater than the largest entry in the prime table, which is 32719.
|
||||
@ -54,7 +54,7 @@ CRYPTOPP_DLL bool CRYPTOPP_API IsLucasProbablePrime(const Integer &n);
|
||||
CRYPTOPP_DLL bool CRYPTOPP_API IsStrongProbablePrime(const Integer &n, const Integer &b);
|
||||
CRYPTOPP_DLL bool CRYPTOPP_API IsStrongLucasProbablePrime(const Integer &n);
|
||||
|
||||
// Rabin-Miller primality test, i.e. repeating the strong probable prime test
|
||||
// Rabin-Miller primality test, i.e. repeating the strong probable prime test
|
||||
// for several rounds with random bases
|
||||
CRYPTOPP_DLL bool CRYPTOPP_API RabinMillerTest(RandomNumberGenerator &rng, const Integer &w, unsigned int rounds);
|
||||
|
||||
@ -157,7 +157,7 @@ public:
|
||||
// Precondition: qbits > 4 && pbits > qbits
|
||||
PrimeAndGenerator(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits)
|
||||
{Generate(delta, rng, pbits, qbits);}
|
||||
|
||||
|
||||
void Generate(signed int delta, RandomNumberGenerator &rng, unsigned int pbits, unsigned qbits);
|
||||
|
||||
const Integer& Prime() const {return p;}
|
||||
|
10
network.cpp
10
network.cpp
@ -182,7 +182,7 @@ lword NonblockingSink::TimedFlush(unsigned long maxTime, size_t targetSize)
|
||||
timer.StartTimer();
|
||||
|
||||
while (true)
|
||||
{
|
||||
{
|
||||
size_t flushSize = UnsignedMin(curBufSize - targetSize, ComputeCurrentTransceiveLimit());
|
||||
if (flushSize || EofPending())
|
||||
{
|
||||
@ -250,7 +250,7 @@ void NetworkSource::GetWaitObjects(WaitObjectContainer &container, CallStack con
|
||||
else if (!m_outputBlocked)
|
||||
{
|
||||
if (m_dataBegin == m_dataEnd)
|
||||
AccessReceiver().GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - no data", &callStack));
|
||||
AccessReceiver().GetWaitObjects(container, CallStack("NetworkSource::GetWaitObjects() - no data", &callStack));
|
||||
else
|
||||
container.SetNoWait(CallStack("NetworkSource::GetWaitObjects() - have data", &callStack));
|
||||
}
|
||||
@ -377,7 +377,7 @@ DoOutput:
|
||||
NetworkSink::NetworkSink(unsigned int maxBufferSize, unsigned int autoFlushBound)
|
||||
: m_maxBufferSize(maxBufferSize), m_autoFlushBound(autoFlushBound)
|
||||
, m_needSendResult(false), m_wasBlocked(false), m_eofState(EOF_NONE)
|
||||
, m_buffer(STDMIN(16U*1024U+256, maxBufferSize)), m_skipBytes(0)
|
||||
, m_buffer(STDMIN(16U*1024U+256, maxBufferSize)), m_skipBytes(0)
|
||||
, m_speedTimer(Timer::MILLISECONDS), m_byteCountSinceLastTimerReset(0)
|
||||
, m_currentSpeed(0), m_maxObservedSpeed(0)
|
||||
{
|
||||
@ -487,7 +487,7 @@ lword NetworkSink::DoFlush(unsigned long maxTime, size_t targetSize)
|
||||
{
|
||||
if (m_buffer.CurrentSize() <= targetSize)
|
||||
break;
|
||||
|
||||
|
||||
if (m_needSendResult)
|
||||
{
|
||||
if (sender.MustWaitForResult() &&
|
||||
@ -526,7 +526,7 @@ lword NetworkSink::DoFlush(unsigned long maxTime, size_t targetSize)
|
||||
|
||||
m_byteCountSinceLastTimerReset += totalFlushSize;
|
||||
ComputeCurrentSpeed();
|
||||
|
||||
|
||||
if (m_buffer.IsEmpty() && !m_needSendResult)
|
||||
{
|
||||
if (m_eofState == EOF_PENDING_SEND)
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
unsigned int GetMaxWaitObjectCount() const { return 0; }
|
||||
void GetWaitObjects(WaitObjectContainer &container, const CallStack &callStack);
|
||||
|
||||
private:
|
||||
private:
|
||||
lword m_maxBytesPerSecond;
|
||||
|
||||
typedef std::deque<std::pair<double, lword> > OpQueue;
|
||||
|
4
oids.h
4
oids.h
@ -51,11 +51,11 @@ DEFINE_OID(1, iso)
|
||||
DEFINE_OID(ellipticCurve()+1,id_curve25519)
|
||||
DEFINE_OID(ellipticCurve()+2,id_curve448)
|
||||
DEFINE_OID(ellipticCurve()+3,id_curve25519ph)
|
||||
DEFINE_OID(ellipticCurve()+4,id_curve448ph)
|
||||
DEFINE_OID(ellipticCurve()+4,id_curve448ph)
|
||||
DEFINE_OID(identified_organization()+14, oiw);
|
||||
DEFINE_OID(oiw()+3, oiw_secsig);
|
||||
DEFINE_OID(oiw_secsig()+2, oiw_secsig_algorithms);
|
||||
DEFINE_OID(oiw_secsig_algorithms()+26, id_sha1);
|
||||
DEFINE_OID(oiw_secsig_algorithms()+26, id_sha1);
|
||||
DEFINE_OID(identified_organization()+36, teletrust);
|
||||
DEFINE_OID(teletrust()+3, teletrust_algorithm)
|
||||
DEFINE_OID(teletrust_algorithm()+2+1, id_ripemd160)
|
||||
|
@ -58,7 +58,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
#if defined(NONBLOCKING_RNG_AVAILABLE) || defined(BLOCKING_RNG_AVAILABLE)
|
||||
OS_RNG_Err::OS_RNG_Err(const std::string &operation)
|
||||
: Exception(OTHER_ERROR, "OS_Rng: " + operation + " operation failed with error " +
|
||||
: Exception(OTHER_ERROR, "OS_Rng: " + operation + " operation failed with error " +
|
||||
#ifdef CRYPTOPP_WIN32_AVAILABLE
|
||||
"0x" + IntToString(GetLastError(), 16)
|
||||
#else
|
||||
|
6
osrng.h
6
osrng.h
@ -90,7 +90,7 @@ public:
|
||||
//! \brief Construct a NonblockingRng
|
||||
NonblockingRng();
|
||||
~NonblockingRng();
|
||||
|
||||
|
||||
//! \brief Generate random array of bytes
|
||||
//! \param output the byte buffer
|
||||
//! \param size the length of the buffer, in bytes
|
||||
@ -118,7 +118,7 @@ public:
|
||||
//! \brief Construct a BlockingRng
|
||||
BlockingRng();
|
||||
~BlockingRng();
|
||||
|
||||
|
||||
//! \brief Generate random array of bytes
|
||||
//! \param output the byte buffer
|
||||
//! \param size the length of the buffer, in bytes
|
||||
@ -158,7 +158,7 @@ public:
|
||||
//! The parameter is ignored if only one of these is available.
|
||||
explicit AutoSeededRandomPool(bool blocking = false, unsigned int seedSize = 32)
|
||||
{Reseed(blocking, seedSize);}
|
||||
|
||||
|
||||
//! \brief Reseed an AutoSeededRandomPool
|
||||
//! \param blocking controls seeding with BlockingRng or NonblockingRng
|
||||
//! \param seedSize the size of the seed, in bytes
|
||||
|
@ -89,7 +89,7 @@ DecodingResult PKCS_EncryptionPaddingScheme::Unpad(const byte *pkcsBlock, size_t
|
||||
|
||||
#ifndef CRYPTOPP_IMPORTS
|
||||
|
||||
void PKCS1v15_SignatureMessageEncodingMethod::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void PKCS1v15_SignatureMessageEncodingMethod::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const
|
||||
|
@ -83,7 +83,7 @@ unsigned int PolynomialOver<T>::CoefficientCount(const Ring &ring) const
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename PolynomialOver<T>::CoefficientType PolynomialOver<T>::GetCoefficient(unsigned int i, const Ring &ring) const
|
||||
typename PolynomialOver<T>::CoefficientType PolynomialOver<T>::GetCoefficient(unsigned int i, const Ring &ring) const
|
||||
{
|
||||
return (i < m_coefficients.size()) ? m_coefficients[i] : ring.Identity();
|
||||
}
|
||||
@ -394,13 +394,13 @@ std::ostream& PolynomialOver<T>::Output(std::ostream &out, const Ring &ring) con
|
||||
|
||||
if (pstr.str().size() <= nstr.str().size())
|
||||
{
|
||||
out << " + ";
|
||||
out << " + ";
|
||||
if (!i || !ring.Equal(m_coefficients[i], ring.MultiplicativeIdentity()))
|
||||
out << m_coefficients[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
out << " - ";
|
||||
out << " - ";
|
||||
if (!i || !ring.Equal(inverse, ring.MultiplicativeIdentity()))
|
||||
out << inverse;
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ public:
|
||||
//! \name ENUMS, EXCEPTIONS, and TYPEDEFS
|
||||
//@{
|
||||
//! division by zero exception
|
||||
class DivideByZero : public Exception
|
||||
class DivideByZero : public Exception
|
||||
{
|
||||
public:
|
||||
public:
|
||||
DivideByZero() : Exception(OTHER_ERROR, "PolynomialOver<T>: division by zero") {}
|
||||
};
|
||||
|
||||
|
6
pssr.cpp
6
pssr.cpp
@ -29,7 +29,7 @@ size_t PSSR_MEM_Base::MaxRecoverableLength(size_t representativeBitLength, size_
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool PSSR_MEM_Base::IsProbabilistic() const
|
||||
bool PSSR_MEM_Base::IsProbabilistic() const
|
||||
{
|
||||
return SaltLen(1) > 0;
|
||||
}
|
||||
@ -44,7 +44,7 @@ bool PSSR_MEM_Base::RecoverablePartFirst() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void PSSR_MEM_Base::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void PSSR_MEM_Base::ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const
|
||||
@ -152,7 +152,7 @@ DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative(
|
||||
|
||||
if (!AllowRecovery() && valid && recoverableMessageLength != 0)
|
||||
{throw NotImplemented("PSSR_MEM: message recovery disabled");}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
2
pssr.h
2
pssr.h
@ -36,7 +36,7 @@ public:
|
||||
bool IsProbabilistic() const;
|
||||
bool AllowNonrecoverablePart() const;
|
||||
bool RecoverablePartFirst() const;
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const;
|
||||
|
@ -62,7 +62,7 @@ void TF_SignerBase::InputRecoverableMessage(PK_MessageAccumulator &messageAccumu
|
||||
|
||||
ma.m_recoverableMessage.Assign(recoverableMessage, recoverableMessageLength);
|
||||
encoding.ProcessRecoverableMessage(
|
||||
ma.AccessHash(),
|
||||
ma.AccessHash(),
|
||||
recoverableMessage, recoverableMessageLength,
|
||||
NULL, 0, ma.m_semisignature);
|
||||
}
|
||||
@ -79,8 +79,8 @@ size_t TF_SignerBase::SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccum
|
||||
throw PK_SignatureScheme::KeyTooShort();
|
||||
|
||||
SecByteBlock representative(MessageRepresentativeLength());
|
||||
encoding.ComputeMessageRepresentative(rng,
|
||||
ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
encoding.ComputeMessageRepresentative(rng,
|
||||
ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
ma.AccessHash(), id, ma.m_empty,
|
||||
representative, MessageRepresentativeBitLength());
|
||||
ma.m_empty = true;
|
||||
|
94
pubkey.h
94
pubkey.h
@ -3,7 +3,7 @@
|
||||
//! \file pubkey.h
|
||||
//! \brief This file contains helper classes/functions for implementing public key algorithms.
|
||||
//! \details The class hierachies in this header file tend to look like this:
|
||||
//!
|
||||
//!
|
||||
//! <pre>
|
||||
//! x1
|
||||
//! +--+
|
||||
@ -18,7 +18,7 @@
|
||||
//! | |
|
||||
//! y3 z3
|
||||
//! </pre>
|
||||
//!
|
||||
//!
|
||||
//! <ul>
|
||||
//! <li>x1, y1, z1 are abstract interface classes defined in cryptlib.h
|
||||
//! <li>x2, y2, z2 are implementations of the interfaces using "abstract policies", which
|
||||
@ -27,7 +27,7 @@
|
||||
//! <li>x3, y3, z3 hold actual algorithms and implement those virtual functions.
|
||||
//! These classes have \p Impl suffixes.
|
||||
//! </ul>
|
||||
//!
|
||||
//!
|
||||
//! \details The \p TF_ prefix means an implementation using trapdoor functions on integers.
|
||||
//! \details The \p DL_ prefix means an implementation using group operations (in groups where discrete log is hard).
|
||||
|
||||
@ -111,7 +111,7 @@ public:
|
||||
//! cryptosystem. The \p RandomNumberGenerator may (or may not) be required.
|
||||
//! Derived classes must implement it.
|
||||
virtual Integer ApplyRandomizedFunction(RandomNumberGenerator &rng, const Integer &x) const =0;
|
||||
|
||||
|
||||
//! \brief Determines if the encryption algorithm is randomized
|
||||
//! \returns \p true if the encryption algorithm is randomized, \p false otherwise
|
||||
//! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used.
|
||||
@ -168,7 +168,7 @@ public:
|
||||
//! \details \p CalculateRandomizedInverse is a generalization of decryption using the private key
|
||||
//! The \p RandomNumberGenerator may (or may not) be required. Derived classes must implement it.
|
||||
virtual Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const =0;
|
||||
|
||||
|
||||
//! \brief Determines if the decryption algorithm is randomized
|
||||
//! \returns \p true if the decryption algorithm is randomized, \p false otherwise
|
||||
//! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used.
|
||||
@ -195,7 +195,7 @@ public:
|
||||
//! without the \p RandomNumberGenerator.
|
||||
Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
{return CalculateInverse(rng, x);}
|
||||
|
||||
|
||||
//! \brief Determines if the decryption algorithm is randomized
|
||||
//! \returns \p true if the decryption algorithm is randomized, \p false otherwise
|
||||
//! \details If \p IsRandomized() returns \p false, then \p NullRNG() can be used.
|
||||
@ -351,8 +351,8 @@ public:
|
||||
{CRYPTOPP_UNUSED(hash); CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength);}
|
||||
|
||||
// for signature
|
||||
virtual void ProcessRecoverableMessage(HashTransformation &hash,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
virtual void ProcessRecoverableMessage(HashTransformation &hash,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
const byte *presignature, size_t presignatureLength,
|
||||
SecByteBlock &semisignature) const
|
||||
{
|
||||
@ -362,7 +362,7 @@ public:
|
||||
assert(!"ProcessRecoverableMessage() not implemented");
|
||||
}
|
||||
|
||||
virtual void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
virtual void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const =0;
|
||||
@ -384,8 +384,8 @@ public:
|
||||
const byte *presignature, size_t presignatureLength,
|
||||
const byte *semisignature, size_t semisignatureLength,
|
||||
byte *recoveredMessage) const
|
||||
{CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(presignature); CRYPTOPP_UNUSED(presignatureLength);
|
||||
CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength); CRYPTOPP_UNUSED(recoveredMessage);
|
||||
{CRYPTOPP_UNUSED(hash);CRYPTOPP_UNUSED(hashIdentifier); CRYPTOPP_UNUSED(presignature); CRYPTOPP_UNUSED(presignatureLength);
|
||||
CRYPTOPP_UNUSED(semisignature); CRYPTOPP_UNUSED(semisignatureLength); CRYPTOPP_UNUSED(recoveredMessage);
|
||||
throw NotImplemented("PK_MessageEncodingMethod: this signature scheme does not support message recovery");}
|
||||
|
||||
// VC60 workaround
|
||||
@ -432,7 +432,7 @@ public:
|
||||
class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_DSA : public PK_DeterministicSignatureMessageEncodingMethod
|
||||
{
|
||||
public:
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const;
|
||||
@ -445,7 +445,7 @@ public:
|
||||
class CRYPTOPP_DLL DL_SignatureMessageEncodingMethod_NR : public PK_DeterministicSignatureMessageEncodingMethod
|
||||
{
|
||||
public:
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
|
||||
const byte *recoverableMessage, size_t recoverableMessageLength,
|
||||
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
|
||||
byte *representative, size_t representativeBitLength) const;
|
||||
@ -493,18 +493,18 @@ public:
|
||||
virtual ~TF_SignatureSchemeBase() { }
|
||||
#endif
|
||||
|
||||
size_t SignatureLength() const
|
||||
size_t SignatureLength() const
|
||||
{return this->GetTrapdoorFunctionBounds().MaxPreimage().ByteCount();}
|
||||
size_t MaxRecoverableLength() const
|
||||
size_t MaxRecoverableLength() const
|
||||
{return this->GetMessageEncodingInterface().MaxRecoverableLength(MessageRepresentativeBitLength(), GetHashIdentifier().second, GetDigestSize());}
|
||||
size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const
|
||||
{CRYPTOPP_UNUSED(signatureLength); return this->MaxRecoverableLength();}
|
||||
|
||||
bool IsProbabilistic() const
|
||||
bool IsProbabilistic() const
|
||||
{return this->GetTrapdoorFunctionInterface().IsRandomized() || this->GetMessageEncodingInterface().IsProbabilistic();}
|
||||
bool AllowNonrecoverablePart() const
|
||||
bool AllowNonrecoverablePart() const
|
||||
{return this->GetMessageEncodingInterface().AllowNonrecoverablePart();}
|
||||
bool RecoverablePartFirst() const
|
||||
bool RecoverablePartFirst() const
|
||||
{return this->GetMessageEncodingInterface().RecoverablePartFirst();}
|
||||
|
||||
protected:
|
||||
@ -594,11 +594,11 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename BASE::MessageEncodingInterface & GetMessageEncodingInterface() const
|
||||
const typename BASE::MessageEncodingInterface & GetMessageEncodingInterface() const
|
||||
{return Singleton<CPP_TYPENAME SCHEME_OPTIONS::MessageEncodingMethod>().Ref();}
|
||||
const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const
|
||||
const TrapdoorFunctionBounds & GetTrapdoorFunctionBounds() const
|
||||
{return GetKey();}
|
||||
const typename BASE::TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const
|
||||
const typename BASE::TrapdoorFunctionInterface & GetTrapdoorFunctionInterface() const
|
||||
{return GetKey();}
|
||||
|
||||
// for signature scheme
|
||||
@ -752,7 +752,7 @@ template <class T>
|
||||
class CRYPTOPP_NO_VTABLE DL_GroupParameters : public CryptoParameters
|
||||
{
|
||||
typedef DL_GroupParameters<T> ThisClass;
|
||||
|
||||
|
||||
public:
|
||||
typedef T Element;
|
||||
|
||||
@ -929,7 +929,7 @@ public:
|
||||
virtual bool ValidateElement(unsigned int level, const Element &element, const DL_FixedBasePrecomputation<Element> *precomp) const =0;
|
||||
|
||||
virtual bool FastSubgroupCheckAvailable() const =0;
|
||||
|
||||
|
||||
//! \brief Determines if an element is an identity
|
||||
//! \param element element to check
|
||||
//! \return true if the element is an identity, false otherwise
|
||||
@ -1029,7 +1029,7 @@ public:
|
||||
}
|
||||
|
||||
void AssignFrom(const NameValuePairs &source);
|
||||
|
||||
|
||||
// non-inherited
|
||||
virtual const Element & GetPublicElement() const {return GetPublicPrecomputation().GetBase(this->GetAbstractGroupParameters().GetGroupPrecomputation());}
|
||||
virtual void SetPublicElement(const Element &y) {AccessPublicPrecomputation().SetBase(this->GetAbstractGroupParameters().GetGroupPrecomputation(), y);}
|
||||
@ -1405,7 +1405,7 @@ public:
|
||||
|
||||
//! \brief Provides the maximum recoverable length
|
||||
//! \returns maximum recoverable length, in bytes
|
||||
size_t MaxRecoverableLength() const
|
||||
size_t MaxRecoverableLength() const
|
||||
{return GetMessageEncodingInterface().MaxRecoverableLength(0, GetHashIdentifier().second, GetDigestSize());}
|
||||
|
||||
//! \brief Provides the maximum recoverable length
|
||||
@ -1417,17 +1417,17 @@ public:
|
||||
|
||||
//! \brief Determines if the scheme is probabilistic
|
||||
//! \returns true if the scheme is probabilistic, false otherwise
|
||||
bool IsProbabilistic() const
|
||||
bool IsProbabilistic() const
|
||||
{return true;}
|
||||
|
||||
//! \brief Determines if the scheme has non-recoverable part
|
||||
//! \returns true if the message encoding has a non-recoverable part, false otherwise.
|
||||
bool AllowNonrecoverablePart() const
|
||||
bool AllowNonrecoverablePart() const
|
||||
{return GetMessageEncodingInterface().AllowNonrecoverablePart();}
|
||||
|
||||
//! \brief Determines if the scheme allows recoverable part first
|
||||
//! \returns true if the message encoding allows the recoverable part, false otherwise.
|
||||
bool RecoverablePartFirst() const
|
||||
bool RecoverablePartFirst() const
|
||||
{return GetMessageEncodingInterface().RecoverablePartFirst();}
|
||||
|
||||
protected:
|
||||
@ -1469,8 +1469,8 @@ public:
|
||||
{
|
||||
PK_MessageAccumulatorBase &ma = static_cast<PK_MessageAccumulatorBase &>(messageAccumulator);
|
||||
ma.m_recoverableMessage.Assign(recoverableMessage, recoverableMessageLength);
|
||||
this->GetMessageEncodingInterface().ProcessRecoverableMessage(ma.AccessHash(),
|
||||
recoverableMessage, recoverableMessageLength,
|
||||
this->GetMessageEncodingInterface().ProcessRecoverableMessage(ma.AccessHash(),
|
||||
recoverableMessage, recoverableMessageLength,
|
||||
ma.m_presignature, ma.m_presignature.size(),
|
||||
ma.m_semisignature);
|
||||
}
|
||||
@ -1486,9 +1486,9 @@ public:
|
||||
|
||||
SecByteBlock representative(this->MessageRepresentativeLength());
|
||||
this->GetMessageEncodingInterface().ComputeMessageRepresentative(
|
||||
rng,
|
||||
ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty,
|
||||
rng,
|
||||
ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty,
|
||||
representative, this->MessageRepresentativeBitLength());
|
||||
ma.m_empty = true;
|
||||
Integer e(representative, representative.size());
|
||||
@ -1535,7 +1535,7 @@ protected:
|
||||
ma.m_presignature.New(params.GetEncodedElementSize(false));
|
||||
params.ConvertElementToInteger(params.ExponentiateBase(ma.m_k)).Encode(ma.m_presignature, ma.m_presignature.size());
|
||||
*/
|
||||
CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(ma);
|
||||
CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(ma);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1550,7 +1550,7 @@ public:
|
||||
|
||||
void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const
|
||||
{
|
||||
CRYPTOPP_UNUSED(signature); CRYPTOPP_UNUSED(signatureLength);
|
||||
CRYPTOPP_UNUSED(signature); CRYPTOPP_UNUSED(signatureLength);
|
||||
PK_MessageAccumulatorBase &ma = static_cast<PK_MessageAccumulatorBase &>(messageAccumulator);
|
||||
const DL_ElgamalLikeSignatureAlgorithm<T> &alg = this->GetSignatureAlgorithm();
|
||||
const DL_GroupParameters<T> ¶ms = this->GetAbstractGroupParameters();
|
||||
@ -1561,7 +1561,7 @@ public:
|
||||
|
||||
this->GetMessageEncodingInterface().ProcessSemisignature(ma.AccessHash(), ma.m_semisignature, ma.m_semisignature.size());
|
||||
}
|
||||
|
||||
|
||||
bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const
|
||||
{
|
||||
this->GetMaterial().DoQuickSanityCheck();
|
||||
@ -1572,7 +1572,7 @@ public:
|
||||
const DL_PublicKey<T> &key = this->GetKeyInterface();
|
||||
|
||||
SecByteBlock representative(this->MessageRepresentativeLength());
|
||||
this->GetMessageEncodingInterface().ComputeMessageRepresentative(NullRNG(), ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
this->GetMessageEncodingInterface().ComputeMessageRepresentative(NullRNG(), ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty,
|
||||
representative, this->MessageRepresentativeBitLength());
|
||||
ma.m_empty = true;
|
||||
@ -1593,8 +1593,8 @@ public:
|
||||
|
||||
SecByteBlock representative(this->MessageRepresentativeLength());
|
||||
this->GetMessageEncodingInterface().ComputeMessageRepresentative(
|
||||
NullRNG(),
|
||||
ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
NullRNG(),
|
||||
ma.m_recoverableMessage, ma.m_recoverableMessage.size(),
|
||||
ma.AccessHash(), this->GetHashIdentifier(), ma.m_empty,
|
||||
representative, this->MessageRepresentativeBitLength());
|
||||
ma.m_empty = true;
|
||||
@ -1824,7 +1824,7 @@ class CRYPTOPP_NO_VTABLE DL_ObjectImpl : public DL_ObjectImplBase<BASE, SCHEME_O
|
||||
{
|
||||
public:
|
||||
typedef typename KEY::Element Element;
|
||||
|
||||
|
||||
#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
virtual ~DL_ObjectImpl() { }
|
||||
#endif
|
||||
@ -1840,7 +1840,7 @@ protected:
|
||||
{return Singleton<CPP_TYPENAME SCHEME_OPTIONS::SymmetricEncryptionAlgorithm>().Ref();}
|
||||
HashIdentifier GetHashIdentifier() const
|
||||
{return HashIdentifier();}
|
||||
const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const
|
||||
const PK_SignatureMessageEncodingMethod & GetMessageEncodingInterface() const
|
||||
{return Singleton<CPP_TYPENAME SCHEME_OPTIONS::MessageEncodingMethod>().Ref();}
|
||||
};
|
||||
|
||||
@ -1917,7 +1917,7 @@ public:
|
||||
Element y = params.ExponentiateBase(x);
|
||||
params.EncodeElement(true, y, publicKey);
|
||||
}
|
||||
|
||||
|
||||
bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const
|
||||
{
|
||||
try
|
||||
@ -1983,7 +1983,7 @@ public:
|
||||
|
||||
Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters<Element> ¶ms, const DL_FixedBasePrecomputation<Element> &publicPrecomputation, const Integer &privateExponent) const
|
||||
{
|
||||
return publicPrecomputation.Exponentiate(params.GetGroupPrecomputation(),
|
||||
return publicPrecomputation.Exponentiate(params.GetGroupPrecomputation(),
|
||||
COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? privateExponent*params.GetCofactor() : privateExponent);
|
||||
}
|
||||
|
||||
@ -1992,7 +1992,7 @@ public:
|
||||
if (COFACTOR_OPTION::ToEnum() == COMPATIBLE_COFACTOR_MULTIPLICTION)
|
||||
{
|
||||
const Integer &k = params.GetCofactor();
|
||||
return params.ExponentiateElement(publicElement,
|
||||
return params.ExponentiateElement(publicElement,
|
||||
ModularArithmetic(params.GetSubgroupOrder()).Divide(privateExponent, k)*k);
|
||||
}
|
||||
else if (COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION)
|
||||
@ -2053,7 +2053,7 @@ public:
|
||||
template <class T1, class T2, class T3>
|
||||
PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3)
|
||||
{this->AccessKey().Initialize(v1, v2, v3);}
|
||||
|
||||
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
PK_FinalTemplate(T1 &v1, T2 &v2, T3 &v3, T4 &v4)
|
||||
{this->AccessKey().Initialize(v1, v2, v3, v4);}
|
||||
@ -2083,7 +2083,7 @@ public:
|
||||
template <class T1, class T2, class T3>
|
||||
PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3)
|
||||
{this->AccessKey().Initialize(v1, v2, v3);}
|
||||
|
||||
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
PK_FinalTemplate(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
|
||||
{this->AccessKey().Initialize(v1, v2, v3, v4);}
|
||||
@ -2111,7 +2111,7 @@ public:
|
||||
template <class T1, class T2, class T3>
|
||||
PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3)
|
||||
{this->AccessKey().Initialize(v1, v2, v3);}
|
||||
|
||||
|
||||
template <class T1, class T2, class T3, class T4>
|
||||
PK_FinalTemplate(T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
|
||||
{this->AccessKey().Initialize(v1, v2, v3, v4);}
|
||||
|
@ -24,9 +24,9 @@ public:
|
||||
//! \brief Provides the maximum derived key length
|
||||
//! \returns maximum derived key length, in bytes
|
||||
virtual size_t MaxDerivedKeyLength() const =0;
|
||||
|
||||
|
||||
//! \brief Determines if the derivation function uses the purpose byte
|
||||
//! \returns true if the derivation function uses the purpose byte, false otherwise
|
||||
//! \returns true if the derivation function uses the purpose byte, false otherwise
|
||||
virtual bool UsesPurposeByte() const =0;
|
||||
|
||||
//! \brief Derive key from the password
|
||||
|
@ -460,7 +460,7 @@ byte ByteQueue::operator[](lword i) const
|
||||
{
|
||||
if (i < current->CurrentSize())
|
||||
return (*current)[(size_t)i];
|
||||
|
||||
|
||||
i -= current->CurrentSize();
|
||||
}
|
||||
|
||||
|
@ -47,13 +47,13 @@ void RandomPool::GenerateIntoBufferedTransformation(BufferedTransformation &targ
|
||||
|
||||
*(TimerWord *)(void*)m_seed.data() += tw;
|
||||
time_t t = time(NULL);
|
||||
|
||||
|
||||
// UBsan finding: signed integer overflow: 1876017710 + 1446085457 cannot be represented in type 'long int'
|
||||
// *(time_t *)(m_seed.data()+8) += t;
|
||||
word64 tt1 = 0, tt2 = (word64)t;
|
||||
memcpy(&tt1, m_seed.data()+8, 8);
|
||||
memcpy(m_seed.data()+8, &(tt2 += tt1), 8);
|
||||
|
||||
|
||||
// Wipe the intermediates
|
||||
*((volatile TimerWord*)&tw) = 0;
|
||||
*((volatile word64*)&tt1) = 0;
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
#define F(x, y, z) (x ^ y ^ z)
|
||||
#define F(x, y, z) (x ^ y ^ z)
|
||||
#define G(x, y, z) (z ^ (x & (y^z)))
|
||||
#define H(x, y, z) (z ^ (x | ~y))
|
||||
#define I(x, y, z) (y ^ (z & (x^y)))
|
||||
@ -154,7 +154,7 @@ void RIPEMD160::Transform (word32 *digest, const word32 *X)
|
||||
Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5);
|
||||
Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5);
|
||||
|
||||
Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6);
|
||||
Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6);
|
||||
Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6);
|
||||
Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6);
|
||||
Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6);
|
||||
@ -313,7 +313,7 @@ void RIPEMD320::Transform (word32 *digest, const word32 *X)
|
||||
Subround(G, a1, b1, c1, d1, e1, X[11], 13, k1);
|
||||
Subround(G, e1, a1, b1, c1, d1, X[ 8], 12, k1);
|
||||
|
||||
Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6);
|
||||
Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6);
|
||||
Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6);
|
||||
Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6);
|
||||
Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6);
|
||||
|
4
rsa.cpp
4
rsa.cpp
@ -224,7 +224,7 @@ void InvertibleRSAFunction::DEREncodePrivateKey(BufferedTransformation &bt) cons
|
||||
privateKey.MessageEnd();
|
||||
}
|
||||
|
||||
Integer InvertibleRSAFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
Integer InvertibleRSAFunction::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
{
|
||||
DoQuickSanityCheck();
|
||||
ModularArithmetic modn(m_n);
|
||||
@ -297,7 +297,7 @@ Integer RSAFunction_ISO::ApplyFunction(const Integer &x) const
|
||||
return t % 16 == 12 ? t : m_n - t;
|
||||
}
|
||||
|
||||
Integer InvertibleRSAFunction_ISO::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
Integer InvertibleRSAFunction_ISO::CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
|
||||
{
|
||||
Integer t = InvertibleRSAFunction::CalculateInverse(rng, x);
|
||||
return STDMIN(t, m_n-t);
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
const byte SAFER::Base::exp_tab[256] =
|
||||
const byte SAFER::Base::exp_tab[256] =
|
||||
{1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63,
|
||||
8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247,
|
||||
64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177,
|
||||
@ -29,7 +29,7 @@ const byte SAFER::Base::exp_tab[256] =
|
||||
253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35, 33, 200, 5,
|
||||
225, 102, 221, 179, 88, 105, 99, 86, 15, 161, 49, 149, 23, 7, 58, 40};
|
||||
|
||||
const byte SAFER::Base::log_tab[256] =
|
||||
const byte SAFER::Base::log_tab[256] =
|
||||
{128, 0, 176, 9, 96, 239, 185, 253, 16, 18, 159, 228, 105, 186, 173, 248,
|
||||
192, 56, 194, 101, 79, 6, 148, 252, 25, 222, 106, 27, 93, 78, 168, 130,
|
||||
112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37,
|
||||
|
@ -45,7 +45,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||
#define afterI1(f) f(1,a,b,c,e,d)
|
||||
#define afterI0(f) f(0,a,d,b,e,c)
|
||||
|
||||
// The instruction sequences for the S-box functions
|
||||
// The instruction sequences for the S-box functions
|
||||
// come from Dag Arne Osvik's paper "Speeding up Serpent".
|
||||
|
||||
#define S0(i, r0, r1, r2, r3, r4) \
|
||||
|
12
sha.cpp
12
sha.cpp
@ -245,7 +245,7 @@ static void CRYPTOPP_FASTCALL X86_SHA256_HashBlocks(word32 *state, const word32
|
||||
#define SWAP_COPY(i) \
|
||||
AS2( mov WORD_REG(bx), [WORD_REG(dx)+i*WORD_SZ])\
|
||||
AS1( bswap WORD_REG(bx))\
|
||||
AS2( mov [Wt(i)], WORD_REG(bx))
|
||||
AS2( mov [Wt(i)], WORD_REG(bx))
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
@ -444,7 +444,7 @@ INTEL_NOPREFIX
|
||||
|
||||
#ifdef __GNUC__
|
||||
ATT_PREFIX
|
||||
:
|
||||
:
|
||||
: "c" (state), "d" (data), "S" (SHA256_K+48), "D" (len)
|
||||
#if CRYPTOPP_BOOL_X64
|
||||
, "m" (workspace[0])
|
||||
@ -537,7 +537,7 @@ void SHA256::Transform(word32 *state, const word32 *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
// smaller but slower
|
||||
void SHA256::Transform(word32 *state, const word32 *data)
|
||||
{
|
||||
@ -549,7 +549,7 @@ void SHA256::Transform(word32 *state, const word32 *data)
|
||||
memcpy(t, state, 8*4);
|
||||
word32 e = t[4], a = t[0];
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
word32 w = data[j];
|
||||
W[j] = w;
|
||||
@ -709,14 +709,14 @@ CRYPTOPP_NAKED static void CRYPTOPP_FASTCALL SHA512_SSE2_Transform(word64 *state
|
||||
AS2( sub esp, 27*16) // 17*16 for expanded data, 20*8 for state
|
||||
AS_PUSH_IF86( ax)
|
||||
AS2( xor eax, eax)
|
||||
|
||||
|
||||
#if CRYPTOPP_BOOL_X32
|
||||
AS2( lea edi, [esp+8+8*8]) // start at middle of state buffer. will decrement pointer each round to avoid copying
|
||||
AS2( lea esi, [esp+8+20*8+8]) // 16-byte alignment, then add 8
|
||||
#else
|
||||
AS2( lea edi, [esp+4+8*8]) // start at middle of state buffer. will decrement pointer each round to avoid copying
|
||||
AS2( lea esi, [esp+4+20*8+8]) // 16-byte alignment, then add 8
|
||||
#endif
|
||||
#endif
|
||||
|
||||
AS2( movdqa xmm0, [ecx+0*16])
|
||||
AS2( movdq2q mm4, xmm0)
|
||||
|
64
sharkbox.cpp
64
sharkbox.cpp
@ -8,41 +8,41 @@
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
const byte SHARK::Enc::sbox[256] = {
|
||||
177, 206, 195, 149, 90, 173, 231, 2, 77, 68, 251, 145, 12, 135, 161, 80,
|
||||
203, 103, 84, 221, 70, 143, 225, 78, 240, 253, 252, 235, 249, 196, 26, 110,
|
||||
94, 245, 204, 141, 28, 86, 67, 254, 7, 97, 248, 117, 89, 255, 3, 34,
|
||||
138, 209, 19, 238, 136, 0, 14, 52, 21, 128, 148, 227, 237, 181, 83, 35,
|
||||
75, 71, 23, 167, 144, 53, 171, 216, 184, 223, 79, 87, 154, 146, 219, 27,
|
||||
60, 200, 153, 4, 142, 224, 215, 125, 133, 187, 64, 44, 58, 69, 241, 66,
|
||||
101, 32, 65, 24, 114, 37, 147, 112, 54, 5, 242, 11, 163, 121, 236, 8,
|
||||
39, 49, 50, 182, 124, 176, 10, 115, 91, 123, 183, 129, 210, 13, 106, 38,
|
||||
158, 88, 156, 131, 116, 179, 172, 48, 122, 105, 119, 15, 174, 33, 222, 208,
|
||||
46, 151, 16, 164, 152, 168, 212, 104, 45, 98, 41, 109, 22, 73, 118, 199,
|
||||
232, 193, 150, 55, 229, 202, 244, 233, 99, 18, 194, 166, 20, 188, 211, 40,
|
||||
175, 47, 230, 36, 82, 198, 160, 9, 189, 140, 207, 93, 17, 95, 1, 197,
|
||||
159, 61, 162, 155, 201, 59, 190, 81, 25, 31, 63, 92, 178, 239, 74, 205,
|
||||
191, 186, 111, 100, 217, 243, 62, 180, 170, 220, 213, 6, 192, 126, 246, 102,
|
||||
108, 132, 113, 56, 185, 29, 127, 157, 72, 139, 42, 218, 165, 51, 130, 57,
|
||||
214, 120, 134, 250, 228, 43, 169, 30, 137, 96, 107, 234, 85, 76, 247, 226,
|
||||
177, 206, 195, 149, 90, 173, 231, 2, 77, 68, 251, 145, 12, 135, 161, 80,
|
||||
203, 103, 84, 221, 70, 143, 225, 78, 240, 253, 252, 235, 249, 196, 26, 110,
|
||||
94, 245, 204, 141, 28, 86, 67, 254, 7, 97, 248, 117, 89, 255, 3, 34,
|
||||
138, 209, 19, 238, 136, 0, 14, 52, 21, 128, 148, 227, 237, 181, 83, 35,
|
||||
75, 71, 23, 167, 144, 53, 171, 216, 184, 223, 79, 87, 154, 146, 219, 27,
|
||||
60, 200, 153, 4, 142, 224, 215, 125, 133, 187, 64, 44, 58, 69, 241, 66,
|
||||
101, 32, 65, 24, 114, 37, 147, 112, 54, 5, 242, 11, 163, 121, 236, 8,
|
||||
39, 49, 50, 182, 124, 176, 10, 115, 91, 123, 183, 129, 210, 13, 106, 38,
|
||||
158, 88, 156, 131, 116, 179, 172, 48, 122, 105, 119, 15, 174, 33, 222, 208,
|
||||
46, 151, 16, 164, 152, 168, 212, 104, 45, 98, 41, 109, 22, 73, 118, 199,
|
||||
232, 193, 150, 55, 229, 202, 244, 233, 99, 18, 194, 166, 20, 188, 211, 40,
|
||||
175, 47, 230, 36, 82, 198, 160, 9, 189, 140, 207, 93, 17, 95, 1, 197,
|
||||
159, 61, 162, 155, 201, 59, 190, 81, 25, 31, 63, 92, 178, 239, 74, 205,
|
||||
191, 186, 111, 100, 217, 243, 62, 180, 170, 220, 213, 6, 192, 126, 246, 102,
|
||||
108, 132, 113, 56, 185, 29, 127, 157, 72, 139, 42, 218, 165, 51, 130, 57,
|
||||
214, 120, 134, 250, 228, 43, 169, 30, 137, 96, 107, 234, 85, 76, 247, 226,
|
||||
};
|
||||
|
||||
const byte SHARK::Dec::sbox[256] = {
|
||||
53, 190, 7, 46, 83, 105, 219, 40, 111, 183, 118, 107, 12, 125, 54, 139,
|
||||
146, 188, 169, 50, 172, 56, 156, 66, 99, 200, 30, 79, 36, 229, 247, 201,
|
||||
97, 141, 47, 63, 179, 101, 127, 112, 175, 154, 234, 245, 91, 152, 144, 177,
|
||||
135, 113, 114, 237, 55, 69, 104, 163, 227, 239, 92, 197, 80, 193, 214, 202,
|
||||
90, 98, 95, 38, 9, 93, 20, 65, 232, 157, 206, 64, 253, 8, 23, 74,
|
||||
15, 199, 180, 62, 18, 252, 37, 75, 129, 44, 4, 120, 203, 187, 32, 189,
|
||||
249, 41, 153, 168, 211, 96, 223, 17, 151, 137, 126, 250, 224, 155, 31, 210,
|
||||
103, 226, 100, 119, 132, 43, 158, 138, 241, 109, 136, 121, 116, 87, 221, 230,
|
||||
57, 123, 238, 131, 225, 88, 242, 13, 52, 248, 48, 233, 185, 35, 84, 21,
|
||||
68, 11, 77, 102, 58, 3, 162, 145, 148, 82, 76, 195, 130, 231, 128, 192,
|
||||
182, 14, 194, 108, 147, 236, 171, 67, 149, 246, 216, 70, 134, 5, 140, 176,
|
||||
117, 0, 204, 133, 215, 61, 115, 122, 72, 228, 209, 89, 173, 184, 198, 208,
|
||||
220, 161, 170, 2, 29, 191, 181, 159, 81, 196, 165, 16, 34, 207, 1, 186,
|
||||
143, 49, 124, 174, 150, 218, 240, 86, 71, 212, 235, 78, 217, 19, 142, 73,
|
||||
85, 22, 255, 59, 244, 164, 178, 6, 160, 167, 251, 27, 110, 60, 51, 205,
|
||||
24, 94, 106, 213, 166, 33, 222, 254, 42, 28, 243, 10, 26, 25, 39, 45,
|
||||
53, 190, 7, 46, 83, 105, 219, 40, 111, 183, 118, 107, 12, 125, 54, 139,
|
||||
146, 188, 169, 50, 172, 56, 156, 66, 99, 200, 30, 79, 36, 229, 247, 201,
|
||||
97, 141, 47, 63, 179, 101, 127, 112, 175, 154, 234, 245, 91, 152, 144, 177,
|
||||
135, 113, 114, 237, 55, 69, 104, 163, 227, 239, 92, 197, 80, 193, 214, 202,
|
||||
90, 98, 95, 38, 9, 93, 20, 65, 232, 157, 206, 64, 253, 8, 23, 74,
|
||||
15, 199, 180, 62, 18, 252, 37, 75, 129, 44, 4, 120, 203, 187, 32, 189,
|
||||
249, 41, 153, 168, 211, 96, 223, 17, 151, 137, 126, 250, 224, 155, 31, 210,
|
||||
103, 226, 100, 119, 132, 43, 158, 138, 241, 109, 136, 121, 116, 87, 221, 230,
|
||||
57, 123, 238, 131, 225, 88, 242, 13, 52, 248, 48, 233, 185, 35, 84, 21,
|
||||
68, 11, 77, 102, 58, 3, 162, 145, 148, 82, 76, 195, 130, 231, 128, 192,
|
||||
182, 14, 194, 108, 147, 236, 171, 67, 149, 246, 216, 70, 134, 5, 140, 176,
|
||||
117, 0, 204, 133, 215, 61, 115, 122, 72, 228, 209, 89, 173, 184, 198, 208,
|
||||
220, 161, 170, 2, 29, 191, 181, 159, 81, 196, 165, 16, 34, 207, 1, 186,
|
||||
143, 49, 124, 174, 150, 218, 240, 86, 71, 212, 235, 78, 217, 19, 142, 73,
|
||||
85, 22, 255, 59, 244, 164, 178, 6, 160, 167, 251, 27, 110, 60, 51, 205,
|
||||
24, 94, 106, 213, 166, 33, 222, 254, 42, 28, 243, 10, 26, 25, 39, 45,
|
||||
};
|
||||
|
||||
const word64 SHARK::Enc::cbox[8][256] = {
|
||||
|
2
simple.h
2
simple.h
@ -102,7 +102,7 @@ public:
|
||||
{
|
||||
if (hardFlush && !InputBufferIsEmpty())
|
||||
throw CannotFlush("Unflushable<T>: this object has buffered input that cannot be flushed");
|
||||
else
|
||||
else
|
||||
{
|
||||
BufferedTransformation *attached = this->AttachedTransformation();
|
||||
return attached && propagation ? attached->ChannelFlush(channel, hardFlush, propagation-1, blocking) : false;
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
T *old_p = m_p;
|
||||
*((volatile T**)&m_p) = NULL;
|
||||
return old_p;
|
||||
}
|
||||
}
|
||||
|
||||
void reset(T *p = 0);
|
||||
|
||||
@ -74,7 +74,7 @@ template <class T> void member_ptr<T>::reset(T *p) {delete m_p; m_p = p;}
|
||||
// ********************************************************
|
||||
|
||||
//! \class value_ptr
|
||||
//! \brief Value pointer
|
||||
//! \brief Value pointer
|
||||
//! \tparam T class or type
|
||||
template<class T> class value_ptr : public member_ptr<T>
|
||||
{
|
||||
@ -158,7 +158,7 @@ private:
|
||||
};
|
||||
|
||||
template <class T> counted_ptr<T>::counted_ptr(T *p)
|
||||
: m_p(p)
|
||||
: m_p(p)
|
||||
{
|
||||
if (m_p)
|
||||
m_p->m_referenceCount = 1;
|
||||
@ -252,7 +252,7 @@ public:
|
||||
this->m_size = newSize;
|
||||
this->m_ptr = newPtr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
operator T *() const
|
||||
{return (T*)m_ptr;}
|
||||
|
128
sosemanuk.cpp
128
sosemanuk.cpp
@ -31,7 +31,7 @@ void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv,
|
||||
assert(length==16);
|
||||
|
||||
word32 a, b, c, d, e;
|
||||
|
||||
|
||||
typedef BlockGetAndPut<word32, LittleEndian> Block;
|
||||
Block::Get(iv)(a)(b)(c)(d);
|
||||
|
||||
@ -91,69 +91,69 @@ void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv,
|
||||
extern "C" {
|
||||
word32 s_sosemanukMulTables[512] = {
|
||||
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SOSEMANUK_ASM)
|
||||
0x00000000, 0xE19FCF12, 0x6B973724, 0x8A08F836,
|
||||
0xD6876E48, 0x3718A15A, 0xBD10596C, 0x5C8F967E,
|
||||
0x05A7DC90, 0xE4381382, 0x6E30EBB4, 0x8FAF24A6,
|
||||
0xD320B2D8, 0x32BF7DCA, 0xB8B785FC, 0x59284AEE,
|
||||
0x0AE71189, 0xEB78DE9B, 0x617026AD, 0x80EFE9BF,
|
||||
0xDC607FC1, 0x3DFFB0D3, 0xB7F748E5, 0x566887F7,
|
||||
0x0F40CD19, 0xEEDF020B, 0x64D7FA3D, 0x8548352F,
|
||||
0xD9C7A351, 0x38586C43, 0xB2509475, 0x53CF5B67,
|
||||
0x146722BB, 0xF5F8EDA9, 0x7FF0159F, 0x9E6FDA8D,
|
||||
0xC2E04CF3, 0x237F83E1, 0xA9777BD7, 0x48E8B4C5,
|
||||
0x11C0FE2B, 0xF05F3139, 0x7A57C90F, 0x9BC8061D,
|
||||
0xC7479063, 0x26D85F71, 0xACD0A747, 0x4D4F6855,
|
||||
0x1E803332, 0xFF1FFC20, 0x75170416, 0x9488CB04,
|
||||
0xC8075D7A, 0x29989268, 0xA3906A5E, 0x420FA54C,
|
||||
0x1B27EFA2, 0xFAB820B0, 0x70B0D886, 0x912F1794,
|
||||
0xCDA081EA, 0x2C3F4EF8, 0xA637B6CE, 0x47A879DC,
|
||||
0x28CE44DF, 0xC9518BCD, 0x435973FB, 0xA2C6BCE9,
|
||||
0xFE492A97, 0x1FD6E585, 0x95DE1DB3, 0x7441D2A1,
|
||||
0x2D69984F, 0xCCF6575D, 0x46FEAF6B, 0xA7616079,
|
||||
0xFBEEF607, 0x1A713915, 0x9079C123, 0x71E60E31,
|
||||
0x22295556, 0xC3B69A44, 0x49BE6272, 0xA821AD60,
|
||||
0xF4AE3B1E, 0x1531F40C, 0x9F390C3A, 0x7EA6C328,
|
||||
0x278E89C6, 0xC61146D4, 0x4C19BEE2, 0xAD8671F0,
|
||||
0xF109E78E, 0x1096289C, 0x9A9ED0AA, 0x7B011FB8,
|
||||
0x3CA96664, 0xDD36A976, 0x573E5140, 0xB6A19E52,
|
||||
0xEA2E082C, 0x0BB1C73E, 0x81B93F08, 0x6026F01A,
|
||||
0x390EBAF4, 0xD89175E6, 0x52998DD0, 0xB30642C2,
|
||||
0xEF89D4BC, 0x0E161BAE, 0x841EE398, 0x65812C8A,
|
||||
0x364E77ED, 0xD7D1B8FF, 0x5DD940C9, 0xBC468FDB,
|
||||
0xE0C919A5, 0x0156D6B7, 0x8B5E2E81, 0x6AC1E193,
|
||||
0x33E9AB7D, 0xD276646F, 0x587E9C59, 0xB9E1534B,
|
||||
0xE56EC535, 0x04F10A27, 0x8EF9F211, 0x6F663D03,
|
||||
0x50358817, 0xB1AA4705, 0x3BA2BF33, 0xDA3D7021,
|
||||
0x86B2E65F, 0x672D294D, 0xED25D17B, 0x0CBA1E69,
|
||||
0x55925487, 0xB40D9B95, 0x3E0563A3, 0xDF9AACB1,
|
||||
0x83153ACF, 0x628AF5DD, 0xE8820DEB, 0x091DC2F9,
|
||||
0x5AD2999E, 0xBB4D568C, 0x3145AEBA, 0xD0DA61A8,
|
||||
0x8C55F7D6, 0x6DCA38C4, 0xE7C2C0F2, 0x065D0FE0,
|
||||
0x5F75450E, 0xBEEA8A1C, 0x34E2722A, 0xD57DBD38,
|
||||
0x89F22B46, 0x686DE454, 0xE2651C62, 0x03FAD370,
|
||||
0x4452AAAC, 0xA5CD65BE, 0x2FC59D88, 0xCE5A529A,
|
||||
0x92D5C4E4, 0x734A0BF6, 0xF942F3C0, 0x18DD3CD2,
|
||||
0x41F5763C, 0xA06AB92E, 0x2A624118, 0xCBFD8E0A,
|
||||
0x97721874, 0x76EDD766, 0xFCE52F50, 0x1D7AE042,
|
||||
0x4EB5BB25, 0xAF2A7437, 0x25228C01, 0xC4BD4313,
|
||||
0x9832D56D, 0x79AD1A7F, 0xF3A5E249, 0x123A2D5B,
|
||||
0x4B1267B5, 0xAA8DA8A7, 0x20855091, 0xC11A9F83,
|
||||
0x9D9509FD, 0x7C0AC6EF, 0xF6023ED9, 0x179DF1CB,
|
||||
0x78FBCCC8, 0x996403DA, 0x136CFBEC, 0xF2F334FE,
|
||||
0xAE7CA280, 0x4FE36D92, 0xC5EB95A4, 0x24745AB6,
|
||||
0x7D5C1058, 0x9CC3DF4A, 0x16CB277C, 0xF754E86E,
|
||||
0xABDB7E10, 0x4A44B102, 0xC04C4934, 0x21D38626,
|
||||
0x721CDD41, 0x93831253, 0x198BEA65, 0xF8142577,
|
||||
0xA49BB309, 0x45047C1B, 0xCF0C842D, 0x2E934B3F,
|
||||
0x77BB01D1, 0x9624CEC3, 0x1C2C36F5, 0xFDB3F9E7,
|
||||
0xA13C6F99, 0x40A3A08B, 0xCAAB58BD, 0x2B3497AF,
|
||||
0x6C9CEE73, 0x8D032161, 0x070BD957, 0xE6941645,
|
||||
0xBA1B803B, 0x5B844F29, 0xD18CB71F, 0x3013780D,
|
||||
0x693B32E3, 0x88A4FDF1, 0x02AC05C7, 0xE333CAD5,
|
||||
0xBFBC5CAB, 0x5E2393B9, 0xD42B6B8F, 0x35B4A49D,
|
||||
0x667BFFFA, 0x87E430E8, 0x0DECC8DE, 0xEC7307CC,
|
||||
0xB0FC91B2, 0x51635EA0, 0xDB6BA696, 0x3AF46984,
|
||||
0x63DC236A, 0x8243EC78, 0x084B144E, 0xE9D4DB5C,
|
||||
0x00000000, 0xE19FCF12, 0x6B973724, 0x8A08F836,
|
||||
0xD6876E48, 0x3718A15A, 0xBD10596C, 0x5C8F967E,
|
||||
0x05A7DC90, 0xE4381382, 0x6E30EBB4, 0x8FAF24A6,
|
||||
0xD320B2D8, 0x32BF7DCA, 0xB8B785FC, 0x59284AEE,
|
||||
0x0AE71189, 0xEB78DE9B, 0x617026AD, 0x80EFE9BF,
|
||||
0xDC607FC1, 0x3DFFB0D3, 0xB7F748E5, 0x566887F7,
|
||||
0x0F40CD19, 0xEEDF020B, 0x64D7FA3D, 0x8548352F,
|
||||
0xD9C7A351, 0x38586C43, 0xB2509475, 0x53CF5B67,
|
||||
0x146722BB, 0xF5F8EDA9, 0x7FF0159F, 0x9E6FDA8D,
|
||||
0xC2E04CF3, 0x237F83E1, 0xA9777BD7, 0x48E8B4C5,
|
||||
0x11C0FE2B, 0xF05F3139, 0x7A57C90F, 0x9BC8061D,
|
||||
0xC7479063, 0x26D85F71, 0xACD0A747, 0x4D4F6855,
|
||||
0x1E803332, 0xFF1FFC20, 0x75170416, 0x9488CB04,
|
||||
0xC8075D7A, 0x29989268, 0xA3906A5E, 0x420FA54C,
|
||||
0x1B27EFA2, 0xFAB820B0, 0x70B0D886, 0x912F1794,
|
||||
0xCDA081EA, 0x2C3F4EF8, 0xA637B6CE, 0x47A879DC,
|
||||
0x28CE44DF, 0xC9518BCD, 0x435973FB, 0xA2C6BCE9,
|
||||
0xFE492A97, 0x1FD6E585, 0x95DE1DB3, 0x7441D2A1,
|
||||
0x2D69984F, 0xCCF6575D, 0x46FEAF6B, 0xA7616079,
|
||||
0xFBEEF607, 0x1A713915, 0x9079C123, 0x71E60E31,
|
||||
0x22295556, 0xC3B69A44, 0x49BE6272, 0xA821AD60,
|
||||
0xF4AE3B1E, 0x1531F40C, 0x9F390C3A, 0x7EA6C328,
|
||||
0x278E89C6, 0xC61146D4, 0x4C19BEE2, 0xAD8671F0,
|
||||
0xF109E78E, 0x1096289C, 0x9A9ED0AA, 0x7B011FB8,
|
||||
0x3CA96664, 0xDD36A976, 0x573E5140, 0xB6A19E52,
|
||||
0xEA2E082C, 0x0BB1C73E, 0x81B93F08, 0x6026F01A,
|
||||
0x390EBAF4, 0xD89175E6, 0x52998DD0, 0xB30642C2,
|
||||
0xEF89D4BC, 0x0E161BAE, 0x841EE398, 0x65812C8A,
|
||||
0x364E77ED, 0xD7D1B8FF, 0x5DD940C9, 0xBC468FDB,
|
||||
0xE0C919A5, 0x0156D6B7, 0x8B5E2E81, 0x6AC1E193,
|
||||
0x33E9AB7D, 0xD276646F, 0x587E9C59, 0xB9E1534B,
|
||||
0xE56EC535, 0x04F10A27, 0x8EF9F211, 0x6F663D03,
|
||||
0x50358817, 0xB1AA4705, 0x3BA2BF33, 0xDA3D7021,
|
||||
0x86B2E65F, 0x672D294D, 0xED25D17B, 0x0CBA1E69,
|
||||
0x55925487, 0xB40D9B95, 0x3E0563A3, 0xDF9AACB1,
|
||||
0x83153ACF, 0x628AF5DD, 0xE8820DEB, 0x091DC2F9,
|
||||
0x5AD2999E, 0xBB4D568C, 0x3145AEBA, 0xD0DA61A8,
|
||||
0x8C55F7D6, 0x6DCA38C4, 0xE7C2C0F2, 0x065D0FE0,
|
||||
0x5F75450E, 0xBEEA8A1C, 0x34E2722A, 0xD57DBD38,
|
||||
0x89F22B46, 0x686DE454, 0xE2651C62, 0x03FAD370,
|
||||
0x4452AAAC, 0xA5CD65BE, 0x2FC59D88, 0xCE5A529A,
|
||||
0x92D5C4E4, 0x734A0BF6, 0xF942F3C0, 0x18DD3CD2,
|
||||
0x41F5763C, 0xA06AB92E, 0x2A624118, 0xCBFD8E0A,
|
||||
0x97721874, 0x76EDD766, 0xFCE52F50, 0x1D7AE042,
|
||||
0x4EB5BB25, 0xAF2A7437, 0x25228C01, 0xC4BD4313,
|
||||
0x9832D56D, 0x79AD1A7F, 0xF3A5E249, 0x123A2D5B,
|
||||
0x4B1267B5, 0xAA8DA8A7, 0x20855091, 0xC11A9F83,
|
||||
0x9D9509FD, 0x7C0AC6EF, 0xF6023ED9, 0x179DF1CB,
|
||||
0x78FBCCC8, 0x996403DA, 0x136CFBEC, 0xF2F334FE,
|
||||
0xAE7CA280, 0x4FE36D92, 0xC5EB95A4, 0x24745AB6,
|
||||
0x7D5C1058, 0x9CC3DF4A, 0x16CB277C, 0xF754E86E,
|
||||
0xABDB7E10, 0x4A44B102, 0xC04C4934, 0x21D38626,
|
||||
0x721CDD41, 0x93831253, 0x198BEA65, 0xF8142577,
|
||||
0xA49BB309, 0x45047C1B, 0xCF0C842D, 0x2E934B3F,
|
||||
0x77BB01D1, 0x9624CEC3, 0x1C2C36F5, 0xFDB3F9E7,
|
||||
0xA13C6F99, 0x40A3A08B, 0xCAAB58BD, 0x2B3497AF,
|
||||
0x6C9CEE73, 0x8D032161, 0x070BD957, 0xE6941645,
|
||||
0xBA1B803B, 0x5B844F29, 0xD18CB71F, 0x3013780D,
|
||||
0x693B32E3, 0x88A4FDF1, 0x02AC05C7, 0xE333CAD5,
|
||||
0xBFBC5CAB, 0x5E2393B9, 0xD42B6B8F, 0x35B4A49D,
|
||||
0x667BFFFA, 0x87E430E8, 0x0DECC8DE, 0xEC7307CC,
|
||||
0xB0FC91B2, 0x51635EA0, 0xDB6BA696, 0x3AF46984,
|
||||
0x63DC236A, 0x8243EC78, 0x084B144E, 0xE9D4DB5C,
|
||||
0xB55B4D22, 0x54C48230, 0xDECC7A06, 0x3F53B514,
|
||||
#else
|
||||
0x00000000, 0xE19FCF13, 0x6B973726, 0x8A08F835,
|
||||
|
1088
squaretb.cpp
1088
squaretb.cpp
File diff suppressed because it is too large
Load Diff
@ -91,9 +91,9 @@ enum KeystreamOperationFlags {
|
||||
//! and AdditiveCipherAbstractPolicy::GetAlignment()
|
||||
enum KeystreamOperation {
|
||||
//! \brief Wirte the keystream to the output buffer, input is NULL
|
||||
WRITE_KEYSTREAM = INPUT_NULL,
|
||||
WRITE_KEYSTREAM = INPUT_NULL,
|
||||
//! \brief Wirte the keystream to the aligned output buffer, input is NULL
|
||||
WRITE_KEYSTREAM_ALIGNED = INPUT_NULL | OUTPUT_ALIGNED,
|
||||
WRITE_KEYSTREAM_ALIGNED = INPUT_NULL | OUTPUT_ALIGNED,
|
||||
//! \brief XOR the input buffer and keystream, write to the output buffer
|
||||
XOR_KEYSTREAM = 0,
|
||||
//! \brief XOR the aligned input buffer and keystream, write to the output buffer
|
||||
@ -425,7 +425,7 @@ struct CRYPTOPP_NO_VTABLE CFB_CipherConcretePolicy : public BASE
|
||||
//! \brief Perform one iteration in the forward direction
|
||||
void TransformRegister() {this->Iterate(NULL, NULL, ENCRYPTION, 1);}
|
||||
|
||||
//! \brief
|
||||
//! \brief
|
||||
//! \tparam B enumeration indicating endianess
|
||||
//! \details RegisterOutput() provides alternate access to the feedback register. The
|
||||
//! enumeration B is BigEndian or LittleEndian. Repeatedly applying operator()
|
||||
@ -574,7 +574,7 @@ public:
|
||||
};
|
||||
|
||||
//! \class SymmetricCipherFinal
|
||||
//! \brief SymmetricCipher implementation
|
||||
//! \brief SymmetricCipher implementation
|
||||
//! \tparam BASE AbstractPolicyHolder derived base class
|
||||
//! \tparam INFO AbstractPolicyHolder derived information class
|
||||
//! \sa Weak::ARC4, ChaCha8, ChaCha12, ChaCha20, Salsa20, SEAL, Sosemanuk, WAKE
|
||||
|
510
tftables.cpp
510
tftables.cpp
@ -60,264 +60,264 @@ const byte Twofish::Base::q[2][256] = {
|
||||
};
|
||||
|
||||
const word32 Twofish::Base::mds[4][256] = {
|
||||
0xbcbc3275, 0xecec21f3, 0x202043c6, 0xb3b3c9f4,
|
||||
0xdada03db, 0x02028b7b, 0xe2e22bfb, 0x9e9efac8,
|
||||
0xc9c9ec4a, 0xd4d409d3, 0x18186be6, 0x1e1e9f6b,
|
||||
0x98980e45, 0xb2b2387d, 0xa6a6d2e8, 0x2626b74b,
|
||||
0x3c3c57d6, 0x93938a32, 0x8282eed8, 0x525298fd,
|
||||
0x7b7bd437, 0xbbbb3771, 0x5b5b97f1, 0x474783e1,
|
||||
0x24243c30, 0x5151e20f, 0xbabac6f8, 0x4a4af31b,
|
||||
0xbfbf4887, 0x0d0d70fa, 0xb0b0b306, 0x7575de3f,
|
||||
0xd2d2fd5e, 0x7d7d20ba, 0x666631ae, 0x3a3aa35b,
|
||||
0x59591c8a, 0x00000000, 0xcdcd93bc, 0x1a1ae09d,
|
||||
0xaeae2c6d, 0x7f7fabc1, 0x2b2bc7b1, 0xbebeb90e,
|
||||
0xe0e0a080, 0x8a8a105d, 0x3b3b52d2, 0x6464bad5,
|
||||
0xd8d888a0, 0xe7e7a584, 0x5f5fe807, 0x1b1b1114,
|
||||
0x2c2cc2b5, 0xfcfcb490, 0x3131272c, 0x808065a3,
|
||||
0x73732ab2, 0x0c0c8173, 0x79795f4c, 0x6b6b4154,
|
||||
0x4b4b0292, 0x53536974, 0x94948f36, 0x83831f51,
|
||||
0x2a2a3638, 0xc4c49cb0, 0x2222c8bd, 0xd5d5f85a,
|
||||
0xbdbdc3fc, 0x48487860, 0xffffce62, 0x4c4c0796,
|
||||
0x4141776c, 0xc7c7e642, 0xebeb24f7, 0x1c1c1410,
|
||||
0x5d5d637c, 0x36362228, 0x6767c027, 0xe9e9af8c,
|
||||
0x4444f913, 0x1414ea95, 0xf5f5bb9c, 0xcfcf18c7,
|
||||
0x3f3f2d24, 0xc0c0e346, 0x7272db3b, 0x54546c70,
|
||||
0x29294cca, 0xf0f035e3, 0x0808fe85, 0xc6c617cb,
|
||||
0xf3f34f11, 0x8c8ce4d0, 0xa4a45993, 0xcaca96b8,
|
||||
0x68683ba6, 0xb8b84d83, 0x38382820, 0xe5e52eff,
|
||||
0xadad569f, 0x0b0b8477, 0xc8c81dc3, 0x9999ffcc,
|
||||
0x5858ed03, 0x19199a6f, 0x0e0e0a08, 0x95957ebf,
|
||||
0x70705040, 0xf7f730e7, 0x6e6ecf2b, 0x1f1f6ee2,
|
||||
0xb5b53d79, 0x09090f0c, 0x616134aa, 0x57571682,
|
||||
0x9f9f0b41, 0x9d9d803a, 0x111164ea, 0x2525cdb9,
|
||||
0xafafdde4, 0x4545089a, 0xdfdf8da4, 0xa3a35c97,
|
||||
0xeaead57e, 0x353558da, 0xededd07a, 0x4343fc17,
|
||||
0xf8f8cb66, 0xfbfbb194, 0x3737d3a1, 0xfafa401d,
|
||||
0xc2c2683d, 0xb4b4ccf0, 0x32325dde, 0x9c9c71b3,
|
||||
0x5656e70b, 0xe3e3da72, 0x878760a7, 0x15151b1c,
|
||||
0xf9f93aef, 0x6363bfd1, 0x3434a953, 0x9a9a853e,
|
||||
0xb1b1428f, 0x7c7cd133, 0x88889b26, 0x3d3da65f,
|
||||
0xa1a1d7ec, 0xe4e4df76, 0x8181942a, 0x91910149,
|
||||
0x0f0ffb81, 0xeeeeaa88, 0x161661ee, 0xd7d77321,
|
||||
0x9797f5c4, 0xa5a5a81a, 0xfefe3feb, 0x6d6db5d9,
|
||||
0x7878aec5, 0xc5c56d39, 0x1d1de599, 0x7676a4cd,
|
||||
0x3e3edcad, 0xcbcb6731, 0xb6b6478b, 0xefef5b01,
|
||||
0x12121e18, 0x6060c523, 0x6a6ab0dd, 0x4d4df61f,
|
||||
0xcecee94e, 0xdede7c2d, 0x55559df9, 0x7e7e5a48,
|
||||
0x2121b24f, 0x03037af2, 0xa0a02665, 0x5e5e198e,
|
||||
0x5a5a6678, 0x65654b5c, 0x62624e58, 0xfdfd4519,
|
||||
0x0606f48d, 0x404086e5, 0xf2f2be98, 0x3333ac57,
|
||||
0x17179067, 0x05058e7f, 0xe8e85e05, 0x4f4f7d64,
|
||||
0x89896aaf, 0x10109563, 0x74742fb6, 0x0a0a75fe,
|
||||
0x5c5c92f5, 0x9b9b74b7, 0x2d2d333c, 0x3030d6a5,
|
||||
0x2e2e49ce, 0x494989e9, 0x46467268, 0x77775544,
|
||||
0xa8a8d8e0, 0x9696044d, 0x2828bd43, 0xa9a92969,
|
||||
0xd9d97929, 0x8686912e, 0xd1d187ac, 0xf4f44a15,
|
||||
0x8d8d1559, 0xd6d682a8, 0xb9b9bc0a, 0x42420d9e,
|
||||
0xf6f6c16e, 0x2f2fb847, 0xdddd06df, 0x23233934,
|
||||
0xcccc6235, 0xf1f1c46a, 0xc1c112cf, 0x8585ebdc,
|
||||
0x8f8f9e22, 0x7171a1c9, 0x9090f0c0, 0xaaaa539b,
|
||||
0x0101f189, 0x8b8be1d4, 0x4e4e8ced, 0x8e8e6fab,
|
||||
0xababa212, 0x6f6f3ea2, 0xe6e6540d, 0xdbdbf252,
|
||||
0x92927bbb, 0xb7b7b602, 0x6969ca2f, 0x3939d9a9,
|
||||
0xd3d30cd7, 0xa7a72361, 0xa2a2ad1e, 0xc3c399b4,
|
||||
0x6c6c4450, 0x07070504, 0x04047ff6, 0x272746c2,
|
||||
0xacaca716, 0xd0d07625, 0x50501386, 0xdcdcf756,
|
||||
0x84841a55, 0xe1e15109, 0x7a7a25be, 0x1313ef91,
|
||||
0xbcbc3275, 0xecec21f3, 0x202043c6, 0xb3b3c9f4,
|
||||
0xdada03db, 0x02028b7b, 0xe2e22bfb, 0x9e9efac8,
|
||||
0xc9c9ec4a, 0xd4d409d3, 0x18186be6, 0x1e1e9f6b,
|
||||
0x98980e45, 0xb2b2387d, 0xa6a6d2e8, 0x2626b74b,
|
||||
0x3c3c57d6, 0x93938a32, 0x8282eed8, 0x525298fd,
|
||||
0x7b7bd437, 0xbbbb3771, 0x5b5b97f1, 0x474783e1,
|
||||
0x24243c30, 0x5151e20f, 0xbabac6f8, 0x4a4af31b,
|
||||
0xbfbf4887, 0x0d0d70fa, 0xb0b0b306, 0x7575de3f,
|
||||
0xd2d2fd5e, 0x7d7d20ba, 0x666631ae, 0x3a3aa35b,
|
||||
0x59591c8a, 0x00000000, 0xcdcd93bc, 0x1a1ae09d,
|
||||
0xaeae2c6d, 0x7f7fabc1, 0x2b2bc7b1, 0xbebeb90e,
|
||||
0xe0e0a080, 0x8a8a105d, 0x3b3b52d2, 0x6464bad5,
|
||||
0xd8d888a0, 0xe7e7a584, 0x5f5fe807, 0x1b1b1114,
|
||||
0x2c2cc2b5, 0xfcfcb490, 0x3131272c, 0x808065a3,
|
||||
0x73732ab2, 0x0c0c8173, 0x79795f4c, 0x6b6b4154,
|
||||
0x4b4b0292, 0x53536974, 0x94948f36, 0x83831f51,
|
||||
0x2a2a3638, 0xc4c49cb0, 0x2222c8bd, 0xd5d5f85a,
|
||||
0xbdbdc3fc, 0x48487860, 0xffffce62, 0x4c4c0796,
|
||||
0x4141776c, 0xc7c7e642, 0xebeb24f7, 0x1c1c1410,
|
||||
0x5d5d637c, 0x36362228, 0x6767c027, 0xe9e9af8c,
|
||||
0x4444f913, 0x1414ea95, 0xf5f5bb9c, 0xcfcf18c7,
|
||||
0x3f3f2d24, 0xc0c0e346, 0x7272db3b, 0x54546c70,
|
||||
0x29294cca, 0xf0f035e3, 0x0808fe85, 0xc6c617cb,
|
||||
0xf3f34f11, 0x8c8ce4d0, 0xa4a45993, 0xcaca96b8,
|
||||
0x68683ba6, 0xb8b84d83, 0x38382820, 0xe5e52eff,
|
||||
0xadad569f, 0x0b0b8477, 0xc8c81dc3, 0x9999ffcc,
|
||||
0x5858ed03, 0x19199a6f, 0x0e0e0a08, 0x95957ebf,
|
||||
0x70705040, 0xf7f730e7, 0x6e6ecf2b, 0x1f1f6ee2,
|
||||
0xb5b53d79, 0x09090f0c, 0x616134aa, 0x57571682,
|
||||
0x9f9f0b41, 0x9d9d803a, 0x111164ea, 0x2525cdb9,
|
||||
0xafafdde4, 0x4545089a, 0xdfdf8da4, 0xa3a35c97,
|
||||
0xeaead57e, 0x353558da, 0xededd07a, 0x4343fc17,
|
||||
0xf8f8cb66, 0xfbfbb194, 0x3737d3a1, 0xfafa401d,
|
||||
0xc2c2683d, 0xb4b4ccf0, 0x32325dde, 0x9c9c71b3,
|
||||
0x5656e70b, 0xe3e3da72, 0x878760a7, 0x15151b1c,
|
||||
0xf9f93aef, 0x6363bfd1, 0x3434a953, 0x9a9a853e,
|
||||
0xb1b1428f, 0x7c7cd133, 0x88889b26, 0x3d3da65f,
|
||||
0xa1a1d7ec, 0xe4e4df76, 0x8181942a, 0x91910149,
|
||||
0x0f0ffb81, 0xeeeeaa88, 0x161661ee, 0xd7d77321,
|
||||
0x9797f5c4, 0xa5a5a81a, 0xfefe3feb, 0x6d6db5d9,
|
||||
0x7878aec5, 0xc5c56d39, 0x1d1de599, 0x7676a4cd,
|
||||
0x3e3edcad, 0xcbcb6731, 0xb6b6478b, 0xefef5b01,
|
||||
0x12121e18, 0x6060c523, 0x6a6ab0dd, 0x4d4df61f,
|
||||
0xcecee94e, 0xdede7c2d, 0x55559df9, 0x7e7e5a48,
|
||||
0x2121b24f, 0x03037af2, 0xa0a02665, 0x5e5e198e,
|
||||
0x5a5a6678, 0x65654b5c, 0x62624e58, 0xfdfd4519,
|
||||
0x0606f48d, 0x404086e5, 0xf2f2be98, 0x3333ac57,
|
||||
0x17179067, 0x05058e7f, 0xe8e85e05, 0x4f4f7d64,
|
||||
0x89896aaf, 0x10109563, 0x74742fb6, 0x0a0a75fe,
|
||||
0x5c5c92f5, 0x9b9b74b7, 0x2d2d333c, 0x3030d6a5,
|
||||
0x2e2e49ce, 0x494989e9, 0x46467268, 0x77775544,
|
||||
0xa8a8d8e0, 0x9696044d, 0x2828bd43, 0xa9a92969,
|
||||
0xd9d97929, 0x8686912e, 0xd1d187ac, 0xf4f44a15,
|
||||
0x8d8d1559, 0xd6d682a8, 0xb9b9bc0a, 0x42420d9e,
|
||||
0xf6f6c16e, 0x2f2fb847, 0xdddd06df, 0x23233934,
|
||||
0xcccc6235, 0xf1f1c46a, 0xc1c112cf, 0x8585ebdc,
|
||||
0x8f8f9e22, 0x7171a1c9, 0x9090f0c0, 0xaaaa539b,
|
||||
0x0101f189, 0x8b8be1d4, 0x4e4e8ced, 0x8e8e6fab,
|
||||
0xababa212, 0x6f6f3ea2, 0xe6e6540d, 0xdbdbf252,
|
||||
0x92927bbb, 0xb7b7b602, 0x6969ca2f, 0x3939d9a9,
|
||||
0xd3d30cd7, 0xa7a72361, 0xa2a2ad1e, 0xc3c399b4,
|
||||
0x6c6c4450, 0x07070504, 0x04047ff6, 0x272746c2,
|
||||
0xacaca716, 0xd0d07625, 0x50501386, 0xdcdcf756,
|
||||
0x84841a55, 0xe1e15109, 0x7a7a25be, 0x1313ef91,
|
||||
|
||||
0xa9d93939, 0x67901717, 0xb3719c9c, 0xe8d2a6a6,
|
||||
0x04050707, 0xfd985252, 0xa3658080, 0x76dfe4e4,
|
||||
0x9a084545, 0x92024b4b, 0x80a0e0e0, 0x78665a5a,
|
||||
0xe4ddafaf, 0xddb06a6a, 0xd1bf6363, 0x38362a2a,
|
||||
0x0d54e6e6, 0xc6432020, 0x3562cccc, 0x98bef2f2,
|
||||
0x181e1212, 0xf724ebeb, 0xecd7a1a1, 0x6c774141,
|
||||
0x43bd2828, 0x7532bcbc, 0x37d47b7b, 0x269b8888,
|
||||
0xfa700d0d, 0x13f94444, 0x94b1fbfb, 0x485a7e7e,
|
||||
0xf27a0303, 0xd0e48c8c, 0x8b47b6b6, 0x303c2424,
|
||||
0x84a5e7e7, 0x54416b6b, 0xdf06dddd, 0x23c56060,
|
||||
0x1945fdfd, 0x5ba33a3a, 0x3d68c2c2, 0x59158d8d,
|
||||
0xf321ecec, 0xae316666, 0xa23e6f6f, 0x82165757,
|
||||
0x63951010, 0x015befef, 0x834db8b8, 0x2e918686,
|
||||
0xd9b56d6d, 0x511f8383, 0x9b53aaaa, 0x7c635d5d,
|
||||
0xa63b6868, 0xeb3ffefe, 0xa5d63030, 0xbe257a7a,
|
||||
0x16a7acac, 0x0c0f0909, 0xe335f0f0, 0x6123a7a7,
|
||||
0xc0f09090, 0x8cafe9e9, 0x3a809d9d, 0xf5925c5c,
|
||||
0x73810c0c, 0x2c273131, 0x2576d0d0, 0x0be75656,
|
||||
0xbb7b9292, 0x4ee9cece, 0x89f10101, 0x6b9f1e1e,
|
||||
0x53a93434, 0x6ac4f1f1, 0xb499c3c3, 0xf1975b5b,
|
||||
0xe1834747, 0xe66b1818, 0xbdc82222, 0x450e9898,
|
||||
0xe26e1f1f, 0xf4c9b3b3, 0xb62f7474, 0x66cbf8f8,
|
||||
0xccff9999, 0x95ea1414, 0x03ed5858, 0x56f7dcdc,
|
||||
0xd4e18b8b, 0x1c1b1515, 0x1eada2a2, 0xd70cd3d3,
|
||||
0xfb2be2e2, 0xc31dc8c8, 0x8e195e5e, 0xb5c22c2c,
|
||||
0xe9894949, 0xcf12c1c1, 0xbf7e9595, 0xba207d7d,
|
||||
0xea641111, 0x77840b0b, 0x396dc5c5, 0xaf6a8989,
|
||||
0x33d17c7c, 0xc9a17171, 0x62ceffff, 0x7137bbbb,
|
||||
0x81fb0f0f, 0x793db5b5, 0x0951e1e1, 0xaddc3e3e,
|
||||
0x242d3f3f, 0xcda47676, 0xf99d5555, 0xd8ee8282,
|
||||
0xe5864040, 0xc5ae7878, 0xb9cd2525, 0x4d049696,
|
||||
0x44557777, 0x080a0e0e, 0x86135050, 0xe730f7f7,
|
||||
0xa1d33737, 0x1d40fafa, 0xaa346161, 0xed8c4e4e,
|
||||
0x06b3b0b0, 0x706c5454, 0xb22a7373, 0xd2523b3b,
|
||||
0x410b9f9f, 0x7b8b0202, 0xa088d8d8, 0x114ff3f3,
|
||||
0x3167cbcb, 0xc2462727, 0x27c06767, 0x90b4fcfc,
|
||||
0x20283838, 0xf67f0404, 0x60784848, 0xff2ee5e5,
|
||||
0x96074c4c, 0x5c4b6565, 0xb1c72b2b, 0xab6f8e8e,
|
||||
0x9e0d4242, 0x9cbbf5f5, 0x52f2dbdb, 0x1bf34a4a,
|
||||
0x5fa63d3d, 0x9359a4a4, 0x0abcb9b9, 0xef3af9f9,
|
||||
0x91ef1313, 0x85fe0808, 0x49019191, 0xee611616,
|
||||
0x2d7cdede, 0x4fb22121, 0x8f42b1b1, 0x3bdb7272,
|
||||
0x47b82f2f, 0x8748bfbf, 0x6d2caeae, 0x46e3c0c0,
|
||||
0xd6573c3c, 0x3e859a9a, 0x6929a9a9, 0x647d4f4f,
|
||||
0x2a948181, 0xce492e2e, 0xcb17c6c6, 0x2fca6969,
|
||||
0xfcc3bdbd, 0x975ca3a3, 0x055ee8e8, 0x7ad0eded,
|
||||
0xac87d1d1, 0x7f8e0505, 0xd5ba6464, 0x1aa8a5a5,
|
||||
0x4bb72626, 0x0eb9bebe, 0xa7608787, 0x5af8d5d5,
|
||||
0x28223636, 0x14111b1b, 0x3fde7575, 0x2979d9d9,
|
||||
0x88aaeeee, 0x3c332d2d, 0x4c5f7979, 0x02b6b7b7,
|
||||
0xb896caca, 0xda583535, 0xb09cc4c4, 0x17fc4343,
|
||||
0x551a8484, 0x1ff64d4d, 0x8a1c5959, 0x7d38b2b2,
|
||||
0x57ac3333, 0xc718cfcf, 0x8df40606, 0x74695353,
|
||||
0xb7749b9b, 0xc4f59797, 0x9f56adad, 0x72dae3e3,
|
||||
0x7ed5eaea, 0x154af4f4, 0x229e8f8f, 0x12a2abab,
|
||||
0x584e6262, 0x07e85f5f, 0x99e51d1d, 0x34392323,
|
||||
0x6ec1f6f6, 0x50446c6c, 0xde5d3232, 0x68724646,
|
||||
0x6526a0a0, 0xbc93cdcd, 0xdb03dada, 0xf8c6baba,
|
||||
0xc8fa9e9e, 0xa882d6d6, 0x2bcf6e6e, 0x40507070,
|
||||
0xdceb8585, 0xfe750a0a, 0x328a9393, 0xa48ddfdf,
|
||||
0xca4c2929, 0x10141c1c, 0x2173d7d7, 0xf0ccb4b4,
|
||||
0xd309d4d4, 0x5d108a8a, 0x0fe25151, 0x00000000,
|
||||
0x6f9a1919, 0x9de01a1a, 0x368f9494, 0x42e6c7c7,
|
||||
0x4aecc9c9, 0x5efdd2d2, 0xc1ab7f7f, 0xe0d8a8a8,
|
||||
0xa9d93939, 0x67901717, 0xb3719c9c, 0xe8d2a6a6,
|
||||
0x04050707, 0xfd985252, 0xa3658080, 0x76dfe4e4,
|
||||
0x9a084545, 0x92024b4b, 0x80a0e0e0, 0x78665a5a,
|
||||
0xe4ddafaf, 0xddb06a6a, 0xd1bf6363, 0x38362a2a,
|
||||
0x0d54e6e6, 0xc6432020, 0x3562cccc, 0x98bef2f2,
|
||||
0x181e1212, 0xf724ebeb, 0xecd7a1a1, 0x6c774141,
|
||||
0x43bd2828, 0x7532bcbc, 0x37d47b7b, 0x269b8888,
|
||||
0xfa700d0d, 0x13f94444, 0x94b1fbfb, 0x485a7e7e,
|
||||
0xf27a0303, 0xd0e48c8c, 0x8b47b6b6, 0x303c2424,
|
||||
0x84a5e7e7, 0x54416b6b, 0xdf06dddd, 0x23c56060,
|
||||
0x1945fdfd, 0x5ba33a3a, 0x3d68c2c2, 0x59158d8d,
|
||||
0xf321ecec, 0xae316666, 0xa23e6f6f, 0x82165757,
|
||||
0x63951010, 0x015befef, 0x834db8b8, 0x2e918686,
|
||||
0xd9b56d6d, 0x511f8383, 0x9b53aaaa, 0x7c635d5d,
|
||||
0xa63b6868, 0xeb3ffefe, 0xa5d63030, 0xbe257a7a,
|
||||
0x16a7acac, 0x0c0f0909, 0xe335f0f0, 0x6123a7a7,
|
||||
0xc0f09090, 0x8cafe9e9, 0x3a809d9d, 0xf5925c5c,
|
||||
0x73810c0c, 0x2c273131, 0x2576d0d0, 0x0be75656,
|
||||
0xbb7b9292, 0x4ee9cece, 0x89f10101, 0x6b9f1e1e,
|
||||
0x53a93434, 0x6ac4f1f1, 0xb499c3c3, 0xf1975b5b,
|
||||
0xe1834747, 0xe66b1818, 0xbdc82222, 0x450e9898,
|
||||
0xe26e1f1f, 0xf4c9b3b3, 0xb62f7474, 0x66cbf8f8,
|
||||
0xccff9999, 0x95ea1414, 0x03ed5858, 0x56f7dcdc,
|
||||
0xd4e18b8b, 0x1c1b1515, 0x1eada2a2, 0xd70cd3d3,
|
||||
0xfb2be2e2, 0xc31dc8c8, 0x8e195e5e, 0xb5c22c2c,
|
||||
0xe9894949, 0xcf12c1c1, 0xbf7e9595, 0xba207d7d,
|
||||
0xea641111, 0x77840b0b, 0x396dc5c5, 0xaf6a8989,
|
||||
0x33d17c7c, 0xc9a17171, 0x62ceffff, 0x7137bbbb,
|
||||
0x81fb0f0f, 0x793db5b5, 0x0951e1e1, 0xaddc3e3e,
|
||||
0x242d3f3f, 0xcda47676, 0xf99d5555, 0xd8ee8282,
|
||||
0xe5864040, 0xc5ae7878, 0xb9cd2525, 0x4d049696,
|
||||
0x44557777, 0x080a0e0e, 0x86135050, 0xe730f7f7,
|
||||
0xa1d33737, 0x1d40fafa, 0xaa346161, 0xed8c4e4e,
|
||||
0x06b3b0b0, 0x706c5454, 0xb22a7373, 0xd2523b3b,
|
||||
0x410b9f9f, 0x7b8b0202, 0xa088d8d8, 0x114ff3f3,
|
||||
0x3167cbcb, 0xc2462727, 0x27c06767, 0x90b4fcfc,
|
||||
0x20283838, 0xf67f0404, 0x60784848, 0xff2ee5e5,
|
||||
0x96074c4c, 0x5c4b6565, 0xb1c72b2b, 0xab6f8e8e,
|
||||
0x9e0d4242, 0x9cbbf5f5, 0x52f2dbdb, 0x1bf34a4a,
|
||||
0x5fa63d3d, 0x9359a4a4, 0x0abcb9b9, 0xef3af9f9,
|
||||
0x91ef1313, 0x85fe0808, 0x49019191, 0xee611616,
|
||||
0x2d7cdede, 0x4fb22121, 0x8f42b1b1, 0x3bdb7272,
|
||||
0x47b82f2f, 0x8748bfbf, 0x6d2caeae, 0x46e3c0c0,
|
||||
0xd6573c3c, 0x3e859a9a, 0x6929a9a9, 0x647d4f4f,
|
||||
0x2a948181, 0xce492e2e, 0xcb17c6c6, 0x2fca6969,
|
||||
0xfcc3bdbd, 0x975ca3a3, 0x055ee8e8, 0x7ad0eded,
|
||||
0xac87d1d1, 0x7f8e0505, 0xd5ba6464, 0x1aa8a5a5,
|
||||
0x4bb72626, 0x0eb9bebe, 0xa7608787, 0x5af8d5d5,
|
||||
0x28223636, 0x14111b1b, 0x3fde7575, 0x2979d9d9,
|
||||
0x88aaeeee, 0x3c332d2d, 0x4c5f7979, 0x02b6b7b7,
|
||||
0xb896caca, 0xda583535, 0xb09cc4c4, 0x17fc4343,
|
||||
0x551a8484, 0x1ff64d4d, 0x8a1c5959, 0x7d38b2b2,
|
||||
0x57ac3333, 0xc718cfcf, 0x8df40606, 0x74695353,
|
||||
0xb7749b9b, 0xc4f59797, 0x9f56adad, 0x72dae3e3,
|
||||
0x7ed5eaea, 0x154af4f4, 0x229e8f8f, 0x12a2abab,
|
||||
0x584e6262, 0x07e85f5f, 0x99e51d1d, 0x34392323,
|
||||
0x6ec1f6f6, 0x50446c6c, 0xde5d3232, 0x68724646,
|
||||
0x6526a0a0, 0xbc93cdcd, 0xdb03dada, 0xf8c6baba,
|
||||
0xc8fa9e9e, 0xa882d6d6, 0x2bcf6e6e, 0x40507070,
|
||||
0xdceb8585, 0xfe750a0a, 0x328a9393, 0xa48ddfdf,
|
||||
0xca4c2929, 0x10141c1c, 0x2173d7d7, 0xf0ccb4b4,
|
||||
0xd309d4d4, 0x5d108a8a, 0x0fe25151, 0x00000000,
|
||||
0x6f9a1919, 0x9de01a1a, 0x368f9494, 0x42e6c7c7,
|
||||
0x4aecc9c9, 0x5efdd2d2, 0xc1ab7f7f, 0xe0d8a8a8,
|
||||
|
||||
0xbc75bc32, 0xecf3ec21, 0x20c62043, 0xb3f4b3c9,
|
||||
0xdadbda03, 0x027b028b, 0xe2fbe22b, 0x9ec89efa,
|
||||
0xc94ac9ec, 0xd4d3d409, 0x18e6186b, 0x1e6b1e9f,
|
||||
0x9845980e, 0xb27db238, 0xa6e8a6d2, 0x264b26b7,
|
||||
0x3cd63c57, 0x9332938a, 0x82d882ee, 0x52fd5298,
|
||||
0x7b377bd4, 0xbb71bb37, 0x5bf15b97, 0x47e14783,
|
||||
0x2430243c, 0x510f51e2, 0xbaf8bac6, 0x4a1b4af3,
|
||||
0xbf87bf48, 0x0dfa0d70, 0xb006b0b3, 0x753f75de,
|
||||
0xd25ed2fd, 0x7dba7d20, 0x66ae6631, 0x3a5b3aa3,
|
||||
0x598a591c, 0x00000000, 0xcdbccd93, 0x1a9d1ae0,
|
||||
0xae6dae2c, 0x7fc17fab, 0x2bb12bc7, 0xbe0ebeb9,
|
||||
0xe080e0a0, 0x8a5d8a10, 0x3bd23b52, 0x64d564ba,
|
||||
0xd8a0d888, 0xe784e7a5, 0x5f075fe8, 0x1b141b11,
|
||||
0x2cb52cc2, 0xfc90fcb4, 0x312c3127, 0x80a38065,
|
||||
0x73b2732a, 0x0c730c81, 0x794c795f, 0x6b546b41,
|
||||
0x4b924b02, 0x53745369, 0x9436948f, 0x8351831f,
|
||||
0x2a382a36, 0xc4b0c49c, 0x22bd22c8, 0xd55ad5f8,
|
||||
0xbdfcbdc3, 0x48604878, 0xff62ffce, 0x4c964c07,
|
||||
0x416c4177, 0xc742c7e6, 0xebf7eb24, 0x1c101c14,
|
||||
0x5d7c5d63, 0x36283622, 0x672767c0, 0xe98ce9af,
|
||||
0x441344f9, 0x149514ea, 0xf59cf5bb, 0xcfc7cf18,
|
||||
0x3f243f2d, 0xc046c0e3, 0x723b72db, 0x5470546c,
|
||||
0x29ca294c, 0xf0e3f035, 0x088508fe, 0xc6cbc617,
|
||||
0xf311f34f, 0x8cd08ce4, 0xa493a459, 0xcab8ca96,
|
||||
0x68a6683b, 0xb883b84d, 0x38203828, 0xe5ffe52e,
|
||||
0xad9fad56, 0x0b770b84, 0xc8c3c81d, 0x99cc99ff,
|
||||
0x580358ed, 0x196f199a, 0x0e080e0a, 0x95bf957e,
|
||||
0x70407050, 0xf7e7f730, 0x6e2b6ecf, 0x1fe21f6e,
|
||||
0xb579b53d, 0x090c090f, 0x61aa6134, 0x57825716,
|
||||
0x9f419f0b, 0x9d3a9d80, 0x11ea1164, 0x25b925cd,
|
||||
0xafe4afdd, 0x459a4508, 0xdfa4df8d, 0xa397a35c,
|
||||
0xea7eead5, 0x35da3558, 0xed7aedd0, 0x431743fc,
|
||||
0xf866f8cb, 0xfb94fbb1, 0x37a137d3, 0xfa1dfa40,
|
||||
0xc23dc268, 0xb4f0b4cc, 0x32de325d, 0x9cb39c71,
|
||||
0x560b56e7, 0xe372e3da, 0x87a78760, 0x151c151b,
|
||||
0xf9eff93a, 0x63d163bf, 0x345334a9, 0x9a3e9a85,
|
||||
0xb18fb142, 0x7c337cd1, 0x8826889b, 0x3d5f3da6,
|
||||
0xa1eca1d7, 0xe476e4df, 0x812a8194, 0x91499101,
|
||||
0x0f810ffb, 0xee88eeaa, 0x16ee1661, 0xd721d773,
|
||||
0x97c497f5, 0xa51aa5a8, 0xfeebfe3f, 0x6dd96db5,
|
||||
0x78c578ae, 0xc539c56d, 0x1d991de5, 0x76cd76a4,
|
||||
0x3ead3edc, 0xcb31cb67, 0xb68bb647, 0xef01ef5b,
|
||||
0x1218121e, 0x602360c5, 0x6add6ab0, 0x4d1f4df6,
|
||||
0xce4ecee9, 0xde2dde7c, 0x55f9559d, 0x7e487e5a,
|
||||
0x214f21b2, 0x03f2037a, 0xa065a026, 0x5e8e5e19,
|
||||
0x5a785a66, 0x655c654b, 0x6258624e, 0xfd19fd45,
|
||||
0x068d06f4, 0x40e54086, 0xf298f2be, 0x335733ac,
|
||||
0x17671790, 0x057f058e, 0xe805e85e, 0x4f644f7d,
|
||||
0x89af896a, 0x10631095, 0x74b6742f, 0x0afe0a75,
|
||||
0x5cf55c92, 0x9bb79b74, 0x2d3c2d33, 0x30a530d6,
|
||||
0x2ece2e49, 0x49e94989, 0x46684672, 0x77447755,
|
||||
0xa8e0a8d8, 0x964d9604, 0x284328bd, 0xa969a929,
|
||||
0xd929d979, 0x862e8691, 0xd1acd187, 0xf415f44a,
|
||||
0x8d598d15, 0xd6a8d682, 0xb90ab9bc, 0x429e420d,
|
||||
0xf66ef6c1, 0x2f472fb8, 0xdddfdd06, 0x23342339,
|
||||
0xcc35cc62, 0xf16af1c4, 0xc1cfc112, 0x85dc85eb,
|
||||
0x8f228f9e, 0x71c971a1, 0x90c090f0, 0xaa9baa53,
|
||||
0x018901f1, 0x8bd48be1, 0x4eed4e8c, 0x8eab8e6f,
|
||||
0xab12aba2, 0x6fa26f3e, 0xe60de654, 0xdb52dbf2,
|
||||
0x92bb927b, 0xb702b7b6, 0x692f69ca, 0x39a939d9,
|
||||
0xd3d7d30c, 0xa761a723, 0xa21ea2ad, 0xc3b4c399,
|
||||
0x6c506c44, 0x07040705, 0x04f6047f, 0x27c22746,
|
||||
0xac16aca7, 0xd025d076, 0x50865013, 0xdc56dcf7,
|
||||
0x8455841a, 0xe109e151, 0x7abe7a25, 0x139113ef,
|
||||
0xbc75bc32, 0xecf3ec21, 0x20c62043, 0xb3f4b3c9,
|
||||
0xdadbda03, 0x027b028b, 0xe2fbe22b, 0x9ec89efa,
|
||||
0xc94ac9ec, 0xd4d3d409, 0x18e6186b, 0x1e6b1e9f,
|
||||
0x9845980e, 0xb27db238, 0xa6e8a6d2, 0x264b26b7,
|
||||
0x3cd63c57, 0x9332938a, 0x82d882ee, 0x52fd5298,
|
||||
0x7b377bd4, 0xbb71bb37, 0x5bf15b97, 0x47e14783,
|
||||
0x2430243c, 0x510f51e2, 0xbaf8bac6, 0x4a1b4af3,
|
||||
0xbf87bf48, 0x0dfa0d70, 0xb006b0b3, 0x753f75de,
|
||||
0xd25ed2fd, 0x7dba7d20, 0x66ae6631, 0x3a5b3aa3,
|
||||
0x598a591c, 0x00000000, 0xcdbccd93, 0x1a9d1ae0,
|
||||
0xae6dae2c, 0x7fc17fab, 0x2bb12bc7, 0xbe0ebeb9,
|
||||
0xe080e0a0, 0x8a5d8a10, 0x3bd23b52, 0x64d564ba,
|
||||
0xd8a0d888, 0xe784e7a5, 0x5f075fe8, 0x1b141b11,
|
||||
0x2cb52cc2, 0xfc90fcb4, 0x312c3127, 0x80a38065,
|
||||
0x73b2732a, 0x0c730c81, 0x794c795f, 0x6b546b41,
|
||||
0x4b924b02, 0x53745369, 0x9436948f, 0x8351831f,
|
||||
0x2a382a36, 0xc4b0c49c, 0x22bd22c8, 0xd55ad5f8,
|
||||
0xbdfcbdc3, 0x48604878, 0xff62ffce, 0x4c964c07,
|
||||
0x416c4177, 0xc742c7e6, 0xebf7eb24, 0x1c101c14,
|
||||
0x5d7c5d63, 0x36283622, 0x672767c0, 0xe98ce9af,
|
||||
0x441344f9, 0x149514ea, 0xf59cf5bb, 0xcfc7cf18,
|
||||
0x3f243f2d, 0xc046c0e3, 0x723b72db, 0x5470546c,
|
||||
0x29ca294c, 0xf0e3f035, 0x088508fe, 0xc6cbc617,
|
||||
0xf311f34f, 0x8cd08ce4, 0xa493a459, 0xcab8ca96,
|
||||
0x68a6683b, 0xb883b84d, 0x38203828, 0xe5ffe52e,
|
||||
0xad9fad56, 0x0b770b84, 0xc8c3c81d, 0x99cc99ff,
|
||||
0x580358ed, 0x196f199a, 0x0e080e0a, 0x95bf957e,
|
||||
0x70407050, 0xf7e7f730, 0x6e2b6ecf, 0x1fe21f6e,
|
||||
0xb579b53d, 0x090c090f, 0x61aa6134, 0x57825716,
|
||||
0x9f419f0b, 0x9d3a9d80, 0x11ea1164, 0x25b925cd,
|
||||
0xafe4afdd, 0x459a4508, 0xdfa4df8d, 0xa397a35c,
|
||||
0xea7eead5, 0x35da3558, 0xed7aedd0, 0x431743fc,
|
||||
0xf866f8cb, 0xfb94fbb1, 0x37a137d3, 0xfa1dfa40,
|
||||
0xc23dc268, 0xb4f0b4cc, 0x32de325d, 0x9cb39c71,
|
||||
0x560b56e7, 0xe372e3da, 0x87a78760, 0x151c151b,
|
||||
0xf9eff93a, 0x63d163bf, 0x345334a9, 0x9a3e9a85,
|
||||
0xb18fb142, 0x7c337cd1, 0x8826889b, 0x3d5f3da6,
|
||||
0xa1eca1d7, 0xe476e4df, 0x812a8194, 0x91499101,
|
||||
0x0f810ffb, 0xee88eeaa, 0x16ee1661, 0xd721d773,
|
||||
0x97c497f5, 0xa51aa5a8, 0xfeebfe3f, 0x6dd96db5,
|
||||
0x78c578ae, 0xc539c56d, 0x1d991de5, 0x76cd76a4,
|
||||
0x3ead3edc, 0xcb31cb67, 0xb68bb647, 0xef01ef5b,
|
||||
0x1218121e, 0x602360c5, 0x6add6ab0, 0x4d1f4df6,
|
||||
0xce4ecee9, 0xde2dde7c, 0x55f9559d, 0x7e487e5a,
|
||||
0x214f21b2, 0x03f2037a, 0xa065a026, 0x5e8e5e19,
|
||||
0x5a785a66, 0x655c654b, 0x6258624e, 0xfd19fd45,
|
||||
0x068d06f4, 0x40e54086, 0xf298f2be, 0x335733ac,
|
||||
0x17671790, 0x057f058e, 0xe805e85e, 0x4f644f7d,
|
||||
0x89af896a, 0x10631095, 0x74b6742f, 0x0afe0a75,
|
||||
0x5cf55c92, 0x9bb79b74, 0x2d3c2d33, 0x30a530d6,
|
||||
0x2ece2e49, 0x49e94989, 0x46684672, 0x77447755,
|
||||
0xa8e0a8d8, 0x964d9604, 0x284328bd, 0xa969a929,
|
||||
0xd929d979, 0x862e8691, 0xd1acd187, 0xf415f44a,
|
||||
0x8d598d15, 0xd6a8d682, 0xb90ab9bc, 0x429e420d,
|
||||
0xf66ef6c1, 0x2f472fb8, 0xdddfdd06, 0x23342339,
|
||||
0xcc35cc62, 0xf16af1c4, 0xc1cfc112, 0x85dc85eb,
|
||||
0x8f228f9e, 0x71c971a1, 0x90c090f0, 0xaa9baa53,
|
||||
0x018901f1, 0x8bd48be1, 0x4eed4e8c, 0x8eab8e6f,
|
||||
0xab12aba2, 0x6fa26f3e, 0xe60de654, 0xdb52dbf2,
|
||||
0x92bb927b, 0xb702b7b6, 0x692f69ca, 0x39a939d9,
|
||||
0xd3d7d30c, 0xa761a723, 0xa21ea2ad, 0xc3b4c399,
|
||||
0x6c506c44, 0x07040705, 0x04f6047f, 0x27c22746,
|
||||
0xac16aca7, 0xd025d076, 0x50865013, 0xdc56dcf7,
|
||||
0x8455841a, 0xe109e151, 0x7abe7a25, 0x139113ef,
|
||||
|
||||
0xd939a9d9, 0x90176790, 0x719cb371, 0xd2a6e8d2,
|
||||
0x05070405, 0x9852fd98, 0x6580a365, 0xdfe476df,
|
||||
0x08459a08, 0x024b9202, 0xa0e080a0, 0x665a7866,
|
||||
0xddafe4dd, 0xb06addb0, 0xbf63d1bf, 0x362a3836,
|
||||
0x54e60d54, 0x4320c643, 0x62cc3562, 0xbef298be,
|
||||
0x1e12181e, 0x24ebf724, 0xd7a1ecd7, 0x77416c77,
|
||||
0xbd2843bd, 0x32bc7532, 0xd47b37d4, 0x9b88269b,
|
||||
0x700dfa70, 0xf94413f9, 0xb1fb94b1, 0x5a7e485a,
|
||||
0x7a03f27a, 0xe48cd0e4, 0x47b68b47, 0x3c24303c,
|
||||
0xa5e784a5, 0x416b5441, 0x06dddf06, 0xc56023c5,
|
||||
0x45fd1945, 0xa33a5ba3, 0x68c23d68, 0x158d5915,
|
||||
0x21ecf321, 0x3166ae31, 0x3e6fa23e, 0x16578216,
|
||||
0x95106395, 0x5bef015b, 0x4db8834d, 0x91862e91,
|
||||
0xb56dd9b5, 0x1f83511f, 0x53aa9b53, 0x635d7c63,
|
||||
0x3b68a63b, 0x3ffeeb3f, 0xd630a5d6, 0x257abe25,
|
||||
0xa7ac16a7, 0x0f090c0f, 0x35f0e335, 0x23a76123,
|
||||
0xf090c0f0, 0xafe98caf, 0x809d3a80, 0x925cf592,
|
||||
0x810c7381, 0x27312c27, 0x76d02576, 0xe7560be7,
|
||||
0x7b92bb7b, 0xe9ce4ee9, 0xf10189f1, 0x9f1e6b9f,
|
||||
0xa93453a9, 0xc4f16ac4, 0x99c3b499, 0x975bf197,
|
||||
0x8347e183, 0x6b18e66b, 0xc822bdc8, 0x0e98450e,
|
||||
0x6e1fe26e, 0xc9b3f4c9, 0x2f74b62f, 0xcbf866cb,
|
||||
0xff99ccff, 0xea1495ea, 0xed5803ed, 0xf7dc56f7,
|
||||
0xe18bd4e1, 0x1b151c1b, 0xada21ead, 0x0cd3d70c,
|
||||
0x2be2fb2b, 0x1dc8c31d, 0x195e8e19, 0xc22cb5c2,
|
||||
0x8949e989, 0x12c1cf12, 0x7e95bf7e, 0x207dba20,
|
||||
0x6411ea64, 0x840b7784, 0x6dc5396d, 0x6a89af6a,
|
||||
0xd17c33d1, 0xa171c9a1, 0xceff62ce, 0x37bb7137,
|
||||
0xfb0f81fb, 0x3db5793d, 0x51e10951, 0xdc3eaddc,
|
||||
0x2d3f242d, 0xa476cda4, 0x9d55f99d, 0xee82d8ee,
|
||||
0x8640e586, 0xae78c5ae, 0xcd25b9cd, 0x04964d04,
|
||||
0x55774455, 0x0a0e080a, 0x13508613, 0x30f7e730,
|
||||
0xd337a1d3, 0x40fa1d40, 0x3461aa34, 0x8c4eed8c,
|
||||
0xb3b006b3, 0x6c54706c, 0x2a73b22a, 0x523bd252,
|
||||
0x0b9f410b, 0x8b027b8b, 0x88d8a088, 0x4ff3114f,
|
||||
0x67cb3167, 0x4627c246, 0xc06727c0, 0xb4fc90b4,
|
||||
0x28382028, 0x7f04f67f, 0x78486078, 0x2ee5ff2e,
|
||||
0x074c9607, 0x4b655c4b, 0xc72bb1c7, 0x6f8eab6f,
|
||||
0x0d429e0d, 0xbbf59cbb, 0xf2db52f2, 0xf34a1bf3,
|
||||
0xa63d5fa6, 0x59a49359, 0xbcb90abc, 0x3af9ef3a,
|
||||
0xef1391ef, 0xfe0885fe, 0x01914901, 0x6116ee61,
|
||||
0x7cde2d7c, 0xb2214fb2, 0x42b18f42, 0xdb723bdb,
|
||||
0xb82f47b8, 0x48bf8748, 0x2cae6d2c, 0xe3c046e3,
|
||||
0x573cd657, 0x859a3e85, 0x29a96929, 0x7d4f647d,
|
||||
0x94812a94, 0x492ece49, 0x17c6cb17, 0xca692fca,
|
||||
0xc3bdfcc3, 0x5ca3975c, 0x5ee8055e, 0xd0ed7ad0,
|
||||
0x87d1ac87, 0x8e057f8e, 0xba64d5ba, 0xa8a51aa8,
|
||||
0xb7264bb7, 0xb9be0eb9, 0x6087a760, 0xf8d55af8,
|
||||
0x22362822, 0x111b1411, 0xde753fde, 0x79d92979,
|
||||
0xaaee88aa, 0x332d3c33, 0x5f794c5f, 0xb6b702b6,
|
||||
0x96cab896, 0x5835da58, 0x9cc4b09c, 0xfc4317fc,
|
||||
0x1a84551a, 0xf64d1ff6, 0x1c598a1c, 0x38b27d38,
|
||||
0xac3357ac, 0x18cfc718, 0xf4068df4, 0x69537469,
|
||||
0x749bb774, 0xf597c4f5, 0x56ad9f56, 0xdae372da,
|
||||
0xd5ea7ed5, 0x4af4154a, 0x9e8f229e, 0xa2ab12a2,
|
||||
0x4e62584e, 0xe85f07e8, 0xe51d99e5, 0x39233439,
|
||||
0xc1f66ec1, 0x446c5044, 0x5d32de5d, 0x72466872,
|
||||
0x26a06526, 0x93cdbc93, 0x03dadb03, 0xc6baf8c6,
|
||||
0xfa9ec8fa, 0x82d6a882, 0xcf6e2bcf, 0x50704050,
|
||||
0xeb85dceb, 0x750afe75, 0x8a93328a, 0x8ddfa48d,
|
||||
0x4c29ca4c, 0x141c1014, 0x73d72173, 0xccb4f0cc,
|
||||
0x09d4d309, 0x108a5d10, 0xe2510fe2, 0x00000000,
|
||||
0x9a196f9a, 0xe01a9de0, 0x8f94368f, 0xe6c742e6,
|
||||
0xd939a9d9, 0x90176790, 0x719cb371, 0xd2a6e8d2,
|
||||
0x05070405, 0x9852fd98, 0x6580a365, 0xdfe476df,
|
||||
0x08459a08, 0x024b9202, 0xa0e080a0, 0x665a7866,
|
||||
0xddafe4dd, 0xb06addb0, 0xbf63d1bf, 0x362a3836,
|
||||
0x54e60d54, 0x4320c643, 0x62cc3562, 0xbef298be,
|
||||
0x1e12181e, 0x24ebf724, 0xd7a1ecd7, 0x77416c77,
|
||||
0xbd2843bd, 0x32bc7532, 0xd47b37d4, 0x9b88269b,
|
||||
0x700dfa70, 0xf94413f9, 0xb1fb94b1, 0x5a7e485a,
|
||||
0x7a03f27a, 0xe48cd0e4, 0x47b68b47, 0x3c24303c,
|
||||
0xa5e784a5, 0x416b5441, 0x06dddf06, 0xc56023c5,
|
||||
0x45fd1945, 0xa33a5ba3, 0x68c23d68, 0x158d5915,
|
||||
0x21ecf321, 0x3166ae31, 0x3e6fa23e, 0x16578216,
|
||||
0x95106395, 0x5bef015b, 0x4db8834d, 0x91862e91,
|
||||
0xb56dd9b5, 0x1f83511f, 0x53aa9b53, 0x635d7c63,
|
||||
0x3b68a63b, 0x3ffeeb3f, 0xd630a5d6, 0x257abe25,
|
||||
0xa7ac16a7, 0x0f090c0f, 0x35f0e335, 0x23a76123,
|
||||
0xf090c0f0, 0xafe98caf, 0x809d3a80, 0x925cf592,
|
||||
0x810c7381, 0x27312c27, 0x76d02576, 0xe7560be7,
|
||||
0x7b92bb7b, 0xe9ce4ee9, 0xf10189f1, 0x9f1e6b9f,
|
||||
0xa93453a9, 0xc4f16ac4, 0x99c3b499, 0x975bf197,
|
||||
0x8347e183, 0x6b18e66b, 0xc822bdc8, 0x0e98450e,
|
||||
0x6e1fe26e, 0xc9b3f4c9, 0x2f74b62f, 0xcbf866cb,
|
||||
0xff99ccff, 0xea1495ea, 0xed5803ed, 0xf7dc56f7,
|
||||
0xe18bd4e1, 0x1b151c1b, 0xada21ead, 0x0cd3d70c,
|
||||
0x2be2fb2b, 0x1dc8c31d, 0x195e8e19, 0xc22cb5c2,
|
||||
0x8949e989, 0x12c1cf12, 0x7e95bf7e, 0x207dba20,
|
||||
0x6411ea64, 0x840b7784, 0x6dc5396d, 0x6a89af6a,
|
||||
0xd17c33d1, 0xa171c9a1, 0xceff62ce, 0x37bb7137,
|
||||
0xfb0f81fb, 0x3db5793d, 0x51e10951, 0xdc3eaddc,
|
||||
0x2d3f242d, 0xa476cda4, 0x9d55f99d, 0xee82d8ee,
|
||||
0x8640e586, 0xae78c5ae, 0xcd25b9cd, 0x04964d04,
|
||||
0x55774455, 0x0a0e080a, 0x13508613, 0x30f7e730,
|
||||
0xd337a1d3, 0x40fa1d40, 0x3461aa34, 0x8c4eed8c,
|
||||
0xb3b006b3, 0x6c54706c, 0x2a73b22a, 0x523bd252,
|
||||
0x0b9f410b, 0x8b027b8b, 0x88d8a088, 0x4ff3114f,
|
||||
0x67cb3167, 0x4627c246, 0xc06727c0, 0xb4fc90b4,
|
||||
0x28382028, 0x7f04f67f, 0x78486078, 0x2ee5ff2e,
|
||||
0x074c9607, 0x4b655c4b, 0xc72bb1c7, 0x6f8eab6f,
|
||||
0x0d429e0d, 0xbbf59cbb, 0xf2db52f2, 0xf34a1bf3,
|
||||
0xa63d5fa6, 0x59a49359, 0xbcb90abc, 0x3af9ef3a,
|
||||
0xef1391ef, 0xfe0885fe, 0x01914901, 0x6116ee61,
|
||||
0x7cde2d7c, 0xb2214fb2, 0x42b18f42, 0xdb723bdb,
|
||||
0xb82f47b8, 0x48bf8748, 0x2cae6d2c, 0xe3c046e3,
|
||||
0x573cd657, 0x859a3e85, 0x29a96929, 0x7d4f647d,
|
||||
0x94812a94, 0x492ece49, 0x17c6cb17, 0xca692fca,
|
||||
0xc3bdfcc3, 0x5ca3975c, 0x5ee8055e, 0xd0ed7ad0,
|
||||
0x87d1ac87, 0x8e057f8e, 0xba64d5ba, 0xa8a51aa8,
|
||||
0xb7264bb7, 0xb9be0eb9, 0x6087a760, 0xf8d55af8,
|
||||
0x22362822, 0x111b1411, 0xde753fde, 0x79d92979,
|
||||
0xaaee88aa, 0x332d3c33, 0x5f794c5f, 0xb6b702b6,
|
||||
0x96cab896, 0x5835da58, 0x9cc4b09c, 0xfc4317fc,
|
||||
0x1a84551a, 0xf64d1ff6, 0x1c598a1c, 0x38b27d38,
|
||||
0xac3357ac, 0x18cfc718, 0xf4068df4, 0x69537469,
|
||||
0x749bb774, 0xf597c4f5, 0x56ad9f56, 0xdae372da,
|
||||
0xd5ea7ed5, 0x4af4154a, 0x9e8f229e, 0xa2ab12a2,
|
||||
0x4e62584e, 0xe85f07e8, 0xe51d99e5, 0x39233439,
|
||||
0xc1f66ec1, 0x446c5044, 0x5d32de5d, 0x72466872,
|
||||
0x26a06526, 0x93cdbc93, 0x03dadb03, 0xc6baf8c6,
|
||||
0xfa9ec8fa, 0x82d6a882, 0xcf6e2bcf, 0x50704050,
|
||||
0xeb85dceb, 0x750afe75, 0x8a93328a, 0x8ddfa48d,
|
||||
0x4c29ca4c, 0x141c1014, 0x73d72173, 0xccb4f0cc,
|
||||
0x09d4d309, 0x108a5d10, 0xe2510fe2, 0x00000000,
|
||||
0x9a196f9a, 0xe01a9de0, 0x8f94368f, 0xe6c742e6,
|
||||
0xecc94aec, 0xfdd25efd, 0xab7fc1ab, 0xd8a8e0d8};
|
||||
|
||||
NAMESPACE_END
|
||||
|
@ -181,13 +181,13 @@ void Tiger::Transform (word64 *digest, const word64 *X)
|
||||
|
||||
#if CRYPTOPP_BOOL_X32
|
||||
SSE2_pass(mm0, mm1, mm2, 5, esi)
|
||||
SSE2_key_schedule(esp+8, esi)
|
||||
SSE2_key_schedule(esp+8, esi)
|
||||
SSE2_pass(mm2, mm0, mm1, 7, esp+8)
|
||||
SSE2_key_schedule(esp+8, esp+8)
|
||||
SSE2_pass(mm1, mm2, mm0, 9, esp+8)
|
||||
#else
|
||||
SSE2_pass(mm0, mm1, mm2, 5, esi)
|
||||
SSE2_key_schedule(esp+4, esi)
|
||||
SSE2_key_schedule(esp+4, esi)
|
||||
SSE2_pass(mm2, mm0, mm1, 7, esp+4)
|
||||
SSE2_key_schedule(esp+4, esp+4)
|
||||
SSE2_pass(mm1, mm2, mm0, 9, esp+4)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
const word64 Tiger::table[4*256+3] =
|
||||
const word64 Tiger::table[4*256+3] =
|
||||
{
|
||||
W64LIT(0x02AAB17CF7E90C5E) /* 0 */, W64LIT(0xAC424B03E243A8EC) /* 1 */,
|
||||
W64LIT(0x72CD5BE30DD5FCD3) /* 2 */, W64LIT(0x6D019B93F6F97F3A) /* 3 */,
|
||||
|
@ -132,7 +132,7 @@ void Twofish::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock,
|
||||
c ^= m_k[4];
|
||||
d ^= m_k[5];
|
||||
a ^= m_k[6];
|
||||
b ^= m_k[7];
|
||||
b ^= m_k[7];
|
||||
|
||||
Block::Put(xorBlock, outBlock)(c)(d)(a)(b);
|
||||
}
|
||||
|
8
vmac.cpp
8
vmac.cpp
@ -68,7 +68,7 @@ void VMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, con
|
||||
size_t i;
|
||||
|
||||
/* Fill nh key */
|
||||
in[0] = 0x80;
|
||||
in[0] = 0x80;
|
||||
cipher.AdvancedProcessBlocks(in, NULL, (byte *)m_nhKey(), m_nhKeySize()*sizeof(word64), cipher.BT_InBlockIsCounter);
|
||||
ConditionalByteReverse<word64>(BIG_ENDIAN_ORDER, m_nhKey(), m_nhKey(), m_nhKeySize()*sizeof(word64));
|
||||
|
||||
@ -153,9 +153,9 @@ void VMAC_Base::HashEndianCorrectedBlock(const word64 *data)
|
||||
|
||||
unsigned int VMAC_Base::OptimalDataAlignment() const
|
||||
{
|
||||
return
|
||||
return
|
||||
#if (CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)) && !defined(CRYPTOPP_DISABLE_VMAC_ASM)
|
||||
HasSSE2() ? 16 :
|
||||
HasSSE2() ? 16 :
|
||||
#endif
|
||||
GetCipher().OptimalDataAlignment();
|
||||
}
|
||||
@ -687,7 +687,7 @@ void VMAC_Base::VHASH_Update_Template(const word64 *data, size_t blocksRemaining
|
||||
#undef k0
|
||||
#undef k1
|
||||
#undef k2
|
||||
#undef k3
|
||||
#undef k3
|
||||
#undef kHi
|
||||
#else // #if VMAC_BOOL_32BIT
|
||||
if (isFirstBlock)
|
||||
|
14
wait.cpp
14
wait.cpp
@ -63,7 +63,7 @@ void WaitObjectContainer::Clear()
|
||||
# ifdef CRYPTOPP_MSAN
|
||||
__msan_unpoison(&m_readfds, sizeof(m_readfds));
|
||||
__msan_unpoison(&m_writefds, sizeof(m_writefds));
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
m_noWait = false;
|
||||
m_firstEventTime = 0;
|
||||
@ -137,7 +137,7 @@ WaitObjectContainer::~WaitObjectContainer()
|
||||
if (!m_threads.empty())
|
||||
{
|
||||
HANDLE threadHandles[MAXIMUM_WAIT_OBJECTS] = {0};
|
||||
|
||||
|
||||
unsigned int i;
|
||||
for (i=0; i<m_threads.size(); i++)
|
||||
{
|
||||
@ -153,7 +153,7 @@ WaitObjectContainer::~WaitObjectContainer()
|
||||
|
||||
BOOL bResult = PulseEvent(m_startWaiting);
|
||||
assert(bResult != 0); CRYPTOPP_UNUSED(bResult);
|
||||
|
||||
|
||||
// Enterprise Analysis warning
|
||||
#if defined(USE_WINDOWS8_API)
|
||||
DWORD dwResult = ::WaitForMultipleObjectsEx((DWORD)m_threads.size(), threadHandles, TRUE, INFINITE, FALSE);
|
||||
@ -167,7 +167,7 @@ WaitObjectContainer::~WaitObjectContainer()
|
||||
{
|
||||
// Enterprise Analysis warning
|
||||
if (!threadHandles[i]) continue;
|
||||
|
||||
|
||||
bResult = CloseHandle(threadHandles[i]);
|
||||
assert(bResult != 0);
|
||||
}
|
||||
@ -206,7 +206,7 @@ DWORD WINAPI WaitingThread(LPVOID lParam)
|
||||
DWORD result = ::WaitForSingleObject(thread.startWaiting, INFINITE);
|
||||
assert(result != WAIT_FAILED);
|
||||
#endif
|
||||
|
||||
|
||||
thread.waitingToWait = false;
|
||||
if (thread.terminate)
|
||||
break;
|
||||
@ -254,7 +254,7 @@ void WaitObjectContainer::CreateThreads(unsigned int count)
|
||||
{
|
||||
// Enterprise Analysis warning
|
||||
if(!m_threads[i]) continue;
|
||||
|
||||
|
||||
m_threads[i] = new WaitingThreadData;
|
||||
WaitingThreadData &thread = *m_threads[i];
|
||||
thread.terminate = false;
|
||||
@ -304,7 +304,7 @@ bool WaitObjectContainer::Wait(unsigned long milliseconds)
|
||||
throw Err("WaitObjectContainer: number of wait objects exceeds limit");
|
||||
CreateThreads(nThreads);
|
||||
DWORD error = S_OK;
|
||||
|
||||
|
||||
for (unsigned int i=0; i<m_threads.size(); i++)
|
||||
{
|
||||
// Enterprise Analysis warning
|
||||
|
2
wait.h
2
wait.h
@ -117,7 +117,7 @@ protected:
|
||||
and would pass this parameter to subsequent functions they call using the construct:
|
||||
|
||||
SubFunc(arg1, arg2, CallStack("my func at place such and such", &callStack));
|
||||
|
||||
|
||||
The advantage of this approach is that it is easy to use and should be very efficient,
|
||||
involving no allocation from the heap, just a linked list of stack objects containing
|
||||
pointers to static ASCIIZ strings (or possibly additional but simple data if derived). */
|
||||
|
@ -21,7 +21,7 @@
|
||||
* ``The Whirlpool hashing function,''
|
||||
* NESSIE submission, 2000 (tweaked version, 2001),
|
||||
* <https://www.cosic.esat.kuleuven.ac.be/nessie/workshop/submissions/whirlpool.zip>
|
||||
*
|
||||
*
|
||||
* @author Paulo S.L.M. Barreto
|
||||
* @author Vincent Rijmen.
|
||||
*
|
||||
|
@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||
class XTR_DH : public SimpleKeyAgreementDomain, public CryptoParameters
|
||||
{
|
||||
typedef XTR_DH ThisClass;
|
||||
|
||||
|
||||
public:
|
||||
XTR_DH(const Integer &p, const Integer &q, const GFP2Element &g);
|
||||
XTR_DH(RandomNumberGenerator &rng, unsigned int pbits, unsigned int qbits);
|
||||
|
Loading…
Reference in New Issue
Block a user