2 Star 3 Fork 2

wdliming/avr-crypto-lib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hashfunction_descriptor.h 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
bg 提交于 2013-09-20 02:11 . changing some types from uint16_t to size_t
/* hashfunction_descriptor.h */
#ifndef HASHFUNCTION_DESCRIPTOR_H_
#define HASHFUNCTION_DESCRIPTOR_H_
#include <stdint.h>
#include <avr/pgmspace.h>
#ifndef VOID_FPT
#define VOID_FPT
typedef void(*void_fpt)(void);
#endif
typedef void(*hf_init_fpt)(void*);
typedef void(*hf_nextBlock_fpt)(void*, const void*);
typedef void(*hf_lastBlock_fpt)(void*, const void*, uint16_t);
typedef void(*hf_ctx2hash_fpt)(void*, void*);
typedef void(*hf_free_fpt)(void*);
typedef void(*hf_mem_fpt)(void*, const void*, uint32_t);
#define HFDESC_TYPE_HASHFUNCTION 0x02
typedef struct {
/** typefield, always 2 for hash functions */
uint8_t type; /* 2 == hashfunction */
/** flags, currently unused should be set to zero */
uint8_t flags;
/** name, flash pointer to the name string */
PGM_P name;
/** ctxsize_B, size of the hash context in bytes */
size_t ctxsize_B;
/** blocksize_b, size of an input block in bits */
uint16_t blocksize_b;
/** hashsize_b, size of the output hash value in bits */
uint16_t hashsize_b;
/** init, function pointer to the algorithms init function */
hf_init_fpt init;
/** nextBlock, function pointer to the algorithms nextBlock function */
hf_nextBlock_fpt nextBlock;
/** lastBlock, function pointer to the algorithms lastBlock function */
hf_lastBlock_fpt lastBlock;
/** ctx2hash, function pointer to the algorithms ctx2hash function */
hf_ctx2hash_fpt ctx2hash;
/** free, function pointer to the algorithms free function or NULL if
* there is no such function */
hf_free_fpt free;
/** mem, function pointer to a function which hashes a message in RAM
* completely or NULL if there is no such function */
hf_mem_fpt mem;
} hfdesc_t; /* hashfunction descriptor type */
typedef struct{
hfdesc_t *desc_ptr;
void* ctx;
} hfgen_ctx_t;
#endif /* HASHFUNCTION_DESCRIPTOR_H_ */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/liming2019/avr-crypto-lib.git
git@gitee.com:liming2019/avr-crypto-lib.git
liming2019
avr-crypto-lib
avr-crypto-lib
master

搜索帮助