reticulum-zero/src/crypto/sha256.zig

17 lines
398 B
Zig
Raw Normal View History

const Sha256 = @import("std").crypto.hash.sha2.Sha256;
pub const hash_len: comptime_int = Sha256.digest_length;
pub const Implementation = struct {
hash: *const fn (buffer: []const u8, out: *[hash_len]u8) void,
};
pub fn hash(buffer: []const u8, out: *[hash_len]u8) !void {
Sha256.hash(buffer, out, .{});
}
pub const defaultImplementation: Implementation = .{
.hash = hash,
};