mirror of
https://github.com/adamdruppe/arsd.git
synced 2025-04-26 21:30:12 +03:00
wip
This commit is contained in:
parent
14a3240323
commit
91b85ea44b
7 changed files with 1301 additions and 110 deletions
5
argon2.d
5
argon2.d
|
@ -69,10 +69,15 @@ string encode(string password, SecurityParameters params = MediumSecurity) {
|
|||
auto ret = read(fd, salt.ptr, salt.length);
|
||||
assert(ret == salt.length);
|
||||
close(fd);
|
||||
}} else version(Windows) {{
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom
|
||||
static assert(0);
|
||||
}} else {
|
||||
import std.random;
|
||||
foreach(ref s; salt)
|
||||
s = cast(ubyte) uniform(0, 256);
|
||||
|
||||
static assert(0, "csrng not implemented");
|
||||
}
|
||||
|
||||
auto ret = argon2id_hash_encoded(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue