WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
sha256.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2012-2020. All rights reserved.
3 * Description: the head File of sha256
4 */
5
6#ifndef SHA256_H
7#define SHA256_H
8
9#include <stdint.h>
10#include "std_def.h"
11
12#define SHA256_HASH_SIZE 32
13
14/* Hash size in 32-bit words */
15#define SHA256_HASH_WORDS 8
16
17#define SHA256_BUFFER_WORDS 16
18#define SHA256_BUFFER_BYTES 64
19
23 uint32_t buffer_length;
24
25 union {
29#ifdef RUNTIME_ENDIAN
30 int little_endian;
31#endif /* RUNTIME_ENDIAN */
32};
33
35
37void SHA256Update(sha256_context_t *sc, const void *vdata, uint32_t len);
38
39void sha256_final(sha256_context_t *sc, uint8_t hash[SHA256_HASH_SIZE], uint32_t hash_len);
40void sha256_hash(const uint8_t *in_buff, uint32_t in_buff_len, uint8_t *out_buff, uint32_t out_buff_len);
41
42#endif
#define SHA256_HASH_WORDS
Definition sha256.h:15
void sha256_init(sha256_context_t *sc)
Definition sha256.c:165
void SHA256Update(sha256_context_t *sc, const void *vdata, uint32_t len)
Definition sha256.c:305
#define SHA256_BUFFER_WORDS
Definition sha256.h:17
void sha256_final(sha256_context_t *sc, uint8_t hash[32], uint32_t hash_len)
#define SHA256_BUFFER_BYTES
Definition sha256.h:18
#define SHA256_HASH_SIZE
Definition sha256.h:12
void sha256_hash(const uint8_t *in_buff, uint32_t in_buff_len, uint8_t *out_buff, uint32_t out_buff_len)
Definition sha256.c:421
unsigned long long uint64_t
Definition osal_types.h:35
Definition sha256.h:20
uint32_t words[16]
Definition sha256.h:26
union _sha256_context::@390 buffer
uint32_t hash[8]
Definition sha256.h:22
uint32_t buffer_length
Definition sha256.h:23
uint8_t bytes[64]
Definition sha256.h:27
uint64_t total_length
Definition sha256.h:21