Nist_support (nist_support.ads): (Body)


--  © Copyright 2000 by John Halleck, All rights reserved.
--  Basic support routines needed to allow SHA and DSA routines to run
--  through the NIST tests.
--  It is part of a project at http://www.cc.utah.edu/~nahaj/

--  The NIST tests are documented at their web site:
--      http://csrc.ncsl.nist.gov/cryptval/
--  as are the format of the objects that this package handles.

with Ada.Text_IO;  use Ada.Text_IO;
--  Basicly all the support routines needed are to read and write
--  the files that NIST provides, and requires in responce.

with SHA; use SHA;                 -- We'll need to use digests.
with SHA.Strings; use SHA.Strings; -- And what they looks like in Hex.

package NIST_Support is

   NIST_File_Format_Error   : exception;
   NIST_Number_Format_Error : exception;
   NIST_Test_Failed_Error   : exception;


   procedure Copy_Comments (Source, Destination : File_Type);
   --  Copy a block of comments from one file to another.


   procedure Get_String (File : File_Type;
                        Given : String; -- what to searh for.
                       Reason : String); -- Why we are searching for it.
   --  Look for a header string.


   procedure Add_Bit_String_To_Hash (File : File_Type);
   --  Add a bit string onto a the hash.

   function Hash_Bit_String (File : File_Type) return Digest;
   --  Digest next Bit String;

   function Find_Next_Bit_String (File : File_Type) return Boolean;
   --  (If there is one)

   function Find_Hash (File : File_Type) return Boolean;
   --  (If there is one.)

   procedure Compare_Hash (File : File_Type; Hash : Hex_SHA_String);
   --  Compare hash with the one in the file;

end NIST_Support;

Go to ...


This page is http://www.cc.utah.edu/~nahaj/ada/sha/nist_support.ads.html
© Copyright 2000 by John Halleck, All Rights Reserved.
This snapshot was last modified on October 30th, 2000