php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
hash.c File Reference
#include <math.h>
#include "php_hash.h"
#include "ext/standard/info.h"
#include "ext/standard/file.h"
#include "ext/standard/php_var.h"
#include "zend_attributes.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "zend_smart_str.h"
#include "hash_arginfo.h"
#include <stddef.h>

Go to the source code of this file.

Macros

#define __alignof__(type)
 
#define PHP_HASHCONTEXT_VERIFY(hash)
 
#define PHP_HASH_HAVAL_REGISTER(p, b)
 

Functions

PHP_HASH_API const php_hash_opsphp_hash_fetch_ops (zend_string *algo)
 
PHP_HASH_API void php_hash_register_algo (const char *algo, const php_hash_ops *ops)
 
PHP_HASH_API zend_result php_hash_copy (const void *ops, const void *orig_context, void *dest_context)
 
PHP_HASH_API zend_result php_hash_serialize_spec (const php_hashcontext_object *hash, zval *zv, const char *spec)
 
PHP_HASH_API int php_hash_unserialize_spec (php_hashcontext_object *hash, const zval *zv, const char *spec)
 
PHP_HASH_API zend_result php_hash_serialize (const php_hashcontext_object *hash, zend_long *magic, zval *zv)
 
PHP_HASH_API int php_hash_unserialize (php_hashcontext_object *hash, zend_long magic, const zval *zv)
 
 PHP_FUNCTION (hash)
 
 PHP_FUNCTION (hash_file)
 
 PHP_FUNCTION (hash_hmac)
 
 PHP_FUNCTION (hash_hmac_file)
 
 PHP_FUNCTION (hash_init)
 
 PHP_FUNCTION (hash_update)
 
 PHP_FUNCTION (hash_update_stream)
 
 PHP_FUNCTION (hash_update_file)
 
 PHP_FUNCTION (hash_final)
 
 PHP_FUNCTION (hash_copy)
 
 PHP_FUNCTION (hash_algos)
 
 PHP_FUNCTION (hash_hmac_algos)
 
 PHP_FUNCTION (hash_hkdf)
 
 PHP_FUNCTION (hash_pbkdf2)
 
 PHP_FUNCTION (hash_equals)
 
 PHP_METHOD (HashContext, __construct)
 
 PHP_METHOD (HashContext, __serialize)
 
 PHP_METHOD (HashContext, __unserialize)
 
 ZEND_METHOD (HashContext, __debugInfo)
 
 PHP_MINIT_FUNCTION (hash)
 
 PHP_MSHUTDOWN_FUNCTION (hash)
 
 PHP_MINFO_FUNCTION (hash)
 

Variables

zend_class_entryphp_hashcontext_ce
 
zend_module_entry hash_module_entry
 

Macro Definition Documentation

◆ __alignof__

#define __alignof__ ( type)
Value:
offsetof (struct { char c; type member;}, member)
zend_ffi_type * type
Definition ffi.c:3812
#define offsetof(STRUCTURE, FIELD)

Definition at line 40 of file hash.c.

◆ PHP_HASH_HAVAL_REGISTER

#define PHP_HASH_HAVAL_REGISTER ( p,
b )
Value:
php_hash_register_algo("haval" #b "," #p , &php_hash_##p##haval##b##_ops);
PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops)
Definition hash.c:115
p
Definition session.c:1105

Definition at line 1150 of file hash.c.

◆ PHP_HASHCONTEXT_VERIFY

#define PHP_HASHCONTEXT_VERIFY ( hash)
Value:
{ \
if (!hash->context) { \
zend_argument_type_error(1, "must be a valid, non-finalized HashContext"); \
RETURN_THROWS(); \
} \
}
hash(string $algo, string $data, bool $binary=false, array $options=[])
Definition hash.stub.php:12

Definition at line 681 of file hash.c.

Function Documentation

◆ PHP_FUNCTION() [1/15]

PHP_FUNCTION ( hash )

Definition at line 422 of file hash.c.

◆ PHP_FUNCTION() [2/15]

PHP_FUNCTION ( hash_algos )

Definition at line 861 of file hash.c.

◆ PHP_FUNCTION() [3/15]

PHP_FUNCTION ( hash_copy )

Definition at line 837 of file hash.c.

◆ PHP_FUNCTION() [4/15]

PHP_FUNCTION ( hash_equals )

Definition at line 1114 of file hash.c.

◆ PHP_FUNCTION() [5/15]

PHP_FUNCTION ( hash_file )

Definition at line 444 of file hash.c.

◆ PHP_FUNCTION() [6/15]

PHP_FUNCTION ( hash_final )

Definition at line 779 of file hash.c.

◆ PHP_FUNCTION() [7/15]

PHP_FUNCTION ( hash_hkdf )

Definition at line 896 of file hash.c.

◆ PHP_FUNCTION() [8/15]

PHP_FUNCTION ( hash_hmac )

Definition at line 579 of file hash.c.

◆ PHP_FUNCTION() [9/15]

PHP_FUNCTION ( hash_hmac_algos )

Definition at line 877 of file hash.c.

◆ PHP_FUNCTION() [10/15]

PHP_FUNCTION ( hash_hmac_file )

Definition at line 596 of file hash.c.

◆ PHP_FUNCTION() [11/15]

PHP_FUNCTION ( hash_init )

Definition at line 612 of file hash.c.

◆ PHP_FUNCTION() [12/15]

PHP_FUNCTION ( hash_pbkdf2 )

Definition at line 989 of file hash.c.

◆ PHP_FUNCTION() [13/15]

PHP_FUNCTION ( hash_update )

Definition at line 689 of file hash.c.

◆ PHP_FUNCTION() [14/15]

PHP_FUNCTION ( hash_update_file )

Definition at line 745 of file hash.c.

◆ PHP_FUNCTION() [15/15]

PHP_FUNCTION ( hash_update_stream )

Definition at line 708 of file hash.c.

◆ php_hash_copy()

PHP_HASH_API zend_result php_hash_copy ( const void * ops,
const void * orig_context,
void * dest_context )

Definition at line 124 of file hash.c.

◆ php_hash_fetch_ops()

PHP_HASH_API const php_hash_ops * php_hash_fetch_ops ( zend_string * algo)

Definition at line 105 of file hash.c.

◆ php_hash_register_algo()

PHP_HASH_API void php_hash_register_algo ( const char * algo,
const php_hash_ops * ops )

Definition at line 115 of file hash.c.

◆ php_hash_serialize()

PHP_HASH_API zend_result php_hash_serialize ( const php_hashcontext_object * hash,
zend_long * magic,
zval * zv )

Definition at line 334 of file hash.c.

◆ php_hash_serialize_spec()

PHP_HASH_API zend_result php_hash_serialize_spec ( const php_hashcontext_object * hash,
zval * zv,
const char * spec )

Definition at line 232 of file hash.c.

◆ php_hash_unserialize()

PHP_HASH_API int php_hash_unserialize ( php_hashcontext_object * hash,
zend_long magic,
const zval * zv )

Definition at line 345 of file hash.c.

◆ php_hash_unserialize_spec()

PHP_HASH_API int php_hash_unserialize_spec ( php_hashcontext_object * hash,
const zval * zv,
const char * spec )

Definition at line 280 of file hash.c.

◆ PHP_METHOD() [1/3]

PHP_METHOD ( HashContext ,
__construct  )

Definition at line 1142 of file hash.c.

◆ PHP_METHOD() [2/3]

PHP_METHOD ( HashContext ,
__serialize  )

Definition at line 1452 of file hash.c.

◆ PHP_METHOD() [3/3]

PHP_METHOD ( HashContext ,
__unserialize  )

Definition at line 1500 of file hash.c.

◆ PHP_MINFO_FUNCTION()

PHP_MINFO_FUNCTION ( hash )

Definition at line 1680 of file hash.c.

◆ PHP_MINIT_FUNCTION()

PHP_MINIT_FUNCTION ( hash )

Definition at line 1583 of file hash.c.

◆ PHP_MSHUTDOWN_FUNCTION()

PHP_MSHUTDOWN_FUNCTION ( hash )

Definition at line 1671 of file hash.c.

◆ ZEND_METHOD()

ZEND_METHOD ( HashContext ,
__debugInfo  )

Definition at line 1567 of file hash.c.

Variable Documentation

◆ hash_module_entry

zend_module_entry hash_module_entry
Initial value:
= {
ext_functions,
NULL,
NULL,
}
#define NULL
Definition gdcache.h:45
#define PHP_MINFO
Definition php.h:396
#define PHP_MSHUTDOWN
Definition php.h:393
#define PHP_MINIT
Definition php.h:392
#define PHP_HASH_EXTNAME
Definition php_hash.h:22
#define PHP_HASH_VERSION
Definition php_hash.h:23
#define STANDARD_MODULE_HEADER
#define STANDARD_MODULE_PROPERTIES

Definition at line 1707 of file hash.c.

◆ php_hashcontext_ce

zend_class_entry* php_hashcontext_ce

Definition at line 45 of file hash.c.