Refactored the crypto submodules to comply with the engine resolution method

This commit is contained in:
Gu://em_ 2026-07-09 23:42:48 +02:00
parent c292832280
commit 891727d959
9 changed files with 132 additions and 133 deletions

View file

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