Package: LSC.AES

Dependencies

with LSC.Types;
use type LSC.Types.Word32;
use type LSC.Types.Index;
 inherit
    LSC.Types,
    LSC.Debug,
    LSC.Ops32,
    LSC.Byteorder32;

Description

The AES algorithm

Header

package LSC.AES is
 

Known child units

LSC.AES.CBC(package)
LSC.AES.Print(private package)
LSC.AES.Tables(private package)

Type Summary

AES_Dec_Context
Primitive Operations:  Create_AES128_Dec_Context, Create_AES192_Dec_Context, Create_AES256_Dec_Context, Decrypt
AES_Enc_Context
Primitive Operations:  Create_AES128_Enc_Context, Create_AES192_Enc_Context, Create_AES256_Enc_Context, Encrypt
Key_Type
Message_Type

Constants and Named Numbers

Null_AES128_Key : constant AES128_Key_Type;
Empty AES-128 key
Null_AES192_Key : constant AES192_Key_Type;
Empty AES-192 key
Null_AES256_Key : constant AES256_Key_Type;
Empty AES-256 key
Null_Block : constant Block_Type;
Empty AES block

Other Items:

type AES_Enc_Context is private;
AES encryption context

type AES_Dec_Context is private;
AES decryption context

subtype Key_Index is Types.Index range 0 .. 7;
Index of AES key

type Key_Type is array (Key_Index range <>) of Types.Word32;
AES key

subtype AES128_Key_Index is Types.Index range 0 .. 3;
Index of AES-128 key

subtype AES128_Key_Type is Key_Type (AES128_Key_Index);
AES-128 key

subtype AES192_Key_Index is Types.Index range 0 .. 5;
Index of AES-192 key

subtype AES192_Key_Type is Key_Type (AES192_Key_Index);
AES-192 key

subtype AES256_Key_Index is Types.Index range 0 .. 7;
Index of AES-256 key

subtype AES256_Key_Type is Key_Type (AES256_Key_Index);
AES-256 key

subtype Block_Index is Types.Index range 0 .. 3;
Index of AES block

subtype Block_Type is Types.Word32_Array_Type (Block_Index);
AES block

subtype Message_Index is Natural;
Index of AES message

type Message_Type is array (Message_Index range <>) of Block_Type;
AES message (unconstrained array of AES blocks)

function Create_AES128_Enc_Context (Key : AES128_Key_Type) return AES_Enc_Context;
Create AES-128 encryption context from AES-128 Key

function Create_AES192_Enc_Context (Key : AES192_Key_Type) return AES_Enc_Context;
Create AES-192 encryption context from AES-192 Key

function Create_AES256_Enc_Context (Key : AES256_Key_Type) return AES_Enc_Context;
Create AES-256 encryption context from AES-256 Key

function Encrypt (Context   : AES_Enc_Context;
                  Plaintext : Block_Type) return Block_Type;
Encrypt one Plaintext block using given Context, return one block of ciphertext

function Create_AES128_Dec_Context (Key : AES128_Key_Type) return AES_Dec_Context;
Create AES-128 decryption context from AES-128 Key

function Create_AES192_Dec_Context (Key : AES192_Key_Type) return AES_Dec_Context;
Create AES-192 decryption context from AES-192 Key

function Create_AES256_Dec_Context (Key : AES256_Key_Type) return AES_Dec_Context;
Create AES-256 decryption context from AES-256 Key

function Decrypt (Context    : AES_Dec_Context;
                  Ciphertext : Block_Type) return Block_Type;
Decrypt one Ciphertext block using given Context, return one block of plaintext

private

   --  Implementation-defined ...
end LSC.AES;