/*1* HEFTY1 cryptographic hash function2*3* Copyright (c) 2014, dbcc14 <BM-NBx4AKznJuyem3dArgVY8MGyABpihRy5>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions are met:8*9* 1. Redistributions of source code must retain the above copyright notice, this10* list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright notice,12* this list of conditions and the following disclaimer in the documentation13* and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE18* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR19* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.25*26* The views and conclusions contained in the software and documentation are those27* of the authors and should not be interpreted as representing official policies,28* either expressed or implied, of the FreeBSD Project.29*/3031#ifndef __HEFTY1_H__32#define __HEFTY1_H__3334#ifdef __cplusplus35extern "C" {36#endif3738#ifndef WIN3239#include <sys/types.h>40#endif4142#include <inttypes.h>4344#define HEFTY1_DIGEST_BYTES 3245#define HEFTY1_BLOCK_BYTES 6446#define HEFTY1_STATE_WORDS 847#define HEFTY1_SPONGE_WORDS 44849typedef struct HEFTY1_CTX {50uint32_t h[HEFTY1_STATE_WORDS];51uint8_t block[HEFTY1_BLOCK_BYTES];52uint64_t written;53uint32_t sponge[HEFTY1_SPONGE_WORDS];54} HEFTY1_CTX;5556void HEFTY1_Init(HEFTY1_CTX *cxt);57void HEFTY1_Update(HEFTY1_CTX *cxt, const void *data, size_t len);58void HEFTY1_Final(unsigned char *digest, HEFTY1_CTX *cxt);59unsigned char* HEFTY1(const unsigned char *data, size_t len, unsigned char *digest);6061#ifdef __cplusplus62}63#endif6465#endif /* __HEFTY1_H__ */6667