GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / include / bcmcrypto / sha1.h
blobae68ff08169ff8b636e47090eafdecebbeceb378
1 /* $Id: sha1.h 241182 2011-02-17 21:50:03Z $ */
2 /*FILE-CSTYLED*/
4 /* From rfc3174.txt */
6 /*
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
21 * English.
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.
35 * sha1.h
37 * Description:
38 * This is the header file for code which implements the Secure
39 * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
40 * April 17, 1995.
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.
50 #ifndef _SHA1_H_
51 #define _SHA1_H_
53 #include <typedefs.h>
55 #ifndef BCMDRIVER
56 #if defined(_WIN32)
57 typedef short int int_least16_t;
58 #elif defined(__ECOS)
59 typedef short int int_least16_t;
60 #elif defined(TARGETOS_symbian)
61 typedef short int int_least16_t;
62 #else
63 #include <stdint.h>
64 #endif
65 #else
66 #if (!defined(__NetBSD__) && !defined(MACOSX)) || defined(__ECOS)
67 typedef short int int_least16_t;
68 #endif
69 #endif
71 * If you do not have the ISO standard stdint.h header file, then you
72 * must typdef the following:
73 * name meaning
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
80 #ifndef _SHA_enum_
81 #define _SHA_enum_
82 enum
84 shaSuccess = 0,
85 shaNull, /* Null pointer parameter */
86 shaInputTooLong, /* input data too long */
87 shaStateError /* called Input after Result */
89 #endif
90 #define SHA1HashSize 20
93 * This structure will hold context information for the SHA-1
94 * hashing operation
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? */
109 } SHA1Context;
112 * Function Prototypes
115 int BCMROMFN(SHA1Reset)(SHA1Context *);
116 int BCMROMFN(SHA1Input)(SHA1Context *,
117 const uint8 *,
118 unsigned int);
119 int BCMROMFN(SHA1Result)( SHA1Context *,
120 uint8 Message_Digest[SHA1HashSize]);
122 #endif