From 6fbbab378a824ec84a737968ea79962224f0e984 Mon Sep 17 00:00:00 2001 From: Miguel Oliveira Date: Tue, 11 Apr 2023 16:46:13 -0300 Subject: [PATCH] Simplify random initialization The entropy is now provided by the user. They are tasked with finding a high-quality source of entropy to initialize the generator with. --- ccryptolib/random.lua | 95 +++++++++---------------------------------- spec/x25519_spec.lua | 2 + spec/x25519c_spec.lua | 2 + 3 files changed, 23 insertions(+), 76 deletions(-) diff --git a/ccryptolib/random.lua b/ccryptolib/random.lua index c871edf..25e899d 100644 --- a/ccryptolib/random.lua +++ b/ccryptolib/random.lua @@ -1,14 +1,15 @@ local expect = require "cc.expect".expect local blake3 = require "ccryptolib.blake3" local chacha20 = require "ccryptolib.chacha20" -local packing = require "ccryptolib.internal.packing" +local util = require "ccryptolib.internal.util" -local u1x4, fmt1x4 = packing.compileUnpack("