summaryrefslogtreecommitdiffhomepage
path: root/src/3p/monocypher/monocypher-rng.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-06-22 00:06:39 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-06-22 00:06:39 +0100
commitf2471014aae74c089eda1461a740001d77c233f2 (patch)
tree38a40fdd015b027f7485e31166be92370aeeac8f /src/3p/monocypher/monocypher-rng.c
parentc56e38820fff8fdffc55efe081225eb71b964d25 (diff)
Update Monocypher yet again, to 4.0.1
There's a solid chance this actually gets used this time. Plus, there's breaking changes, so it makes sense to update before writing any actual code for it. The RNG module is also manually fixed up; upstream wasn't moved to the new Monocypher APIs which might be because the authors don't seem to think it's even a good idea to use anything other than arc4random(). Maybe I'd kind of agree with that if not for both Linux and Windows not having arc4random(), and none of SSTs use cases requiring it either (none of the crypto code is gonna be multithreaded and certainly none of it is gonna fork).
Diffstat (limited to 'src/3p/monocypher/monocypher-rng.c')
-rw-r--r--src/3p/monocypher/monocypher-rng.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/3p/monocypher/monocypher-rng.c b/src/3p/monocypher/monocypher-rng.c
index d59fc76..daa6a07 100644
--- a/src/3p/monocypher/monocypher-rng.c
+++ b/src/3p/monocypher/monocypher-rng.c
@@ -76,7 +76,7 @@ void crypto_rng_read(crypto_rng_ctx *ctx, uint8_t *buf, size_t size)
size_t pool_size = 512 - ctx->idx;
while (size > pool_size) {
copy(buf, ctx->pool + ctx->idx, pool_size);
- crypto_chacha20(ctx->pool, 0, 512, ctx->pool, zero);
+ crypto_chacha20_djb(ctx->pool, 0, 512, ctx->pool, zero, 0);
size -= pool_size;
buf += pool_size;
ctx->idx = 32;