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

Go to the source code of this file.

Macros

#define F1(x6, x5, x4, x3, x2, x1, x0)
 
#define F2(x6, x5, x4, x3, x2, x1, x0)
 
#define F3(x6, x5, x4, x3, x2, x1, x0)
 
#define F4(x6, x5, x4, x3, x2, x1, x0)
 
#define F5(x6, x5, x4, x3, x2, x1, x0)
 
#define ROTR(x, n)
 
#define PHP_HASH_HAVAL_INIT(p, b)
 
#define PHP_HASH_HAVAL_VERSION   0x01
 

Functions

PHP_HASH_API void PHP_HAVALUpdate (PHP_HAVAL_CTX *context, const unsigned char *input, size_t inputLen)
 
PHP_HASH_API void PHP_HAVAL128Final (unsigned char *digest, PHP_HAVAL_CTX *context)
 
PHP_HASH_API void PHP_HAVAL160Final (unsigned char *digest, PHP_HAVAL_CTX *context)
 
PHP_HASH_API void PHP_HAVAL192Final (unsigned char *digest, PHP_HAVAL_CTX *context)
 
PHP_HASH_API void PHP_HAVAL224Final (unsigned char *digest, PHP_HAVAL_CTX *context)
 
PHP_HASH_API void PHP_HAVAL256Final (unsigned char *digest, PHP_HAVAL_CTX *context)
 

Macro Definition Documentation

◆ F1

#define F1 ( x6,
x5,
x4,
x3,
x2,
x1,
x0 )
Value:
( ((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ ((x0) & (x1)) ^ (x0) )

Definition at line 125 of file hash_haval.c.

◆ F2

#define F2 ( x6,
x5,
x4,
x3,
x2,
x1,
x0 )
Value:
( ((x1) & (x2) & (x3)) ^ ((x2) & (x4) & (x5)) ^ ((x1) & (x2)) ^ ((x1) & (x4)) ^ \
((x2) & (x6)) ^ ((x3) & (x5)) ^ ((x4) & (x5)) ^ ((x0) & (x2)) ^ (x0) )

Definition at line 126 of file hash_haval.c.

◆ F3

#define F3 ( x6,
x5,
x4,
x3,
x2,
x1,
x0 )
Value:
( ((x1) & (x2) & (x3)) ^ ((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ ((x0) & (x3)) ^ (x0) )

Definition at line 128 of file hash_haval.c.

◆ F4

#define F4 ( x6,
x5,
x4,
x3,
x2,
x1,
x0 )
Value:
( ((x1) & (x2) & (x3)) ^ ((x2) & (x4) & (x5)) ^ ((x3) & (x4) & (x6)) ^ \
((x1) & (x4)) ^ ((x2) & (x6)) ^ ((x3) & (x4)) ^ ((x3) & (x5)) ^ \
((x3) & (x6)) ^ ((x4) & (x5)) ^ ((x4) & (x6)) ^ ((x0) & (x4)) ^ (x0) )

Definition at line 129 of file hash_haval.c.

◆ F5

#define F5 ( x6,
x5,
x4,
x3,
x2,
x1,
x0 )
Value:
( ((x1) & (x4)) ^ ((x2) & (x5)) ^ ((x3) & (x6)) ^ \
((x0) & (x1) & (x2) & (x3)) ^ ((x0) & (x5)) ^ (x0) )

Definition at line 132 of file hash_haval.c.

◆ PHP_HASH_HAVAL_INIT

#define PHP_HASH_HAVAL_INIT ( p,
b )
Value:
const php_hash_ops php_hash_##p##haval##b##_ops = { \
"haval" #b "," #p, \
(php_hash_init_func_t) PHP_##p##HAVAL##b##Init, \
(php_hash_final_func_t) PHP_HAVAL##b##Final, \
((b) / 8), 128, sizeof(PHP_HAVAL_CTX), 1 }; \
{ int i; context->count[0] = context->count[1] = 0; \
for(i = 0; i < 8; i++) context->state[i] = D0[i]; \
context->passes = p; context->output = b; \
context->Transform = PHP_##p##HAVALTransform; }
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 int php_hash_unserialize(php_hashcontext_object *hash, zend_long magic, const zval *zv)
Definition hash.c:345
PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *context, const unsigned char *input, size_t inputLen)
Definition hash_haval.c:281
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_HASH_API
Definition php_hash.h:144
struct _php_hash_ops php_hash_ops
#define PHP_HAVAL_SPEC
p
Definition session.c:1105
Definition dce.c:49
zval * args
#define ZEND_ATTRIBUTE_UNUSED
struct _zend_array HashTable
Definition zend_types.h:386

Definition at line 245 of file hash_haval.c.

◆ PHP_HASH_HAVAL_VERSION

#define PHP_HASH_HAVAL_VERSION   0x01

Definition at line 316 of file hash_haval.c.

◆ ROTR

#define ROTR ( x,
n )
Value:
(((x) >> (n)) | ((x) << (32 - (n))))
zend_long n
Definition ffi.c:4979

Definition at line 135 of file hash_haval.c.

Function Documentation

◆ PHP_HAVAL128Final()

PHP_HASH_API void PHP_HAVAL128Final ( unsigned char * digest,
PHP_HAVAL_CTX * context )

Definition at line 319 of file hash_haval.c.

◆ PHP_HAVAL160Final()

PHP_HASH_API void PHP_HAVAL160Final ( unsigned char * digest,
PHP_HAVAL_CTX * context )

Definition at line 372 of file hash_haval.c.

◆ PHP_HAVAL192Final()

PHP_HASH_API void PHP_HAVAL192Final ( unsigned char * digest,
PHP_HAVAL_CTX * context )

Definition at line 425 of file hash_haval.c.

◆ PHP_HAVAL224Final()

PHP_HASH_API void PHP_HAVAL224Final ( unsigned char * digest,
PHP_HAVAL_CTX * context )

Definition at line 464 of file hash_haval.c.

◆ PHP_HAVAL256Final()

PHP_HASH_API void PHP_HAVAL256Final ( unsigned char * digest,
PHP_HAVAL_CTX * context )

Definition at line 504 of file hash_haval.c.

◆ PHP_HAVALUpdate()

PHP_HASH_API void PHP_HAVALUpdate ( PHP_HAVAL_CTX * context,
const unsigned char * input,
size_t inputLen )

Definition at line 281 of file hash_haval.c.