SemiDrive SSDK Appication Program Interface PTG3.0
sm3.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 *
4 *Copyright (c) 2021-2029 Semidrive Incorporated. All rights reserved.
5 *Software License Agreement
6 *
7 ******************************************************************************
8 */
9#ifndef SM3_H
10#define SM3_H
11
12#include "hash.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#ifdef SUPPORT_HASH_SM3
19
20typedef hash_ctx_t sm3_ctx_t;
21
22#ifdef HASH_DMA_FUNCTION
23typedef hash_dma_ctx_t sm3_dma_ctx_t;
24#endif
25
26uint32_t sm3_init(sm3_ctx_t *ctx);
27
28uint32_t sm3_update(sm3_ctx_t *ctx, const uint8_t *msg, uint32_t msg_bytes);
29
30uint32_t sm3_final(sm3_ctx_t *ctx, uint8_t *digest);
31
32uint32_t sm3(uint8_t *msg, uint32_t msg_bytes, uint8_t *digest);
33
34#ifdef HASH_DMA_FUNCTION
35uint32_t sm3_dma_init(sm3_dma_ctx_t *ctx, HASH_CALLBACK callback);
36
37uint32_t sm3_dma_update_blocks(sm3_dma_ctx_t *ctx, uint32_t *msg,
38 uint32_t msg_words, uint32_t *iterator);
39
40uint32_t sm3_dma_final(sm3_dma_ctx_t *ctx, uint32_t *remainder_msg,
41 uint32_t remainder_bytes, uint32_t *digest);
42
43uint32_t sm3_dma(uint32_t *msg, uint32_t msg_bytes, uint32_t *digest,
44 HASH_CALLBACK callback);
45#endif
46
47#endif
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif
void(* HASH_CALLBACK)(void)
Definition: hash_basic.h:195
Definition: hash.h:24