Package: LSC.Types

Dependencies

with Interfaces;
 inherit Interfaces;

Description

Primitive types and operations

Header

package LSC.Types is
 
pragma Pure;

Type Summary

Byte_Array32_Type
Byte_Array64_Type
Index
Word32_Array_Type
Word64_Array_Type

Other Items:

type Index is range 0 .. 79;
Base index type

subtype Byte is Interfaces.Unsigned_8;
8-bit word

subtype Word32 is Interfaces.Unsigned_32;
32-bit word

subtype Word64 is Interfaces.Unsigned_64;
64-bit word

subtype Byte_Array32_Index is Index range 0 .. 3;
Index for 32-bit byte array

type Byte_Array32_Type is array (Byte_Array32_Index) of Byte;
32-bit byte array

subtype Byte_Array64_Index is Index range 0 .. 7;
Index for 64-bit byte array

type Byte_Array64_Type is array (Byte_Array64_Index) of Byte;
64-bit byte array

type Word32_Array_Type is array (Index range <>) of Word32;
Unconstrained array of 32-bit words

type Word64_Array_Type is array (Index range <>) of Word64;
Unconstrained array of 64-bit words

function ROTR (Value : Word64; Amount : Natural) return Word64;
pragma Inline (ROTR);
Left rotate 64-bit Value by Amount

function SHR (Value : Word64; Amount : Natural) return Word64;
pragma Inline (SHR);
Right shift 64-bit Value by Amount

function SHL (Value : Word64; Amount : Natural) return Word64;
pragma Inline (SHL);
Left shift 64-bit Value by Amount

function ROTR32 (Value : Word32; Amount : Natural) return Word32;
pragma Inline (ROTR32);
Right rotate 32-bit Value by Amount

function ROTL32 (Value : Word32; Amount : Natural) return Word32;
pragma Inline (ROTL32);
Left rotate 32-bit Value by Amount

function SHL32 (Value : Word32; Amount : Natural) return Word32;
pragma Inline (SHL32);
Left shift 32-bit Value by Amount

function SHR32 (Value : Word32; Amount : Natural) return Word32;
pragma Inline (SHR32);
Right shift 32-bit Value by Amount

function Word32_To_Byte_Array32 (Value : Word32) return Byte_Array32_Type;
Convert 32-bit word to 32-bit byte array

function Byte_Array32_To_Word32 (Value : Byte_Array32_Type) return Word32;
Convert 32-bit byte array to 32-bit word

function Word64_To_Byte_Array64 (Value : Word64) return Byte_Array64_Type;
Convert 64-bit word to 64-bit byte array

function Byte_Array64_To_Word64 (Value : Byte_Array64_Type) return Word64;
Convert 64-bit byte array to 64-bit word
end LSC.Types;