mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 22:11:35 -06:00
Use RtlGenRandom() as an additional source of entropy
for CRandomGenerator::Init() and 16 bytes IV for AES.
This commit is contained in:
@@ -151,21 +151,10 @@ void CBase::PrepareKey()
|
||||
|
||||
#ifndef EXTRACT_ONLY
|
||||
|
||||
/*
|
||||
STDMETHODIMP CEncoder::ResetSalt()
|
||||
{
|
||||
_key.SaltSize = 4;
|
||||
g_RandomGenerator.Generate(_key.Salt, _key.SaltSize);
|
||||
return S_OK;
|
||||
}
|
||||
*/
|
||||
|
||||
STDMETHODIMP CEncoder::ResetInitVector()
|
||||
{
|
||||
for (unsigned i = 0; i < sizeof(_iv); i++)
|
||||
_iv[i] = 0;
|
||||
_ivSize = 8;
|
||||
g_RandomGenerator.Generate(_iv, _ivSize);
|
||||
_ivSize = sizeof(_iv);
|
||||
g_RandomGenerator.Generate(_iv, sizeof(_iv));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -245,7 +234,6 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size)
|
||||
|| _key.NumCyclesPower == 0x3F) ? S_OK : E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP CBaseCoder::CryptoSetPassword(const Byte *data, UInt32 size)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
|
||||
Reference in New Issue
Block a user