]> git.notmuchmail.org Git - notmuch/blob - libsha1.h
Update prefix so that "thread:" can be used in search strings.
[notmuch] / libsha1.h
1 /*
2  ---------------------------------------------------------------------------
3  Copyright (c) 2002, Dr Brian Gladman, Worcester, UK.   All rights reserved.
4
5  LICENSE TERMS
6
7  The free distribution and use of this software in both source and binary
8  form is allowed (with or without changes) provided that:
9
10    1. distributions of this source code include the above copyright
11       notice, this list of conditions and the following disclaimer;
12
13    2. distributions in binary form include the above copyright
14       notice, this list of conditions and the following disclaimer
15       in the documentation and/or other associated materials;
16
17    3. the copyright holder's name is not used to endorse products
18       built using this software without specific written permission.
19
20  ALTERNATIVELY, provided that this notice is retained in full, this product
21  may be distributed under the terms of the GNU General Public License (GPL),
22  in which case the provisions of the GPL apply INSTEAD OF those given above.
23
24  DISCLAIMER
25
26  This software is provided 'as is' with no explicit or implied warranties
27  in respect of its properties, including, but not limited to, correctness
28  and/or fitness for purpose.
29  ---------------------------------------------------------------------------
30  Issue Date: 01/08/2005
31 */
32
33 #ifndef _SHA1_H
34 #define _SHA1_H
35
36 #if defined(__cplusplus)
37 extern "C"
38 {
39 #endif
40 #if 0
41 } /* Appleasing Emacs */
42 #endif
43
44 #include <stdint.h>
45
46 /* Size of SHA1 digest */
47
48 #define SHA1_DIGEST_SIZE 20
49
50 /* type to hold the SHA1 context  */
51
52 typedef struct
53 {   uint32_t count[2];
54     uint32_t hash[5];
55     uint32_t wbuf[16];
56 } sha1_ctx;
57
58 void sha1_begin(sha1_ctx ctx[1]);
59 void sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]);
60 void sha1_end(unsigned char hval[], sha1_ctx ctx[1]);
61 void sha1(unsigned char hval[], const unsigned char data[], unsigned long len);
62
63 #if defined(__cplusplus)
64 }
65 #endif
66
67 #endif