php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
hash_md.c File Reference
#include "php_hash.h"
#include "php_hash_md.h"

Go to the source code of this file.

Macros

#define MD4_F(x, y, z)
 
#define MD4_G(x, y, z)
 
#define MD4_H(x, y, z)
 
#define ROTL32(s, v)
 
#define MD4_R1(a, b, c, d, k, s)
 
#define MD4_R2(a, b, c, d, k, s)
 
#define MD4_R3(a, b, c, d, k, s)
 

Functions

PHP_HASH_API void PHP_MD4InitArgs (PHP_MD4_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args)
 
PHP_HASH_API void PHP_MD4Update (PHP_MD4_CTX *context, const unsigned char *input, size_t inputLen)
 
PHP_HASH_API void PHP_MD4Final (unsigned char digest[16], PHP_MD4_CTX *context)
 
PHP_HASH_API void PHP_MD2InitArgs (PHP_MD2_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args)
 
PHP_HASH_API void PHP_MD2Update (PHP_MD2_CTX *context, const unsigned char *buf, size_t len)
 
PHP_HASH_API void PHP_MD2Final (unsigned char output[16], PHP_MD2_CTX *context)
 

Variables

const php_hash_ops php_hash_md5_ops
 
const php_hash_ops php_hash_md4_ops
 
const php_hash_ops php_hash_md2_ops
 

Macro Definition Documentation

◆ MD4_F

#define MD4_F ( x,
y,
z )
Value:
((z) ^ ((x) & ((y) ^ (z))))

Definition at line 109 of file hash_md.c.

◆ MD4_G

#define MD4_G ( x,
y,
z )
Value:
(((x) & ((y) | (z))) | ((y) & (z)))

Definition at line 110 of file hash_md.c.

◆ MD4_H

#define MD4_H ( x,
y,
z )
Value:
((x) ^ (y) ^ (z))

Definition at line 111 of file hash_md.c.

◆ MD4_R1

#define MD4_R1 ( a,
b,
c,
d,
k,
s )
Value:
a = ROTL32(s, a + MD4_F(b,c,d) + x[k])
char s[4]
Definition cdf.c:77
#define MD4_F(x, y, z)
Definition hash_md.c:109
#define ROTL32(s, v)
Definition hash_md.c:113
$obj a
Definition test.php:84

Definition at line 115 of file hash_md.c.

◆ MD4_R2

#define MD4_R2 ( a,
b,
c,
d,
k,
s )
Value:
a = ROTL32(s, a + MD4_G(b,c,d) + x[k] + 0x5A827999)
#define MD4_G(x, y, z)
Definition hash_md.c:110

Definition at line 116 of file hash_md.c.

◆ MD4_R3

#define MD4_R3 ( a,
b,
c,
d,
k,
s )
Value:
a = ROTL32(s, a + MD4_H(b,c,d) + x[k] + 0x6ED9EBA1)
#define MD4_H(x, y, z)
Definition hash_md.c:111

Definition at line 117 of file hash_md.c.

◆ ROTL32

#define ROTL32 ( s,
v )
Value:
(((v) << (s)) | ((v) >> (32 - (s))))
uint32_t v
Definition cdf.c:1237

Definition at line 113 of file hash_md.c.

Function Documentation

◆ PHP_MD2Final()

PHP_HASH_API void PHP_MD2Final ( unsigned char output[16],
PHP_MD2_CTX * context )

Definition at line 350 of file hash_md.c.

◆ PHP_MD2InitArgs()

PHP_HASH_API void PHP_MD2InitArgs ( PHP_MD2_CTX * context,
ZEND_ATTRIBUTE_UNUSED HashTable * args )

Definition at line 291 of file hash_md.c.

◆ PHP_MD2Update()

PHP_HASH_API void PHP_MD2Update ( PHP_MD2_CTX * context,
const unsigned char * buf,
size_t len )

Definition at line 319 of file hash_md.c.

◆ PHP_MD4Final()

PHP_HASH_API void PHP_MD4Final ( unsigned char digest[16],
PHP_MD4_CTX * context )

Definition at line 245 of file hash_md.c.

◆ PHP_MD4InitArgs()

PHP_HASH_API void PHP_MD4InitArgs ( PHP_MD4_CTX * context,
ZEND_ATTRIBUTE_UNUSED HashTable * args )

Definition at line 188 of file hash_md.c.

◆ PHP_MD4Update()

PHP_HASH_API void PHP_MD4Update ( PHP_MD4_CTX * context,
const unsigned char * input,
size_t inputLen )

Definition at line 205 of file hash_md.c.

Variable Documentation

◆ php_hash_md2_ops

const php_hash_ops php_hash_md2_ops
Initial value:
= {
"md2",
php_md2_unserialize,
16,
16,
sizeof(PHP_MD2_CTX),
1
}
PHP_HASH_API zend_result php_hash_serialize(const php_hashcontext_object *hash, zend_long *magic, zval *zv)
Definition hash.c:334
PHP_HASH_API zend_result php_hash_copy(const void *ops, const void *orig_context, void *dest_context)
Definition hash.c:124
PHP_HASH_API void PHP_MD2InitArgs(PHP_MD2_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args)
Definition hash_md.c:291
PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, size_t len)
Definition hash_md.c:319
PHP_HASH_API void PHP_MD2Final(unsigned char output[16], PHP_MD2_CTX *context)
Definition hash_md.c:350
void(* php_hash_final_func_t)(unsigned char *digest, void *context)
Definition php_hash.h:36
void(* php_hash_init_func_t)(void *context, HashTable *args)
Definition php_hash.h:34
void(* php_hash_update_func_t)(void *context, const unsigned char *buf, size_t count)
Definition php_hash.h:35
#define PHP_MD2_SPEC
Definition php_hash_md.h:43

Definition at line 52 of file hash_md.c.

◆ php_hash_md4_ops

const php_hash_ops php_hash_md4_ops
Initial value:
= {
"md4",
16,
64,
sizeof(PHP_MD4_CTX),
1
}
PHP_HASH_API int php_hash_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
Definition hash.c:345
PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *input, size_t inputLen)
Definition hash_md.c:205
PHP_HASH_API void PHP_MD4InitArgs(PHP_MD4_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args)
Definition hash_md.c:188
PHP_HASH_API void PHP_MD4Final(unsigned char digest[16], PHP_MD4_CTX *context)
Definition hash_md.c:245
#define PHP_MD4_SPEC
Definition php_hash_md.h:29

Definition at line 35 of file hash_md.c.

◆ php_hash_md5_ops

const php_hash_ops php_hash_md5_ops
Initial value:
= {
"md5",
16,
64,
sizeof(PHP_MD5_CTX),
1
}
PHPAPI void PHP_MD5InitArgs(PHP_MD5_CTX *ctx, ZEND_ATTRIBUTE_UNUSED HashTable *args)
Definition md5.c:293
PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx)
Definition md5.c:339
PHPAPI void PHP_MD5Update(PHP_MD5_CTX *ctx, const void *data, size_t size)
Definition md5.c:304
#define PHP_MD5_SPEC
Definition md5.h:41

Definition at line 20 of file hash_md.c.