mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Clear truncation warning in rng.cpp (PR #867)
This commit is contained in:
parent
12382a14be
commit
e4c402ace9
11
rng.cpp
11
rng.cpp
@ -40,15 +40,14 @@ void LC_RNG::GenerateBlock(byte *output, size_t size)
|
||||
{
|
||||
while (size--)
|
||||
{
|
||||
word32 hi = seed/q;
|
||||
word32 lo = seed%q;
|
||||
|
||||
sword64 test = a*lo - r*hi;
|
||||
const word32 hi = seed/q;
|
||||
const word32 lo = seed%q;
|
||||
const sword64 test = a*lo - r*hi;
|
||||
|
||||
if (test > 0)
|
||||
seed = test;
|
||||
seed = static_cast<word32>(test);
|
||||
else
|
||||
seed = test+ m;
|
||||
seed = static_cast<word32>(test + m);
|
||||
|
||||
*output++ = byte((GETBYTE(seed, 0) ^ GETBYTE(seed, 1) ^ GETBYTE(seed, 2) ^ GETBYTE(seed, 3)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user