with LSC.Types; use type LSC.Types.Index; use type LSC.Types.Word64;
package LSC.SHA512 is
LSC.SHA512.Tables
Context_Type
Context_Finalize
Context_Update
SHA384_Context_Init
SHA384_Get_Hash
SHA512_Context_Init
SHA512_Get_Hash
Message_Type
Block_Size : constant := 1024;
Null_Block : constant Block_Type;
Null_SHA384_Hash : constant SHA384_Hash_Type;
Null_SHA512_Hash : constant SHA512_Hash_Type;
type Context_Type is private;
subtype Block_Index is Types.Index range 0 .. 15;
subtype Block_Type is Types.Word64_Array_Type (Block_Index);
subtype SHA512_Hash_Index is Types.Index range 0 .. 7;
subtype SHA512_Hash_Type is Types.Word64_Array_Type (SHA512_Hash_Index);
subtype SHA384_Hash_Index is Types.Index range 0 .. 5;
subtype SHA384_Hash_Type is Types.Word64_Array_Type (SHA384_Hash_Index);
subtype Block_Length_Type is Types.Word64 range 0 .. Block_Size - 1;
subtype Message_Index is Types.Word64 range 0 .. 2**64 - 1;
A SHA-512 hash can be at most 2^128 bit long. As one block has 1024 bit, this makes 2^118 blocks. NOTE: We support a size of 2^64 only!
type Message_Type is array (Message_Index range <>) of Block_Type;
function SHA512_Context_Init return Context_Type;
function SHA384_Context_Init return Context_Type;
procedure Context_Update (Context : in out Context_Type; Block : in Block_Type); pragma Inline (Context_Update);
Context
Block
derives Context from *, Block;
procedure Context_Finalize (Context : in out Context_Type; Block : in Block_Type; Length : in Block_Length_Type);
Length
derives Context from *, Block, Length;
function SHA512_Get_Hash (Context : Context_Type) return SHA512_Hash_Type;
function SHA384_Get_Hash (Context : Context_Type) return SHA384_Hash_Type;
private -- Implementation-defined ...
end LSC.SHA512;