remove compiler warnings
parent
56664d43be
commit
36dbae5fc1
|
|
@ -1598,48 +1598,6 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="modexppc.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="1"
|
|
||||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;CRYPTOPP_EXPORTS;CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1;USE_PRECOMPILED_HEADERS;$(NoInherit)"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;CRYPTOPP_EXPORTS;CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1;USE_PRECOMPILED_HEADERS;$(NoInherit)"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="1"
|
|
||||||
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;CRYPTOPP_EXPORTS;CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1;USE_PRECOMPILED_HEADERS;$(NoInherit)"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;CRYPTOPP_EXPORTS;CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2=1;USE_PRECOMPILED_HEADERS;$(NoInherit)"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="mqueue.cpp"
|
RelativePath="mqueue.cpp"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -2959,6 +2959,7 @@
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="Release|Win32"
|
Name="Release|Win32"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -2968,6 +2969,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="Release|x64"
|
Name="Release|x64"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -2977,6 +2979,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="DLL-Import Release|Win32"
|
Name="DLL-Import Release|Win32"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -2986,6 +2989,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="DLL-Import Release|x64"
|
Name="DLL-Import Release|x64"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -2995,6 +2999,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="Debug|Win32"
|
Name="Debug|Win32"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -3004,6 +3009,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="Debug|x64"
|
Name="Debug|x64"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -3013,6 +3019,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="DLL-Import Debug|Win32"
|
Name="DLL-Import Debug|Win32"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -3022,6 +3029,7 @@
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="DLL-Import Debug|x64"
|
Name="DLL-Import Debug|x64"
|
||||||
|
ExcludedFromBuild="true"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
|
@ -5158,82 +5166,6 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="modexppc.cpp"
|
|
||||||
>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="1"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="1"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DLL-Import Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="2"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DLL-Import Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="2"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DLL-Import Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="DLL-Import Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="mqueue.cpp"
|
RelativePath="mqueue.cpp"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
58
misc.h
58
misc.h
|
|
@ -163,6 +163,8 @@ template <class T> inline const T& STDMAX(const T& a, const T& b)
|
||||||
// #define GETBYTE(x, y) (unsigned int)(((x)>>(8*(y)))&255)
|
// #define GETBYTE(x, y) (unsigned int)(((x)>>(8*(y)))&255)
|
||||||
// #define GETBYTE(x, y) (((byte *)&(x))[y])
|
// #define GETBYTE(x, y) (((byte *)&(x))[y])
|
||||||
|
|
||||||
|
#define CRYPTOPP_GET_BYTE_AS_BYTE(x, y) byte((x)>>(8*(y)))
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
unsigned int Parity(T value)
|
unsigned int Parity(T value)
|
||||||
{
|
{
|
||||||
|
|
@ -688,13 +690,13 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, word16 value, const b
|
||||||
{
|
{
|
||||||
if (order == BIG_ENDIAN_ORDER)
|
if (order == BIG_ENDIAN_ORDER)
|
||||||
{
|
{
|
||||||
block[0] = GETBYTE(value, 1);
|
block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1);
|
||||||
block[1] = GETBYTE(value, 0);
|
block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
block[0] = GETBYTE(value, 0);
|
block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0);
|
||||||
block[1] = GETBYTE(value, 1);
|
block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xorBlock)
|
if (xorBlock)
|
||||||
|
|
@ -708,17 +710,17 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, word32 value, const b
|
||||||
{
|
{
|
||||||
if (order == BIG_ENDIAN_ORDER)
|
if (order == BIG_ENDIAN_ORDER)
|
||||||
{
|
{
|
||||||
block[0] = GETBYTE(value, 3);
|
block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3);
|
||||||
block[1] = GETBYTE(value, 2);
|
block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2);
|
||||||
block[2] = GETBYTE(value, 1);
|
block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1);
|
||||||
block[3] = GETBYTE(value, 0);
|
block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
block[0] = GETBYTE(value, 0);
|
block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0);
|
||||||
block[1] = GETBYTE(value, 1);
|
block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1);
|
||||||
block[2] = GETBYTE(value, 2);
|
block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2);
|
||||||
block[3] = GETBYTE(value, 3);
|
block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xorBlock)
|
if (xorBlock)
|
||||||
|
|
@ -735,25 +737,25 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, word64 value, const b
|
||||||
{
|
{
|
||||||
if (order == BIG_ENDIAN_ORDER)
|
if (order == BIG_ENDIAN_ORDER)
|
||||||
{
|
{
|
||||||
block[0] = GETBYTE(value, 7);
|
block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 7);
|
||||||
block[1] = GETBYTE(value, 6);
|
block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 6);
|
||||||
block[2] = GETBYTE(value, 5);
|
block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 5);
|
||||||
block[3] = GETBYTE(value, 4);
|
block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 4);
|
||||||
block[4] = GETBYTE(value, 3);
|
block[4] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3);
|
||||||
block[5] = GETBYTE(value, 2);
|
block[5] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2);
|
||||||
block[6] = GETBYTE(value, 1);
|
block[6] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1);
|
||||||
block[7] = GETBYTE(value, 0);
|
block[7] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
block[0] = GETBYTE(value, 0);
|
block[0] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 0);
|
||||||
block[1] = GETBYTE(value, 1);
|
block[1] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 1);
|
||||||
block[2] = GETBYTE(value, 2);
|
block[2] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 2);
|
||||||
block[3] = GETBYTE(value, 3);
|
block[3] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 3);
|
||||||
block[4] = GETBYTE(value, 4);
|
block[4] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 4);
|
||||||
block[5] = GETBYTE(value, 5);
|
block[5] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 5);
|
||||||
block[6] = GETBYTE(value, 6);
|
block[6] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 6);
|
||||||
block[7] = GETBYTE(value, 7);
|
block[7] = CRYPTOPP_GET_BYTE_AS_BYTE(value, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xorBlock)
|
if (xorBlock)
|
||||||
|
|
|
||||||
80
modexppc.cpp
80
modexppc.cpp
|
|
@ -1,80 +0,0 @@
|
||||||
// modexppc.cpp - written and placed in the public domain by Wei Dai
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
|
|
||||||
#ifndef CRYPTOPP_IMPORTS
|
|
||||||
|
|
||||||
#include "modexppc.h"
|
|
||||||
#include "asn.h"
|
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
|
||||||
|
|
||||||
/*
|
|
||||||
ModExpPrecomputation& ModExpPrecomputation::operator=(const ModExpPrecomputation &rhs)
|
|
||||||
{
|
|
||||||
m_base = rhs.m_base;
|
|
||||||
m_mr = rhs.m_mr;
|
|
||||||
m_ep = rhs.m_ep;
|
|
||||||
if (m_mr.get() != NULL)
|
|
||||||
m_ep.m_group = &m_mr->MultiplicativeGroup();
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModExpPrecomputation::SetModulusAndBase(const Integer &modulus, const Integer &base)
|
|
||||||
{
|
|
||||||
m_base = base;
|
|
||||||
if (m_mr.get() == NULL || modulus != m_mr->GetModulus())
|
|
||||||
m_mr.reset(new MontgomeryRepresentation(modulus));
|
|
||||||
m_ep.SetGroupAndBase(m_mr->MultiplicativeGroup(), m_mr->ConvertIn(base));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModExpPrecomputation::SetBase(const Integer &base)
|
|
||||||
{
|
|
||||||
m_base = base;
|
|
||||||
m_ep.SetGroupAndBase(m_mr->MultiplicativeGroup(), m_mr->ConvertIn(base));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModExpPrecomputation::Precompute(unsigned int maxExpBits, unsigned int storage)
|
|
||||||
{
|
|
||||||
m_ep.Precompute(maxExpBits, storage);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModExpPrecomputation::Load(BufferedTransformation &bt)
|
|
||||||
{
|
|
||||||
BERSequenceDecoder seq(bt);
|
|
||||||
word32 version;
|
|
||||||
BERDecodeUnsigned<word32>(seq, version, INTEGER, 1, 1);
|
|
||||||
m_ep.m_exponentBase.BERDecode(seq);
|
|
||||||
m_ep.m_windowSize = m_ep.m_exponentBase.BitCount() - 1;
|
|
||||||
m_ep.m_bases.clear();
|
|
||||||
while (!seq.EndReached())
|
|
||||||
m_ep.m_bases.push_back(Integer(seq));
|
|
||||||
if (!m_ep.m_bases.empty())
|
|
||||||
m_base = m_mr->ConvertOut(m_ep.m_bases[0]);
|
|
||||||
seq.MessageEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModExpPrecomputation::Save(BufferedTransformation &bt) const
|
|
||||||
{
|
|
||||||
DERSequenceEncoder seq(bt);
|
|
||||||
DEREncodeUnsigned<word32>(seq, 1); // version
|
|
||||||
m_ep.m_exponentBase.DEREncode(seq);
|
|
||||||
for (unsigned i=0; i<m_ep.m_bases.size(); i++)
|
|
||||||
m_ep.m_bases[i].DEREncode(seq);
|
|
||||||
seq.MessageEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer ModExpPrecomputation::Exponentiate(const Integer &exponent) const
|
|
||||||
{
|
|
||||||
return m_mr->ConvertOut(m_ep.Exponentiate(exponent));
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer ModExpPrecomputation::CascadeExponentiate(const Integer &exponent, const DL_FixedBasePrecomputation<Integer> &pc2, const Integer &exponent2) const
|
|
||||||
{
|
|
||||||
return m_mr->ConvertOut(m_ep.CascadeExponentiate(exponent, static_cast<const ModExpPrecomputation &>(pc2).m_ep, exponent2));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
NAMESPACE_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Loading…
Reference in New Issue