API参考
载入中...
搜索中...
未找到
eal_cipher_local.h
1/*
2 * This file is part of the openHiTLS project.
3 *
4 * openHiTLS is licensed under the Mulan PSL v2.
5 * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 * You may obtain a copy of Mulan PSL v2 at:
7 *
8 * http://license.coscl.org.cn/MulanPSL2
9 *
10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13 * See the Mulan PSL v2 for more details.
14 */
15
16#ifndef EAL_CIPHER_LOCAL_H
17#define EAL_CIPHER_LOCAL_H
18
19#include "hitls_build.h"
20#if defined(HITLS_CRYPTO_EAL) && defined(HITLS_CRYPTO_CIPHER)
21
22#include "crypt_algid.h"
23#include "crypt_eal_cipher.h"
24#include "crypt_local_types.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif // __cplusplus
29
33typedef enum {
34 EAL_CIPHER_STATE_NEW,
35 EAL_CIPHER_STATE_INIT,
36 EAL_CIPHER_STATE_UPDATE,
37 EAL_CIPHER_STATE_FINAL
38} EAL_CipherStates;
39
44typedef struct {
45 uint32_t id;
46 CRYPT_MODE_AlgId modeId;
47} EAL_SymAlgMap;
48
54typedef struct {
55 CRYPT_CIPHER_AlgId id;
56 uint8_t blockSize;
57 uint32_t keyLen;
58 uint32_t ivLen;
59} CRYPT_CipherInfo;
60
64struct CRYPT_EAL_CipherCtxLocal {
65 CRYPT_CIPHER_AlgId id;
66 EAL_CipherStates states;
67 void *ctx;
68 EAL_CipherMethod method;
69};
70
71const EAL_SymMethod *EAL_GetSymMethod(int32_t algId);
72
83int32_t EAL_CipherFindMethod(CRYPT_CIPHER_AlgId id, EAL_CipherMethod *method);
84
98int32_t EAL_ProviderCipherFindMethod(CRYPT_CIPHER_AlgId id, void *libCtx, const char *attrName,
99 EAL_CipherMethod *method, void **provCtx);
100
110int32_t EAL_GetCipherInfo(CRYPT_CIPHER_AlgId id, CRYPT_CipherInfo *info);
111
119const EAL_CipherMethod *EAL_FindModeMethod(CRYPT_MODE_AlgId id);
120
121
122#ifdef __cplusplus
123}
124#endif // __cplusplus
125
126#endif // HITLS_CRYPTO_CIPHER
127
128#endif // EAL_CIPHER_LOCAL_H
定义 crypt_local_types.h:253
定义 crypt_local_types.h:241