mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 01:49:41 +00:00
Add GenerateKeystream to HC256
This keeps HC-128 and HC-256 consistent
This commit is contained in:
parent
0bf8798835
commit
c6a16ea573
13
hc256.cpp
13
hc256.cpp
@ -88,6 +88,14 @@ inline word32 HC256Policy::Generate() /*one step of the cipher*/
|
||||
return (output);
|
||||
}
|
||||
|
||||
void HC256Policy::GenerateKeystream(word32 keystream[4])
|
||||
{
|
||||
keystream[0] = Generate();
|
||||
keystream[1] = Generate();
|
||||
keystream[2] = Generate();
|
||||
keystream[3] = Generate();
|
||||
}
|
||||
|
||||
void HC256Policy::CipherSetKey(const NameValuePairs ¶ms, const byte *userKey, size_t keylen)
|
||||
{
|
||||
CRYPTOPP_UNUSED(params); CRYPTOPP_UNUSED(keylen);
|
||||
@ -108,10 +116,7 @@ void HC256Policy::OperateKeystream(KeystreamOperation operation, byte *output, c
|
||||
while (iterationCount--)
|
||||
{
|
||||
FixedSizeSecBlock<word32, 4> keystream;
|
||||
keystream[0] = Generate();
|
||||
keystream[1] = Generate();
|
||||
keystream[2] = Generate();
|
||||
keystream[3] = Generate();
|
||||
GenerateKeystream(keystream);
|
||||
|
||||
CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(HC256_OUTPUT, BYTES_PER_ITERATION);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user