xref: /PHP-7.1/ext/hash/php_hash_sha3.h (revision ccd4716e)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2018 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Author: Sara Golemon <pollita@php.net>                               |
16    +----------------------------------------------------------------------+
17 */
18 
19 #ifndef PHP_HASH_SHA3_H
20 #define PHP_HASH_SHA3_H
21 
22 #include "php.h"
23 
24 typedef struct {
25 	unsigned char state[200]; // 5 * 5 * sizeof(uint64)
26 	uint32_t pos;
27 } PHP_SHA3_CTX;
28 
29 typedef PHP_SHA3_CTX PHP_SHA3_224_CTX;
30 typedef PHP_SHA3_CTX PHP_SHA3_256_CTX;
31 typedef PHP_SHA3_CTX PHP_SHA3_384_CTX;
32 typedef PHP_SHA3_CTX PHP_SHA3_512_CTX;
33 
34 PHP_HASH_API void PHP_SHA3224Init(PHP_SHA3_224_CTX*);
35 PHP_HASH_API void PHP_SHA3224Update(PHP_SHA3_224_CTX*, const unsigned char*, unsigned int);
36 PHP_HASH_API void PHP_SAH3224Final(unsigned char[32], PHP_SHA3_224_CTX*);
37 
38 PHP_HASH_API void PHP_SHA3256Init(PHP_SHA3_256_CTX*);
39 PHP_HASH_API void PHP_SHA3256Update(PHP_SHA3_256_CTX*, const unsigned char*, unsigned int);
40 PHP_HASH_API void PHP_SAH3256Final(unsigned char[32], PHP_SHA3_256_CTX*);
41 
42 PHP_HASH_API void PHP_SHA3384Init(PHP_SHA3_384_CTX*);
43 PHP_HASH_API void PHP_SHA3384Update(PHP_SHA3_384_CTX*, const unsigned char*, unsigned int);
44 PHP_HASH_API void PHP_SAH3384Final(unsigned char[32], PHP_SHA3_384_CTX*);
45 
46 PHP_HASH_API void PHP_SHA3512Init(PHP_SHA3_512_CTX*);
47 PHP_HASH_API void PHP_SHA3512Update(PHP_SHA3_512_CTX*, const unsigned char*, unsigned int);
48 PHP_HASH_API void PHP_SAH3512Final(unsigned char[32], PHP_SHA3_512_CTX*);
49 
50 #endif
51 /*
52  * Local variables:
53  * tab-width: 4
54  * c-basic-offset: 4
55  * End:
56  * vim600: sw=4 ts=4 fdm=marker
57  * vim<600: sw=4 ts=4
58  */
59