Migrate cipher to ChaCha20

This commit is contained in:
xAnavrins
2019-04-24 00:35:17 -04:00
parent 7317e1b73b
commit 3f5b18a886
2 changed files with 170 additions and 134 deletions

View File

@@ -10,6 +10,15 @@ local _sformat = string.format
local _srep = string.rep
local _ssub = string.sub
function Util.hexToByteArray(str)
local r = {}
str = tostring(str)
for b in str:gmatch("%x%x?") do
r[#r+1] = tonumber(b, 16)
end
return r
end
function Util.tryTimed(timeout, f, ...)
local c = os.clock()
repeat