folly: fix github ci tests on macos arm
[hiphop-php.git] / hphp / zend / php-crypt_r.h
blob0efc58a6718aace4a882151c2a65d595cbbf1c1a
1 /* $Id$ */
2 /*
3 +----------------------------------------------------------------------+
4 | PHP Version 7 |
5 +----------------------------------------------------------------------+
6 | Copyright (c) 1997-2015 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
16 | Authors: Pierre Alain Joye <pajoye@php.net |
17 +----------------------------------------------------------------------+
20 #ifndef incl_HPHP_UTIL_PHP_CRYPT_R_H_
21 #define incl_HPHP_UTIL_PHP_CRYPT_R_H_
23 #include "hphp/zend/crypt-blowfish.h"
24 #include "hphp/zend/crypt-freesec.h"
26 #define MD5_HASH_MAX_LEN 120
27 #define PHP_MAX_SALT_LEN 123
29 /* Macros specific to the portability of the crypto implementations taken from
30 * PHP. If these needed to be more generally used, they could be moved to
31 * util/portability.h but for now they are just here. */
32 #ifdef _MSC_VER
33 #define SECURE_ZERO(var, size) RtlSecureZeroMemory((var), (size))
34 #define STRTOUL(s0, s1, base) _strtoui64((s0), (s1), (base))
35 #else
36 #define SECURE_ZERO(var, size) memset((var), 0, (size))
37 #define STRTOUL(s0, s1, base) strtoull((s0), (s1), (base))
38 #endif
40 namespace HPHP {
42 void php_init_crypt_r();
43 void php_shutdown_crypt_r();
45 extern void _crypt_extended_init_r(void);
47 extern char * php_md5_crypt_r(const char *pw, const char *salt, char *out);
48 extern char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
49 extern char * php_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
53 #endif /* incl_HPHP_UTIL_PHP_CRYPT_R_H_ */