aboutsummaryrefslogtreecommitdiff
path: root/lib/std/crypto
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-30 18:48:31 -0800
committerGitHub <noreply@github.com>2021-11-30 18:48:31 -0800
commit7355a201336c8e3892427e5932fe5cdd46cf96df (patch)
tree4ccec922634586847d02f2324d0db75f25200188 /lib/std/crypto
parentdd62a6d2e8de522187fd096354e7156cca1821c5 (diff)
parent066eaa5e9cbfde172449f6d95bb884c7d86ac10c (diff)
downloadzig-7355a201336c8e3892427e5932fe5cdd46cf96df.tar.gz
zig-7355a201336c8e3892427e5932fe5cdd46cf96df.zip
Merge pull request #10055 from leecannon/allocator_refactor
Allocgate
Diffstat (limited to 'lib/std/crypto')
-rw-r--r--lib/std/crypto/argon2.zig14
-rw-r--r--lib/std/crypto/bcrypt.zig4
-rw-r--r--lib/std/crypto/benchmark.zig2
-rw-r--r--lib/std/crypto/scrypt.zig16
4 files changed, 18 insertions, 18 deletions
diff --git a/lib/std/crypto/argon2.zig b/lib/std/crypto/argon2.zig
index 66cd8b38f1..493f36ca94 100644
--- a/lib/std/crypto/argon2.zig
+++ b/lib/std/crypto/argon2.zig
@@ -201,7 +201,7 @@ fn initBlocks(
}
fn processBlocks(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
blocks: *Blocks,
time: u32,
memory: u32,
@@ -240,7 +240,7 @@ fn processBlocksSt(
}
fn processBlocksMt(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
blocks: *Blocks,
time: u32,
memory: u32,
@@ -480,7 +480,7 @@ fn indexAlpha(
///
/// Salt has to be at least 8 bytes length.
pub fn kdf(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
derived_key: []u8,
password: []const u8,
salt: []const u8,
@@ -524,7 +524,7 @@ const PhcFormatHasher = struct {
};
pub fn create(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
password: []const u8,
params: Params,
mode: Mode,
@@ -550,7 +550,7 @@ const PhcFormatHasher = struct {
}
pub fn verify(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
str: []const u8,
password: []const u8,
) HasherError!void {
@@ -579,7 +579,7 @@ const PhcFormatHasher = struct {
///
/// Only phc encoding is supported.
pub const HashOptions = struct {
- allocator: ?*mem.Allocator,
+ allocator: ?mem.Allocator,
params: Params,
mode: Mode = .argon2id,
encoding: pwhash.Encoding = .phc,
@@ -609,7 +609,7 @@ pub fn strHash(
///
/// Allocator is required for argon2.
pub const VerifyOptions = struct {
- allocator: ?*mem.Allocator,
+ allocator: ?mem.Allocator,
};
/// Verify that a previously computed hash is valid for a given password.
diff --git a/lib/std/crypto/bcrypt.zig b/lib/std/crypto/bcrypt.zig
index d8c4d67453..bd3c9ca7d4 100644
--- a/lib/std/crypto/bcrypt.zig
+++ b/lib/std/crypto/bcrypt.zig
@@ -368,7 +368,7 @@ const CryptFormatHasher = struct {
/// Options for hashing a password.
pub const HashOptions = struct {
- allocator: ?*mem.Allocator = null,
+ allocator: ?mem.Allocator = null,
params: Params,
encoding: pwhash.Encoding,
};
@@ -394,7 +394,7 @@ pub fn strHash(
/// Options for hash verification.
pub const VerifyOptions = struct {
- allocator: ?*mem.Allocator = null,
+ allocator: ?mem.Allocator = null,
};
/// Verify that a previously computed hash is valid for a given password.
diff --git a/lib/std/crypto/benchmark.zig b/lib/std/crypto/benchmark.zig
index 4836de032e..9fd3c42544 100644
--- a/lib/std/crypto/benchmark.zig
+++ b/lib/std/crypto/benchmark.zig
@@ -363,7 +363,7 @@ pub fn main() !void {
var buffer: [1024]u8 = undefined;
var fixed = std.heap.FixedBufferAllocator.init(buffer[0..]);
- const args = try std.process.argsAlloc(&fixed.allocator);
+ const args = try std.process.argsAlloc(fixed.allocator());
var filter: ?[]u8 = "";
diff --git a/lib/std/crypto/scrypt.zig b/lib/std/crypto/scrypt.zig
index b17952dcd6..e464cca28e 100644
--- a/lib/std/crypto/scrypt.zig
+++ b/lib/std/crypto/scrypt.zig
@@ -161,7 +161,7 @@ pub const Params = struct {
///
/// scrypt is defined in RFC 7914.
///
-/// allocator: *mem.Allocator.
+/// allocator: mem.Allocator.
///
/// derived_key: Slice of appropriate size for generated key. Generally 16 or 32 bytes in length.
/// May be uninitialized. All bytes will be overwritten.
@@ -173,7 +173,7 @@ pub const Params = struct {
///
/// params: Params.
pub fn kdf(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
derived_key: []u8,
password: []const u8,
salt: []const u8,
@@ -406,7 +406,7 @@ const PhcFormatHasher = struct {
/// Return a non-deterministic hash of the password encoded as a PHC-format string
pub fn create(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
password: []const u8,
params: Params,
buf: []u8,
@@ -429,7 +429,7 @@ const PhcFormatHasher = struct {
/// Verify a password against a PHC-format encoded string
pub fn verify(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
str: []const u8,
password: []const u8,
) HasherError!void {
@@ -455,7 +455,7 @@ const CryptFormatHasher = struct {
/// Return a non-deterministic hash of the password encoded into the modular crypt format
pub fn create(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
password: []const u8,
params: Params,
buf: []u8,
@@ -478,7 +478,7 @@ const CryptFormatHasher = struct {
/// Verify a password against a string in modular crypt format
pub fn verify(
- allocator: *mem.Allocator,
+ allocator: mem.Allocator,
str: []const u8,
password: []const u8,
) HasherError!void {
@@ -497,7 +497,7 @@ const CryptFormatHasher = struct {
///
/// Allocator is required for scrypt.
pub const HashOptions = struct {
- allocator: ?*mem.Allocator,
+ allocator: ?mem.Allocator,
params: Params,
encoding: pwhash.Encoding,
};
@@ -520,7 +520,7 @@ pub fn strHash(
///
/// Allocator is required for scrypt.
pub const VerifyOptions = struct {
- allocator: ?*mem.Allocator,
+ allocator: ?mem.Allocator,
};
/// Verify that a previously computed hash is valid for a given password.