42 lines
914 B
Zig
42 lines
914 B
Zig
|
|
// WARNING NOT FUNCTIONAL !!!
|
||
|
|
// This is just a draft
|
||
|
|
// TODO
|
||
|
|
|
||
|
|
pub const DefaultEngine = struct {
|
||
|
|
pub fn encrypt(data: []u8) void {
|
||
|
|
_ = data;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
pub fn AesEngine(comptime Provider: anytype) type {
|
||
|
|
|
||
|
|
_ = Provider;
|
||
|
|
|
||
|
|
return struct {
|
||
|
|
const Self = @This();
|
||
|
|
|
||
|
|
pub const CBC_265 = struct {
|
||
|
|
const key_length = 256;
|
||
|
|
|
||
|
|
// Encrypts the data block using AES 256 CBC
|
||
|
|
pub fn encrypt(data: []u8, key: [key_length]u8, iv: []u8) void {
|
||
|
|
_ = data;
|
||
|
|
_ = key;
|
||
|
|
_ = iv;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
pub const CBC_128 = struct {
|
||
|
|
const key_length = 128;
|
||
|
|
|
||
|
|
// Encrypts the data block using AES 128 CBC
|
||
|
|
pub fn encrypt(data: []u8, key: [key_length]u8, iv: []u8) void {
|
||
|
|
_ = data;
|
||
|
|
_ = key;
|
||
|
|
_ = iv;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
};
|
||
|
|
}
|