reticulum-zero/src/crypto/sha512.zig

17 lines
397 B
Zig
Raw Normal View History

2026-07-10 19:17:22 +02:00
const Sha512 = @import("std").crypto.hash.sha2.Sha512;
pub const hash_len: comptime_int = Sha512.digest_length;
pub const Implementation = struct {
2026-07-10 19:17:22 +02:00
hash: *const fn (buffer: []const u8, out: *[hash_len]u8) void,
};
2026-07-10 19:17:22 +02:00
pub fn hash(buffer: []const u8, out: *[hash_len]u8) void {
Sha512.hash(buffer, out, .{});
}
pub const defaultImplementation: Implementation = .{
.hash = hash,
};