argon2 experiment
This commit is contained in:
16
lib/auth.lua
Normal file
16
lib/auth.lua
Normal file
@ -0,0 +1,16 @@
|
||||
local auth = {}
|
||||
|
||||
local ls = require "luasodium"
|
||||
|
||||
function auth.digest(password)
|
||||
return ls.crypto_pwhash_str(
|
||||
password,
|
||||
ls.crypto_pwhash_OPSLIMIT_INTERACTIVE,
|
||||
ls.crypto_pwhash_MEMLIMIT_INTERACTIVE)
|
||||
end
|
||||
|
||||
function auth.verify(password, hash)
|
||||
return ls.crypto_pwhash_str_verify(hash, password)
|
||||
end
|
||||
|
||||
return auth
|
Reference in New Issue
Block a user