Add ChaCha20 encryption option (XOR)

This commit is contained in:
Jonas Schnelli
2019-03-01 17:03:58 +01:00
parent a6d7026a45
commit 2bc2b8b49a
5 changed files with 185 additions and 16 deletions

View File

@@ -652,7 +652,7 @@ std::vector<unsigned char> FastRandomContext::randbytes(size_t len)
if (requires_seed) RandomSeed();
std::vector<unsigned char> ret(len);
if (len > 0) {
rng.Output(&ret[0], len);
rng.Keystream(&ret[0], len);
}
return ret;
}