2001-12-20 16:50:49 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2004-01-08 17:33:29 +00:00
|
|
|
| PHP Version 5 |
|
2001-12-20 16:50:49 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2004-01-08 17:33:29 +00:00
|
|
|
| Copyright (c) 1997-2004 The PHP Group |
|
2001-12-20 16:50:49 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2003-06-10 20:04:29 +00:00
|
|
|
| This source file is subject to version 3.0 of the PHP license, |
|
2001-12-20 16:50:49 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
|
|
|
| http://www.php.net/license/3_0.txt. |
|
2001-12-20 16:50:49 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
2003-10-13 09:33:00 +00:00
|
|
|
| Derick Rethans <derick@derickrethans.nl> |
|
2001-12-20 16:50:49 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
1999-04-25 16:50:40 +00:00
|
|
|
#ifndef PHP_MCRYPT_H
|
|
|
|
#define PHP_MCRYPT_H
|
|
|
|
|
|
|
|
#if HAVE_LIBMCRYPT
|
|
|
|
|
2000-08-11 18:45:17 +00:00
|
|
|
#ifdef ZTS
|
|
|
|
#include "TSRM.h"
|
|
|
|
#endif
|
|
|
|
|
1999-04-25 16:50:40 +00:00
|
|
|
extern zend_module_entry mcrypt_module_entry;
|
|
|
|
#define mcrypt_module_ptr &mcrypt_module_entry
|
|
|
|
|
2000-08-11 18:45:17 +00:00
|
|
|
/* Functions for both old and new API */
|
1999-04-25 16:50:40 +00:00
|
|
|
PHP_FUNCTION(mcrypt_ecb);
|
1999-04-25 17:04:56 +00:00
|
|
|
PHP_FUNCTION(mcrypt_cbc);
|
1999-04-25 20:44:52 +00:00
|
|
|
PHP_FUNCTION(mcrypt_cfb);
|
1999-04-25 21:11:29 +00:00
|
|
|
PHP_FUNCTION(mcrypt_ofb);
|
1999-05-01 14:41:46 +00:00
|
|
|
PHP_FUNCTION(mcrypt_get_cipher_name);
|
1999-04-25 20:32:15 +00:00
|
|
|
PHP_FUNCTION(mcrypt_get_block_size);
|
|
|
|
PHP_FUNCTION(mcrypt_get_key_size);
|
1999-04-25 21:09:07 +00:00
|
|
|
PHP_FUNCTION(mcrypt_create_iv);
|
1999-04-25 16:50:40 +00:00
|
|
|
|
2000-08-11 18:45:17 +00:00
|
|
|
/* Support functions for old API */
|
|
|
|
PHP_FUNCTION(mcrypt_list_algorithms);
|
|
|
|
PHP_FUNCTION(mcrypt_list_modes);
|
|
|
|
PHP_FUNCTION(mcrypt_get_iv_size);
|
|
|
|
PHP_FUNCTION(mcrypt_encrypt);
|
|
|
|
PHP_FUNCTION(mcrypt_decrypt);
|
|
|
|
|
|
|
|
/* Functions for new API */
|
|
|
|
PHP_FUNCTION(mcrypt_module_open);
|
|
|
|
PHP_FUNCTION(mcrypt_generic_init);
|
|
|
|
PHP_FUNCTION(mcrypt_generic);
|
|
|
|
PHP_FUNCTION(mdecrypt_generic);
|
|
|
|
PHP_FUNCTION(mcrypt_generic_end);
|
2001-09-23 14:14:27 +00:00
|
|
|
PHP_FUNCTION(mcrypt_generic_deinit);
|
2003-01-03 19:49:44 +00:00
|
|
|
|
2000-08-11 18:45:17 +00:00
|
|
|
PHP_FUNCTION(mcrypt_enc_self_test);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_is_block_mode);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_get_block_size);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_get_key_size);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_get_iv_size);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
|
|
|
|
PHP_FUNCTION(mcrypt_enc_get_modes_name);
|
|
|
|
PHP_FUNCTION(mcrypt_module_self_test);
|
|
|
|
PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
|
|
|
|
PHP_FUNCTION(mcrypt_module_is_block_algorithm);
|
|
|
|
PHP_FUNCTION(mcrypt_module_is_block_mode);
|
|
|
|
PHP_FUNCTION(mcrypt_module_get_algo_block_size);
|
|
|
|
PHP_FUNCTION(mcrypt_module_get_algo_key_size);
|
|
|
|
PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
|
|
|
|
PHP_FUNCTION(mcrypt_module_close);
|
|
|
|
|
|
|
|
ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
|
|
|
|
int le_h;
|
2000-08-13 11:53:04 +00:00
|
|
|
char *modes_dir;
|
|
|
|
char *algorithms_dir;
|
2000-08-11 18:45:17 +00:00
|
|
|
ZEND_END_MODULE_GLOBALS(mcrypt)
|
|
|
|
|
|
|
|
#ifdef ZTS
|
2003-01-03 19:49:44 +00:00
|
|
|
# define MCG(v) TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v)
|
2000-08-11 18:45:17 +00:00
|
|
|
#else
|
2003-01-03 19:49:44 +00:00
|
|
|
# define MCG(v) (mcrypt_globals.v)
|
2000-08-11 18:45:17 +00:00
|
|
|
#endif
|
|
|
|
|
1999-04-25 16:50:40 +00:00
|
|
|
#else
|
|
|
|
#define mcrypt_module_ptr NULL
|
|
|
|
#endif
|
|
|
|
|
1999-05-06 20:54:56 +00:00
|
|
|
#define phpext_mcrypt_ptr mcrypt_module_ptr
|
|
|
|
|
1999-04-25 16:50:40 +00:00
|
|
|
#endif
|