source: rtems/c/src/lib/libbsp/arm/nds/tools/ndstool/include/sha1.h @ 32b8506

4.104.115
Last change on this file since 32b8506 was 32b8506, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/29/09 at 14:53:02

Whitespace removal.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 ---------------------------------------------------------------------------
3 Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
4 All rights reserved.
5
6 LICENSE TERMS
7
8 The free distribution and use of this software in both source and binary
9 form is allowed (with or without changes) provided that:
10
11   1. distributions of this source code include the above copyright
12      notice, this list of conditions and the following disclaimer;
13
14   2. distributions in binary form include the above copyright
15      notice, this list of conditions and the following disclaimer
16      in the documentation and/or other associated materials;
17
18   3. the copyright holder's name is not used to endorse products
19      built using this software without specific written permission.
20
21 ALTERNATIVELY, provided that this notice is retained in full, this product
22 may be distributed under the terms of the GNU General Public License (GPL),
23 in which case the provisions of the GPL apply INSTEAD OF those given above.
24
25 DISCLAIMER
26
27 This software is provided 'as is' with no explicit or implied warranties
28 in respect of its properties, including, but not limited to, correctness
29 and/or fitness for purpose.
30 ---------------------------------------------------------------------------
31Issue Date: 30/11/2002
32*/
33
34#ifndef _SHA1_H
35#define _SHA1_H
36
37
38typedef unsigned int sha1_32t;
39
40
41#if defined(__cplusplus)
42extern "C"
43{
44#endif
45
46#define SHA1_BLOCK_SIZE  64
47#define SHA1_DIGEST_SIZE 20
48#define SHA2_GOOD         0
49#define SHA2_BAD          1
50
51/* type to hold the SHA256 context  */
52
53typedef struct
54{   sha1_32t count[2];
55    sha1_32t hash[5];
56    sha1_32t wbuf[16];
57} sha1_ctx;
58
59void sha1_compile(sha1_ctx ctx[1]);
60
61void sha1_begin(sha1_ctx ctx[1]);
62void sha1_hash(const unsigned char data[], unsigned int len, sha1_ctx ctx[1]);
63void sha1_end(unsigned char hval[], sha1_ctx ctx[1]);
64void sha1(unsigned char hval[], const unsigned char data[], unsigned int len);
65
66#if defined(__cplusplus)
67}
68#endif
69
70#endif  // _SHA1_H
Note: See TracBrowser for help on using the repository browser.