Package: LSC.HMAC_SHA512

Dependencies

with LSC.SHA512, LSC.Types;
use type LSC.Types.Word64;

Description

The HMAC-SHA-512 message authentication code

Header

package LSC.HMAC_SHA512 is
 

Type Summary

Context_Type
Primitive Operations:  Context_Finalize, Context_Init, Context_Update, Get_Auth, Get_Prf

Constants and Named Numbers

Auth_Length : constant := 32;
Lenth of HMAC-SHA-512 authenticator
Null_Auth : constant Auth_Type;
Empty authenticator

Other Items:

type Context_Type is private;
HMAC-SHA-512 context

subtype Auth_Index is Types.Index range 0 .. 3;
Index for HMAC-SHA-512 authenticator

subtype Auth_Type is Types.Word64_Array_Type (Auth_Index);
HMAC-SHA-512 authenticator

function Context_Init (Key : SHA512.Block_Type) return Context_Type;
Initialize HMAC-SHA-512 context using Key.

procedure Context_Update
  (Context : in out Context_Type;
   Block   : in     SHA512.Block_Type);
Update HMAC-SHA-512 Context with message block Block.
 derives Context from *,
                      Block;

procedure Context_Finalize
  (Context : in out Context_Type;
   Block   : in     SHA512.Block_Type;
   Length  : in     SHA512.Block_Length_Type);
Finalize HMAC-SHA-512 Context using Length bits of final message block Block.
 derives Context from *,
                      Block,
                      Length;

function Get_Prf  (Context : in Context_Type) return SHA512.SHA512_Hash_Type;
Get pseudo-random function value from Context

function Get_Auth (Context : in Context_Type) return Auth_Type;
Get authentication value from Context

function Authenticate
   (Key     : SHA512.Block_Type;
    Message : SHA512.Message_Type;
    Length  : Types.Word64) return Auth_Type;
Perform authentication of Length bits of Message using Key and return the authentication value.
 pre
    Message'First + (Length / SHA512.Block_Size) in Message'Range;

private

   --  Implementation-defined ...
end LSC.HMAC_SHA512;