1 /* $Id: sha1.h 241182 2011-02-17 21:50:03Z $ */
7 * Copyright (C) The Internet Society (2001). All Rights Reserved.
9 * This document and translations of it may be copied and furnished to
10 * others, and derivative works that comment on or otherwise explain it
11 * or assist in its implementation may be prepared, copied, published
12 * and distributed, in whole or in part, without restriction of any
13 * kind, provided that the above copyright notice and this paragraph are
14 * included on all such copies and derivative works. However, this
15 * document itself may not be modified in any way, such as by removing
16 * the copyright notice or references to the Internet Society or other
17 * Internet organizations, except as needed for the purpose of
18 * developing Internet standards in which case the procedures for
19 * copyrights defined in the Internet Standards process must be
20 * followed, or as required to translate it into languages other than
23 * The limited permissions granted above are perpetual and will not be
24 * revoked by the Internet Society or its successors or assigns.
26 * This document and the information contained herein is provided on an
27 * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
28 * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
29 * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
30 * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
31 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
38 * This is the header file for code which implements the Secure
39 * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
42 * Many of the variable names in this code, especially the
43 * single character names, were used because those were the names
44 * used in the publication.
46 * Please read the file sha1.c for more information.
57 typedef short int int_least16_t;
59 typedef short int int_least16_t;
60 #elif defined(TARGETOS_symbian)
61 typedef short int int_least16_t;
66 #if (!defined(__NetBSD__) && !defined(MACOSX)) || defined(__ECOS)
67 typedef short int int_least16_t;
71 * If you do not have the ISO standard stdint.h header file, then you
72 * must typdef the following:
74 * uint32_t unsigned 32 bit integer
75 * uint8_t unsigned 8 bit integer (i.e., unsigned char)
76 * int_least16_t integer of >= 16 bits
85 shaNull
, /* Null pointer parameter */
86 shaInputTooLong
, /* input data too long */
87 shaStateError
/* called Input after Result */
90 #define SHA1HashSize 20
93 * This structure will hold context information for the SHA-1
96 typedef struct SHA1Context
98 uint32 Intermediate_Hash
[SHA1HashSize
/4]; /* Message Digest */
100 uint32 Length_Low
; /* Message length in bits */
101 uint32 Length_High
; /* Message length in bits */
103 /* Index into message block array */
104 int_least16_t Message_Block_Index
;
105 uint8 Message_Block
[64]; /* 512-bit message blocks */
107 int Computed
; /* Is the digest computed? */
108 int Corrupted
; /* Is the message digest corrupted? */
112 * Function Prototypes
115 int BCMROMFN(SHA1Reset
)(SHA1Context
*);
116 int BCMROMFN(SHA1Input
)(SHA1Context
*,
119 int BCMROMFN(SHA1Result
)( SHA1Context
*,
120 uint8 Message_Digest
[SHA1HashSize
]);