Fixed remaining compilation issues
This commit is contained in:
parent
fc71c1a65b
commit
e594fab52f
6 changed files with 33 additions and 21 deletions
|
|
@ -1,16 +1,13 @@
|
|||
const Sha512 = @import("std").crypto.sha2.Sha512;
|
||||
const Sha512 = @import("std").crypto.hash.sha2.Sha512;
|
||||
|
||||
pub const hash_len: comptime_int = Sha512.digest_length;
|
||||
|
||||
pub const Implementation = struct {
|
||||
|
||||
hash: *const fn (buffer: []const u8, out: []u8) void,
|
||||
hash: *const fn (buffer: []const u8, out: *[hash_len]u8) void,
|
||||
};
|
||||
|
||||
fn hash(buffer: []const u8, out: []u8) !void {
|
||||
if (out.len < hash_len) {
|
||||
return error.BufferTooShort;
|
||||
}
|
||||
pub fn hash(buffer: []const u8, out: *[hash_len]u8) void {
|
||||
Sha512.hash(buffer, out, .{});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue