Fixed naming inconsietencies across crypto submodules

This commit is contained in:
Gu://em_ 2026-07-09 23:49:37 +02:00
parent 891727d959
commit fc71c1a65b
2 changed files with 40 additions and 39 deletions

View file

@ -15,7 +15,7 @@ const RANDOM = @import("crypto/random.zig");
//
pub const PartialEngine = struct {
aes_cbc256: ? AES.CBC256_Implementation = null,
aes_cbc256: ? AES.CBC256.Implementation = null,
ed25519: ? ED25519.Implementation = null,
hkdf: ? HKDF.Implementation = null,
hmac: ? HMAC.Implementation = null,
@ -26,7 +26,7 @@ pub const PartialEngine = struct {
};
pub const Engine = struct {
aes_cbc256: AES.CBC256_Implementation,
aes_cbc256: AES.CBC256.Implementation,
ed25519: ED25519.Implementation,
hkdf: HKDF.Implementation,
hmac: HMAC.Implementation,
@ -45,18 +45,15 @@ pub const Engine = struct {
// function and its sub-structs.
pub fn resolveEngine(comptime provider: PartialEngine) Engine {
// Used by other engine components
const randomImpl = provider.random orelse RANDOM.defaultImplementation;
return .{
.aes_cbc256 = provider.aes_cbc256 orelse AES.CBC256_DefaultImplementation,
.ed25519 = provider.ed25519 orelse ED25519.defaultImplementation(randomImpl),
.hkdf = provider.hkdf orelse HKDF.DefaultImplementation,
.hmac = provider.hmac orelse HMAC.DefaultImplementation,
.sha256 = provider.sha256 orelse SHA256.DefaultImplementation,
.sha512 = provider.sha512 orelse SHA512.DefaultImplementation,
.x25519 = provider.x25519 orelse X25519.DefaultImplementation,
.random = randomImpl,
.aes_cbc256 = provider.aes_cbc256 orelse AES.CBC256.defaultImplementation,
.ed25519 = provider.ed25519 orelse ED25519.defaultImplementation,
.hkdf = provider.hkdf orelse HKDF.defaultImplementation,
.hmac = provider.hmac orelse HMAC.defaultImplementation,
.sha256 = provider.sha256 orelse SHA256.defaultImplementation,
.sha512 = provider.sha512 orelse SHA512.defaultImplementation,
.x25519 = provider.x25519 orelse X25519.defaultImplementation,
.random = provider.random orelse RANDOM.defaultImplementation,
};
}