1/*
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2015 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Author: Sara Golemon <pollita@php.net> |
16 +----------------------------------------------------------------------+
17*/
18
19/* $Id$ */
20
21#ifndef PHP_HASH_HAVAL_H
22#define PHP_HASH_HAVAL_H
23
24#include "ext/standard/basic_functions.h"
25/* HAVAL context. */
26typedef struct {
27 php_hash_uint32 state[8];
28 php_hash_uint32 count[2];
29 unsigned char buffer[128];
30
31 char passes;
32 short output;
33 void (*Transform)(php_hash_uint32 state[8], const unsigned char block[128]);
34} PHP_HAVAL_CTX;
35
36#define PHP_HASH_HAVAL_INIT_DECL(p,b) PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *); \
37 PHP_HASH_API void PHP_HAVAL##b##Final(unsigned char*, PHP_HAVAL_CTX *);
38
39PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *, const unsigned char *, unsigned int);
40
41PHP_HASH_HAVAL_INIT_DECL(3,128)
42PHP_HASH_HAVAL_INIT_DECL(3,160)
43PHP_HASH_HAVAL_INIT_DECL(3,192)
44PHP_HASH_HAVAL_INIT_DECL(3,224)
45PHP_HASH_HAVAL_INIT_DECL(3,256)
46
47PHP_HASH_HAVAL_INIT_DECL(4,128)
48PHP_HASH_HAVAL_INIT_DECL(4,160)
49PHP_HASH_HAVAL_INIT_DECL(4,192)
50PHP_HASH_HAVAL_INIT_DECL(4,224)
51PHP_HASH_HAVAL_INIT_DECL(4,256)
52
53PHP_HASH_HAVAL_INIT_DECL(5,128)
54PHP_HASH_HAVAL_INIT_DECL(5,160)
55PHP_HASH_HAVAL_INIT_DECL(5,192)
56PHP_HASH_HAVAL_INIT_DECL(5,224)
57PHP_HASH_HAVAL_INIT_DECL(5,256)
58
59#endif
60