libbtc
bitcoinclibrary
hash.h
Go to the documentation of this file.
1 /*
2 
3  The MIT License (MIT)
4 
5  Copyright (c) 2015 Jonas Schnelli
6 
7  Permission is hereby granted, free of charge, to any person obtaining
8  a copy of this software and associated documentation files (the "Software"),
9  to deal in the Software without restriction, including without limitation
10  the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  and/or sell copies of the Software, and to permit persons to whom the
12  Software is furnished to do so, subject to the following conditions:
13 
14  The above copyright notice and this permission notice shall be included
15  in all copies or substantial portions of the Software.
16 
17  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
21  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23  OTHER DEALINGS IN THE SOFTWARE.
24 
25 */
26 
27 
28 #ifndef __LIBBTC_HASH_H__
29 #define __LIBBTC_HASH_H__
30 
31 #include "btc.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #include <stdint.h>
38 #include <stddef.h>
39 #include <stdint.h>
40 
41 #include "cstr.h"
42 #include "vector.h"
43 
44 typedef uint8_t uint256[32];
45 
46 //bitcoin double sha256 hash
47 LIBBTC_API void btc_hash(const unsigned char* datain, size_t length, uint256 hashout);
48 
49 //single sha256 hash
50 LIBBTC_API void btc_hash_sngl_sha256(const unsigned char* datain, size_t length, uint256 hashout);
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif //__LIBBTC_HASH_H__
#define LIBBTC_API
Definition: btc.h:59
LIBBTC_API void btc_hash(const unsigned char *datain, size_t length, uint256 hashout)
Definition: sha2.c:1026
LIBBTC_API void btc_hash_sngl_sha256(const unsigned char *datain, size_t length, uint256 hashout)
Definition: sha2.c:1033
uint8_t uint256[32]
Definition: hash.h:44