xref: /PHP-8.3/ext/sodium/php_libsodium.h (revision 4679805c)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Authors: Frank Denis <jedisct1@php.net>                              |
14    +----------------------------------------------------------------------+
15 */
16 
17 #ifndef PHP_LIBSODIUM_H
18 #define PHP_LIBSODIUM_H
19 
20 extern zend_module_entry sodium_module_entry;
21 #define phpext_sodium_ptr &sodium_module_entry
22 
23 #define PHP_SODIUM_VERSION PHP_VERSION
24 
25 #ifdef ZTS
26 # include "TSRM.h"
27 #endif
28 
29 #define SODIUM_LIBRARY_VERSION() (char *) (void *) sodium_version_string()
30 
31 #define SODIUM_CRYPTO_BOX_KEYPAIRBYTES() crypto_box_SECRETKEYBYTES + crypto_box_PUBLICKEYBYTES
32 
33 #define SODIUM_CRYPTO_KX_KEYPAIRBYTES() crypto_kx_SECRETKEYBYTES + crypto_kx_PUBLICKEYBYTES
34 
35 #define SODIUM_CRYPTO_SIGN_KEYPAIRBYTES() crypto_sign_SECRETKEYBYTES + crypto_sign_PUBLICKEYBYTES
36 
37 PHP_MINIT_FUNCTION(sodium);
38 PHP_MINIT_FUNCTION(sodium_password_hash);
39 PHP_MSHUTDOWN_FUNCTION(sodium);
40 PHP_RINIT_FUNCTION(sodium);
41 PHP_RSHUTDOWN_FUNCTION(sodium);
42 PHP_MINFO_FUNCTION(sodium);
43 
44 #endif	/* PHP_LIBSODIUM_H */
45