hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 39332326aa2b6f5e79cf9fed4e9ab28e6f6e3dd1
parent 7bfe6247347e0635d93700d9491b78ccaee44f1b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon, 10 Jan 2022 12:02:22 +0100

crypto::argon2: accept config as pointer

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mcrypto/argon2/+test.ha | 8++++----
Mcrypto/argon2/argon2.ha | 12++++++------
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/crypto/argon2/+test.ha b/crypto/argon2/+test.ha @@ -24,7 +24,7 @@ use bytes; ... }; - argon2d(result[..], pass, salt, cfg)!; + argon2d(result[..], pass, salt, &cfg)!; assert(bytes::equal(result, expected)); }; @@ -56,7 +56,7 @@ use bytes; ... }; - argon2d(result[..], pass, salt, cfg)!; + argon2d(result[..], pass, salt, &cfg)!; assert(bytes::equal(result, expected)); }; @@ -89,7 +89,7 @@ use bytes; ... }; - argon2i(result[..], pass, salt, cfg)!; + argon2i(result[..], pass, salt, &cfg)!; assert(bytes::equal(result, expected)); }; @@ -121,7 +121,7 @@ use bytes; ... }; - argon2id(result[..], pass, salt, cfg)!; + argon2id(result[..], pass, salt, &cfg)!; assert(bytes::equal(result, expected)); }; diff --git a/crypto/argon2/argon2.ha b/crypto/argon2/argon2.ha @@ -104,7 +104,7 @@ export fn argon2d( dest: []u8, password: []u8, salt: []u8, - cfg: config + cfg: *config, ) (void | nomem) = { return argon2(dest, password, salt, cfg, mode::D); }; @@ -122,7 +122,7 @@ export fn argon2i( dest: []u8, password: []u8, salt: []u8, - cfg: config + cfg: *config, ) (void | nomem) = { return argon2(dest, password, salt, cfg, mode::I); }; @@ -138,7 +138,7 @@ export fn argon2id( dest: []u8, password: []u8, salt: []u8, - cfg: config + cfg: *config, ) (void | nomem) = { return argon2(dest, password, salt, cfg, mode::ID); }; @@ -147,7 +147,7 @@ fn argon2( dest: []u8, password: []u8, salt: []u8, - cfg: config, + cfg: *config, mode: mode, ) (void | nomem) = { assert(endian::host == &endian::little, "TODO big endian support"); @@ -218,7 +218,7 @@ fn argon2( for (ctx.pass < cfg.passes; ctx.pass += 1) { for (let s = 0z; s < SLICES; s += 1) { for (let i = 0z; i < ctx.rows; i += 1) { - segproc(&cfg, &ctx, i, s); + segproc(cfg, &ctx, i, s); }; }; }; @@ -286,7 +286,7 @@ fn inithash( taglen: u32, password: []u8, salt: []u8, - cfg: config, + cfg: *config, mode: mode, memsize: u32, ) void = {