php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
KeccakHash.h
Go to the documentation of this file.
1/*
2Implementation by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni,
3Joan Daemen, Michaƫl Peeters, Gilles Van Assche and Ronny Van Keer, hereby
4denoted as "the implementer".
5
6For more information, feedback or questions, please refer to our websites:
7http://keccak.noekeon.org/
8http://keyak.noekeon.org/
9http://ketje.noekeon.org/
10
11To the extent possible under law, the implementer has waived all copyright
12and related or neighboring rights to the source code in this file.
13http://creativecommons.org/publicdomain/zero/1.0/
14*/
15
16#ifndef _KeccakHashInterface_h_
17#define _KeccakHashInterface_h_
18
19#ifndef KeccakP1600_excluded
20
21#include "KeccakSponge.h"
22#include <string.h>
23
24typedef unsigned char BitSequence;
25typedef size_t DataLength;
26typedef enum { SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2 } HashReturn;
27
28typedef struct {
29 KeccakWidth1600_SpongeInstance sponge;
30 unsigned int fixedOutputLength;
31 unsigned char delimitedSuffix;
33
49HashReturn Keccak_HashInitialize(Keccak_HashInstance *hashInstance, unsigned int rate, unsigned int capacity, unsigned int hashbitlen, unsigned char delimitedSuffix);
50
53#define Keccak_HashInitialize_SHAKE128(hashInstance) Keccak_HashInitialize(hashInstance, 1344, 256, 0, 0x1F)
54
57#define Keccak_HashInitialize_SHAKE256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 0, 0x1F)
58
61#define Keccak_HashInitialize_SHA3_224(hashInstance) Keccak_HashInitialize(hashInstance, 1152, 448, 224, 0x06)
62
65#define Keccak_HashInitialize_SHA3_256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 256, 0x06)
66
69#define Keccak_HashInitialize_SHA3_384(hashInstance) Keccak_HashInitialize(hashInstance, 832, 768, 384, 0x06)
70
73#define Keccak_HashInitialize_SHA3_512(hashInstance) Keccak_HashInitialize(hashInstance, 576, 1024, 512, 0x06)
74
86
99
110
111#define Keccak_HashInstance_ImplType 32
112
113#endif
114
115#endif
HashReturn Keccak_HashSqueeze(Keccak_HashInstance *hashInstance, BitSequence *data, DataLength databitlen)
Definition KeccakHash.c:75
HashReturn Keccak_HashInitialize(Keccak_HashInstance *hashInstance, unsigned int rate, unsigned int capacity, unsigned int hashbitlen, unsigned char delimitedSuffix)
Definition KeccakHash.c:21
size_t DataLength
Definition KeccakHash.h:25
HashReturn
Definition KeccakHash.h:26
@ BAD_HASHLEN
Definition KeccakHash.h:26
HashReturn Keccak_HashUpdate(Keccak_HashInstance *hashInstance, const BitSequence *data, DataLength databitlen)
Definition KeccakHash.c:37
unsigned char BitSequence
Definition KeccakHash.h:24
HashReturn Keccak_HashFinal(Keccak_HashInstance *hashInstance, BitSequence *hashval)
Definition KeccakHash.c:64
#define SUCCESS
Definition hash_sha3.c:261
zend_constant * data
#define FAIL(...)
unsigned char delimitedSuffix
Definition KeccakHash.h:31
unsigned int fixedOutputLength
Definition KeccakHash.h:30
KeccakWidth1600_SpongeInstance sponge
Definition KeccakHash.h:29