2026-06-15 15:23:41 +02:00
|
|
|
pub const CBC256_Implementation = struct {
|
|
|
|
|
|
|
|
|
|
pub const BLOCK_SIZE = 16;
|
|
|
|
|
pub const KEY_SIZE = 32;
|
|
|
|
|
|
|
|
|
|
// NOTE: data should be padded to make its length be a multiple of BLOCK_SIZE
|
2026-06-26 16:22:01 +02:00
|
|
|
encypt: *const fn (key: *const [KEY_SIZE]u8, iv: *const [BLOCK_SIZE]u8, data: *const []u8) void,
|
|
|
|
|
decrypt: *const fn (key: *const [KEY_SIZE]u8, iv: *const [BLOCK_SIZE]u8, data: *const []u8) void,
|
2026-06-15 15:23:41 +02:00
|
|
|
};
|
2026-06-13 23:20:25 +02:00
|
|
|
|
2026-06-15 15:23:41 +02:00
|
|
|
// TODO
|
|
|
|
|
pub const CBC265_DefaultImplementation = struct {
|
2026-07-03 21:56:17 +02:00
|
|
|
|
|
|
|
|
// Zig stdlib seems to provide no support for AES CBC265
|
|
|
|
|
// It may need some custom implementation or another library
|
|
|
|
|
|
2026-06-26 16:22:01 +02:00
|
|
|
pub fn encrypt(key: *const [32]u8, iv: *const [16]u8, data: *const []u8) !void {
|
2026-06-15 15:23:41 +02:00
|
|
|
_ = key;
|
|
|
|
|
_ = iv;
|
|
|
|
|
_ = data;
|
|
|
|
|
}
|
2026-06-26 16:22:01 +02:00
|
|
|
pub fn decrypt(key: *const [32]u8, iv: *const [16]u8, data: *const []u8) !void {
|
2026-06-15 15:23:41 +02:00
|
|
|
_ = key;
|
|
|
|
|
_ = iv;
|
2026-06-13 23:20:25 +02:00
|
|
|
_ = data;
|
|
|
|
|
}
|
|
|
|
|
};
|