File: sha.ads

package info (click to toggle)
libaws 2.2dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,624 kB
  • ctags: 1,173
  • sloc: ada: 61,829; ansic: 6,483; makefile: 1,282; xml: 196; sh: 119; java: 112; python: 66; sed: 40
file content (26 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--  (C) Copyright 2000 by John Halleck, All rights reserved.
--  Basic Definitions for NSA's Secure Hash Algorithm.
--  This code implements SHA-1 defined in FIPS PUB 180-1, 17 April 1995.
--  It is part of a project at http://www.cc.utah.edu/~nahaj/

with Interfaces; use Interfaces;
   --  The only modular types for which rotation and shift are officially
   --  defined are those in Interfaces.
   --  We use Unsigned_32 for the digest, and Unsigned_8 in some of the
   --  computation routines.

package SHA is
   pragma Pure (SHA);

   --  At top level we define ONLY the digest, so that programs that
   --  store, compare, and manipulate the digest can be written, without
   --  them all having to drag in everything needed to compute it.

   --  The standard is written in terms of 32 bit words.
   Bits_In_Word     : constant := 32; -- Bits per Digest word.
   Words_In_Digest  : constant :=  5;
   Bits_In_Digest   : constant := Bits_In_Word * Words_In_Digest;

   type Digest is array (0 .. Words_In_Digest - 1) of Unsigned_32;

end SHA;