Algo/sha3x/sha3x.h

35 lines
865 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef SHA3X_H
#define SHA3X_H
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* SHA3-256哈希函数
* @param out 输出缓冲区用于存储32字节的哈希结果
* @param outlen 输出长度必须小于等于32
* @param in 输入数据
* @param inlen 输入数据长度
* @return 0表示成功-1表示失败
*/
int sha3_256(uint8_t* out, size_t outlen, const uint8_t* in, size_t inlen);
/**
* SHA3X三重哈希函数Tari项目中的SHA3X算法
* @param out 输出缓冲区用于存储32字节的哈希结果
* @param outlen 输出长度必须小于等于32
* @param in 输入数据
* @param inlen 输入数据长度
* @return 0表示成功-1表示失败
*/
int sha3x_hash(uint8_t* out, size_t outlen, const uint8_t* in, size_t inlen);
#ifdef __cplusplus
}
#endif
#endif // SHA3X_H