change to BlockCipher-API
This commit is contained in:
parent
683c594426
commit
67dfd890a7
|
@ -128,17 +128,17 @@ package body AES is
|
|||
procedure Initialize_priv is new Initialize_Generic(T_In => Key_192, T_Out => Context_192);
|
||||
procedure Initialize_priv is new Initialize_Generic(T_In => Key_256, T_Out => Context_256);
|
||||
|
||||
procedure Initialize(Key : in Key_128; Context : out Context_128) is
|
||||
procedure Initialize(Context : out Context_128; Key : in Key_128) is
|
||||
begin
|
||||
Initialize_priv(Key, Context);
|
||||
end Initialize;
|
||||
|
||||
procedure Initialize(Key : in Key_192; Context : out Context_192) is
|
||||
procedure Initialize(Context : out Context_192; Key : in Key_192) is
|
||||
begin
|
||||
Initialize_priv(Key, Context);
|
||||
end Initialize;
|
||||
|
||||
procedure Initialize(Key : in Key_256; Context : out Context_256) is
|
||||
procedure Initialize(Context : out Context_256; Key : in Key_256) is
|
||||
begin
|
||||
Initialize_priv(Key, Context);
|
||||
end Initialize;
|
||||
|
|
|
@ -33,16 +33,16 @@ package AES is
|
|||
|
||||
|
||||
|
||||
procedure Initialize(Key : in Key_128; Context : out Context_128);
|
||||
procedure Initialize(Context : out Context_128; Key : in Key_128);
|
||||
procedure Encrypt(Context : in Context_128; Block: in out Block_128_Bit);
|
||||
procedure Decrypt(Context : in Context_128; Block: in out Block_128_Bit);
|
||||
|
||||
|
||||
procedure Initialize(Key : in Key_192; Context : out Context_192);
|
||||
procedure Initialize(Context : out Context_192; Key : in Key_192);
|
||||
procedure Encrypt(Context : in Context_192; Block: in out Block_128_Bit);
|
||||
procedure Decrypt(Context : in Context_192; Block: in out Block_128_Bit);
|
||||
|
||||
procedure Initialize(Key : in Key_256; Context : out Context_256);
|
||||
procedure Initialize(Context : out Context_256; Key : in Key_256);
|
||||
procedure Encrypt(Context : in Context_256; Block: in out Block_128_Bit);
|
||||
procedure Decrypt(Context : in Context_256; Block: in out Block_128_Bit);
|
||||
|
||||
|
|
|
@ -189,17 +189,17 @@ package body ARIA is
|
|||
Context.W(4) := PreKey_T(u8_Array(Context.W(4)) xor u8_Array(Context.W(2)));
|
||||
end Initialize;
|
||||
|
||||
procedure Initialize(Key : in Key_128; Context : out Context_T) is
|
||||
procedure Initialize(Context : out Context_T; Key : in Key_128) is
|
||||
begin
|
||||
Initialize(u8_Array(Key), Context);
|
||||
end Initialize;
|
||||
|
||||
procedure Initialize(Key : in Key_192; Context : out Context_T) is
|
||||
procedure Initialize(Context : out Context_T; Key : in Key_192) is
|
||||
begin
|
||||
Initialize(u8_Array(Key), Context);
|
||||
end Initialize;
|
||||
|
||||
procedure Initialize(Key : in Key_256; Context : out Context_T) is
|
||||
procedure Initialize(Context : out Context_T; Key : in Key_256) is
|
||||
begin
|
||||
Initialize(u8_Array(Key), Context);
|
||||
end Initialize;
|
||||
|
|
|
@ -31,9 +31,9 @@ package ARIA is
|
|||
|
||||
|
||||
|
||||
procedure Initialize(Key : in Key_128; Context : out Context_T);
|
||||
procedure Initialize(Key : in Key_192; Context : out Context_T);
|
||||
procedure Initialize(Key : in Key_256; Context : out Context_T);
|
||||
procedure Initialize(Context : out Context_T; Key : in Key_128);
|
||||
procedure Initialize(Context : out Context_T; Key : in Key_192);
|
||||
procedure Initialize(Context : out Context_T; Key : in Key_256);
|
||||
procedure Encrypt(Context : in Context_T; Block: in out Block_128_Bit);
|
||||
procedure Decrypt(Context : in Context_T; Block: in out Block_128_Bit);
|
||||
|
||||
|
|
|
@ -96,19 +96,19 @@ procedure main is
|
|||
for i in block'First + 1 .. block'Last loop
|
||||
block(i) := u8(block(i - 1) + 16#11#);
|
||||
end loop;
|
||||
AES.Initialize(AES.Key_128(key(1 .. 16)), ctx128);
|
||||
AES.Initialize(ctx128, AES.Key_128(key(1 .. 16)));
|
||||
AES.Encrypt(ctx128, block);
|
||||
print_hex(block); New_Line;
|
||||
AES.Decrypt(ctx128, block);
|
||||
print_hex(block); New_Line;
|
||||
|
||||
AES.Initialize(AES.Key_192(key(1 .. 24)), ctx192);
|
||||
AES.Initialize(ctx192, AES.Key_192(key(1 .. 24)));
|
||||
AES.Encrypt(ctx192, block);
|
||||
print_hex(block); New_Line;
|
||||
AES.Decrypt(ctx192, block);
|
||||
print_hex(block); New_Line;
|
||||
|
||||
AES.Initialize(key, ctx256);
|
||||
AES.Initialize(ctx256, key);
|
||||
AES.Encrypt(ctx256, block);
|
||||
print_hex(block); New_Line;
|
||||
AES.Decrypt(ctx256, block);
|
||||
|
|
|
@ -3,7 +3,7 @@ project Steelcrypt is
|
|||
type Build_Modes is
|
||||
("Release", "Debug");
|
||||
Mode : Build_Modes := external ("BUILD", "Debug");
|
||||
for Main use ("main.adb", "test_sha2.adb", "test_sha224.adb", "test_sha256.adb", "test_sha384.adb", "test_sha512.adb");
|
||||
for Main use ("main.adb", "test_sha2.adb", "test_sha3.adb", "test_sha224.adb", "test_sha256.adb", "test_sha384.adb", "test_sha512.adb", "test_keccak.adb");
|
||||
|
||||
case Mode is
|
||||
|
||||
|
|
Loading…
Reference in New Issue