mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2025-03-01 18:06:05 +00:00
Cleared warning 'extra ";" ignored'
This commit is contained in:
parent
f0f060bb8b
commit
bc52b1abf8
24
blake2.cpp
24
blake2.cpp
@ -64,7 +64,7 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_IV {};
|
||||
template<>
|
||||
struct CRYPTOPP_NO_VTABLE BLAKE2_IV<false>
|
||||
{
|
||||
CRYPTOPP_CONSTANT(IVSIZE = 8);
|
||||
CRYPTOPP_CONSTANT(IVSIZE = 8)
|
||||
// Always align for NEON and SSE
|
||||
CRYPTOPP_ALIGN_DATA(16) static const word32 iv[8];
|
||||
};
|
||||
@ -79,7 +79,7 @@ const word32 BLAKE2_IV<false>::iv[8] = {
|
||||
template<>
|
||||
struct CRYPTOPP_NO_VTABLE BLAKE2_IV<true>
|
||||
{
|
||||
CRYPTOPP_CONSTANT(IVSIZE = 8);
|
||||
CRYPTOPP_CONSTANT(IVSIZE = 8)
|
||||
// Always align for NEON and SSE
|
||||
CRYPTOPP_ALIGN_DATA(16) static const word64 iv[8];
|
||||
};
|
||||
@ -278,7 +278,7 @@ void BLAKE2_Base<W, T_64bit>::UncheckedSetKey(const byte *key, unsigned int leng
|
||||
}
|
||||
|
||||
// Zero everything except the two trailing strings
|
||||
ParameterBlock& block = *m_block;
|
||||
ParameterBlock& block = *m_block.data();
|
||||
const size_t head = sizeof(block) - sizeof(block.personalization) - sizeof(block.salt);
|
||||
memset(m_block.data(), 0x00, head);
|
||||
|
||||
@ -351,7 +351,7 @@ template <class W, bool T_64bit>
|
||||
void BLAKE2_Base<W, T_64bit>::Restart()
|
||||
{
|
||||
static const W zero[2] = {0,0};
|
||||
Restart(*m_block, zero);
|
||||
Restart(*m_block.data(), zero);
|
||||
}
|
||||
|
||||
template <class W, bool T_64bit>
|
||||
@ -362,11 +362,11 @@ void BLAKE2_Base<W, T_64bit>::Restart(const BLAKE2_ParameterBlock<T_64bit>& bloc
|
||||
if (&block != m_block.data())
|
||||
{
|
||||
memcpy_s(m_block, sizeof(block), &block, sizeof(block));
|
||||
(*m_block).digestLength = (byte)m_digestSize;
|
||||
(*m_block).keyLength = (byte)m_key.size();
|
||||
(*m_block.data()).digestLength = (byte)m_digestSize;
|
||||
(*m_block.data()).keyLength = (byte)m_key.size();
|
||||
}
|
||||
|
||||
State& state = *m_state;
|
||||
State& state = *m_state.data();
|
||||
state.t[0] = state.t[1] = 0, state.f[0] = state.f[1] = 0, state.length = 0;
|
||||
|
||||
if (counter != NULL)
|
||||
@ -388,7 +388,7 @@ void BLAKE2_Base<W, T_64bit>::Restart(const BLAKE2_ParameterBlock<T_64bit>& bloc
|
||||
template <class W, bool T_64bit>
|
||||
void BLAKE2_Base<W, T_64bit>::Update(const byte *input, size_t length)
|
||||
{
|
||||
State& state = *m_state;
|
||||
State& state = *m_state.data();
|
||||
if (state.length + length > BLOCKSIZE)
|
||||
{
|
||||
// Complete current block
|
||||
@ -423,7 +423,7 @@ void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
|
||||
this->ThrowIfInvalidTruncatedSize(size);
|
||||
|
||||
// Set last block unconditionally
|
||||
State& state = *m_state;
|
||||
State& state = *m_state.data();
|
||||
state.f[0] = static_cast<W>(-1);
|
||||
|
||||
// Set last node if tree mode
|
||||
@ -445,7 +445,7 @@ void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
|
||||
template <class W, bool T_64bit>
|
||||
void BLAKE2_Base<W, T_64bit>::IncrementCounter(size_t count)
|
||||
{
|
||||
State& state = *m_state;
|
||||
State& state = *m_state.data();
|
||||
state.t[0] += static_cast<W>(count);
|
||||
state.t[1] += !!(state.t[0] < count);
|
||||
}
|
||||
@ -455,7 +455,7 @@ void BLAKE2_Base<word64, true>::Compress(const byte *input)
|
||||
{
|
||||
// Selects the most advanced implmentation at runtime
|
||||
static const pfnCompress64 s_pfn = InitializeCompress64Fn();
|
||||
s_pfn(input, *m_state);
|
||||
s_pfn(input, *m_state.data());
|
||||
}
|
||||
|
||||
template <>
|
||||
@ -463,7 +463,7 @@ void BLAKE2_Base<word32, false>::Compress(const byte *input)
|
||||
{
|
||||
// Selects the most advanced implmentation at runtime
|
||||
static const pfnCompress32 s_pfn = InitializeCompress32Fn();
|
||||
s_pfn(input, *m_state);
|
||||
s_pfn(input, *m_state.data());
|
||||
}
|
||||
|
||||
void BLAKE2_CXX_Compress64(const byte* input, BLAKE2_State<word64, true>& state)
|
||||
|
34
blake2.h
34
blake2.h
@ -30,9 +30,9 @@ template <bool T_64bit>
|
||||
struct CRYPTOPP_NO_VTABLE BLAKE2_Info : public VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
|
||||
{
|
||||
typedef VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
|
||||
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH);
|
||||
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH);
|
||||
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH);
|
||||
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH)
|
||||
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH)
|
||||
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH)
|
||||
|
||||
CRYPTOPP_CONSTANT(BLOCKSIZE = (T_64bit ? 128 : 64))
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = (T_64bit ? 64 : 32))
|
||||
@ -56,9 +56,9 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
|
||||
template<>
|
||||
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<true>
|
||||
{
|
||||
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<true>::SALTSIZE);
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<true>::DIGESTSIZE);
|
||||
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<true>::PERSONALIZATIONSIZE);
|
||||
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<true>::SALTSIZE)
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<true>::DIGESTSIZE)
|
||||
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<true>::PERSONALIZATIONSIZE)
|
||||
|
||||
BLAKE2_ParameterBlock()
|
||||
{
|
||||
@ -91,9 +91,9 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<true>
|
||||
template<>
|
||||
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<false>
|
||||
{
|
||||
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<false>::SALTSIZE);
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<false>::DIGESTSIZE);
|
||||
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<false>::PERSONALIZATIONSIZE);
|
||||
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<false>::SALTSIZE)
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<false>::DIGESTSIZE)
|
||||
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<false>::PERSONALIZATIONSIZE)
|
||||
|
||||
BLAKE2_ParameterBlock()
|
||||
{
|
||||
@ -131,7 +131,7 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<false>
|
||||
template <class W, bool T_64bit>
|
||||
struct CRYPTOPP_NO_VTABLE BLAKE2_State
|
||||
{
|
||||
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE);
|
||||
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE)
|
||||
|
||||
BLAKE2_State()
|
||||
{
|
||||
@ -157,14 +157,14 @@ template <class W, bool T_64bit>
|
||||
class BLAKE2_Base : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2_Info<T_64bit> >
|
||||
{
|
||||
public:
|
||||
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2_Info<T_64bit>::DEFAULT_KEYLENGTH);
|
||||
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2_Info<T_64bit>::MIN_KEYLENGTH);
|
||||
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2_Info<T_64bit>::MAX_KEYLENGTH);
|
||||
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2_Info<T_64bit>::DEFAULT_KEYLENGTH)
|
||||
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2_Info<T_64bit>::MIN_KEYLENGTH)
|
||||
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2_Info<T_64bit>::MAX_KEYLENGTH)
|
||||
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<T_64bit>::DIGESTSIZE);
|
||||
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE);
|
||||
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<T_64bit>::SALTSIZE);
|
||||
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<T_64bit>::PERSONALIZATIONSIZE);
|
||||
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<T_64bit>::DIGESTSIZE)
|
||||
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE)
|
||||
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<T_64bit>::SALTSIZE)
|
||||
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<T_64bit>::PERSONALIZATIONSIZE)
|
||||
|
||||
typedef BLAKE2_ParameterBlock<T_64bit> ParameterBlock;
|
||||
typedef BLAKE2_State<W, T_64bit> State;
|
||||
|
Loading…
x
Reference in New Issue
Block a user