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
20
struct
_sha256_context
{
21
uint64_t
total_length
;
22
uint32_t
hash
[
SHA256_HASH_WORDS
];
23
uint32_t
buffer_length
;
24
25
union
{
26
uint32_t
words
[
SHA256_BUFFER_WORDS
];
27
uint8_t
bytes
[
SHA256_BUFFER_BYTES
];
28
}
buffer
;
29
#ifdef RUNTIME_ENDIAN
30
int
little_endian;
31
#endif
/* RUNTIME_ENDIAN */
32
};
33
34
typedef
struct
_sha256_context
sha256_context_t
;
35
36
void
sha256_init
(
sha256_context_t
*sc);
37
void
SHA256Update
(
sha256_context_t
*sc,
const
void
*vdata, uint32_t len);
38
39
void
sha256_final
(
sha256_context_t
*sc, uint8_t
hash
[
SHA256_HASH_SIZE
], uint32_t hash_len);
40
void
sha256_hash
(
const
uint8_t *in_buff, uint32_t in_buff_len, uint8_t *out_buff, uint32_t out_buff_len);
41
42
#endif
SHA256_HASH_WORDS
#define SHA256_HASH_WORDS
Definition
sha256.h:15
sha256_init
void sha256_init(sha256_context_t *sc)
Definition
sha256.c:165
SHA256Update
void SHA256Update(sha256_context_t *sc, const void *vdata, uint32_t len)
Definition
sha256.c:305
SHA256_BUFFER_WORDS
#define SHA256_BUFFER_WORDS
Definition
sha256.h:17
sha256_final
void sha256_final(sha256_context_t *sc, uint8_t hash[32], uint32_t hash_len)
SHA256_BUFFER_BYTES
#define SHA256_BUFFER_BYTES
Definition
sha256.h:18
SHA256_HASH_SIZE
#define SHA256_HASH_SIZE
Definition
sha256.h:12
sha256_hash
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
uint64_t
unsigned long long uint64_t
Definition
osal_types.h:35
std_def.h
_sha256_context
Definition
sha256.h:20
_sha256_context::words
uint32_t words[16]
Definition
sha256.h:26
_sha256_context::buffer
union _sha256_context::@390 buffer
_sha256_context::hash
uint32_t hash[8]
Definition
sha256.h:22
_sha256_context::buffer_length
uint32_t buffer_length
Definition
sha256.h:23
_sha256_context::bytes
uint8_t bytes[64]
Definition
sha256.h:27
_sha256_context::total_length
uint64_t total_length
Definition
sha256.h:21
src
middleware
utils
algorithm
sha256
sha256.h
由
William Goodspeed
维护 | E-mail: gongzl@stu.hebust.edu.cn | Wechat: a23333344 | ALSO CHECKOUT
WS63FLASH
!
生成于 2025年 一月 4日 星期六 17:47:12 , 为 WS63 SDK 文档使用
1.9.8