Back to index

php5  5.3.10
php_mcrypt.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: Sascha Schumann <sascha@schumann.cx>                        |
00016    |          Derick Rethans <derick@derickrethans.nl>                    |
00017    +----------------------------------------------------------------------+
00018  */
00019 /* $Id: php_mcrypt.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_MCRYPT_H
00022 #define PHP_MCRYPT_H
00023 
00024 #if HAVE_LIBMCRYPT
00025 
00026 #ifdef ZTS
00027 #include "TSRM.h"
00028 #endif
00029 
00030 extern zend_module_entry mcrypt_module_entry;
00031 #define mcrypt_module_ptr &mcrypt_module_entry
00032 
00033 /* Functions for both old and new API */
00034 PHP_FUNCTION(mcrypt_ecb);
00035 PHP_FUNCTION(mcrypt_cbc);
00036 PHP_FUNCTION(mcrypt_cfb);
00037 PHP_FUNCTION(mcrypt_ofb);
00038 PHP_FUNCTION(mcrypt_get_cipher_name);
00039 PHP_FUNCTION(mcrypt_get_block_size);
00040 PHP_FUNCTION(mcrypt_get_key_size);
00041 PHP_FUNCTION(mcrypt_create_iv);
00042 
00043 /* Support functions for old API */
00044 PHP_FUNCTION(mcrypt_list_algorithms);
00045 PHP_FUNCTION(mcrypt_list_modes);
00046 PHP_FUNCTION(mcrypt_get_iv_size);
00047 PHP_FUNCTION(mcrypt_encrypt);
00048 PHP_FUNCTION(mcrypt_decrypt);
00049 
00050 /* Functions for new API */
00051 PHP_FUNCTION(mcrypt_module_open);
00052 PHP_FUNCTION(mcrypt_generic_init);
00053 PHP_FUNCTION(mcrypt_generic);
00054 PHP_FUNCTION(mdecrypt_generic);
00055 PHP_FUNCTION(mcrypt_generic_deinit);
00056 
00057 PHP_FUNCTION(mcrypt_enc_self_test);
00058 PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
00059 PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
00060 PHP_FUNCTION(mcrypt_enc_is_block_mode);
00061 PHP_FUNCTION(mcrypt_enc_get_block_size);
00062 PHP_FUNCTION(mcrypt_enc_get_key_size);
00063 PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
00064 PHP_FUNCTION(mcrypt_enc_get_iv_size);
00065 PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
00066 PHP_FUNCTION(mcrypt_enc_get_modes_name);
00067 PHP_FUNCTION(mcrypt_module_self_test);
00068 PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
00069 PHP_FUNCTION(mcrypt_module_is_block_algorithm);
00070 PHP_FUNCTION(mcrypt_module_is_block_mode);
00071 PHP_FUNCTION(mcrypt_module_get_algo_block_size);
00072 PHP_FUNCTION(mcrypt_module_get_algo_key_size);
00073 PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
00074 PHP_FUNCTION(mcrypt_module_close);
00075 
00076 ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
00077        int le_h;
00078        char *modes_dir;
00079        char *algorithms_dir;
00080 ZEND_END_MODULE_GLOBALS(mcrypt)
00081 
00082 #ifdef ZTS
00083 # define MCG(v)    TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v)
00084 #else
00085 # define MCG(v)    (mcrypt_globals.v)
00086 #endif
00087 
00088 #else
00089 #define mcrypt_module_ptr NULL
00090 #endif
00091 
00092 #define phpext_mcrypt_ptr mcrypt_module_ptr
00093 
00094 #endif