aboutsummaryrefslogtreecommitdiff
path: root/lib/std/crypto/bcrypt.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-11-16 13:39:31 -0800
committerGitHub <noreply@github.com>2020-11-16 13:39:31 -0800
commitba967ae9a1eada3a08803470f557bafcfb69151e (patch)
tree34ea140e3b9ee6ceec225e20c2dc483feb75dc81 /lib/std/crypto/bcrypt.zig
parent8f47e8feb60e60cc85674a9eef281197ed8a7c27 (diff)
parent7f9e3e419c24ba51e80a4c41bcbefc820f7e0a88 (diff)
downloadzig-ba967ae9a1eada3a08803470f557bafcfb69151e.tar.gz
zig-ba967ae9a1eada3a08803470f557bafcfb69151e.zip
Merge pull request #7002 from jedisct1/timingSafeEqlMinimal
Add mem.timingSafeEql() for constant-time array comparison
Diffstat (limited to 'lib/std/crypto/bcrypt.zig')
-rw-r--r--lib/std/crypto/bcrypt.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/crypto/bcrypt.zig b/lib/std/crypto/bcrypt.zig
index 179d904494..4cec59961b 100644
--- a/lib/std/crypto/bcrypt.zig
+++ b/lib/std/crypto/bcrypt.zig
@@ -11,6 +11,7 @@ const math = std.math;
const mem = std.mem;
const debug = std.debug;
const testing = std.testing;
+const utils = std.crypto.utils;
const salt_length: usize = 16;
const salt_str_length: usize = 22;
@@ -226,7 +227,7 @@ fn strHashInternal(password: []const u8, rounds_log: u6, salt: [salt_length]u8)
state.expand0(passwordZ);
state.expand0(salt[0..]);
}
- mem.secureZero(u8, &password_buf);
+ utils.secureZero(u8, &password_buf);
var cdata = [6]u32{ 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274 }; // "OrpheanBeholderScryDoubt"
k = 0;