S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
crypto_functions_mbedtls.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
25#ifndef SOPC_CRYPTO_FUNCTIONS_LIB_H_
26#define SOPC_CRYPTO_FUNCTIONS_LIB_H_
27
28#include "sopc_crypto_decl.h"
29
30/* ------------------------------------------------------------------------------------------------
31 * Aes128-Sha256-RsaOaep
32 * ------------------------------------------------------------------------------------------------
33 */
34
36 const uint8_t* pInput,
37 uint32_t lenPlainText,
38 const SOPC_ExposedBuffer* pKey,
39 const SOPC_ExposedBuffer* pIV,
40 uint8_t* pOutput,
41 uint32_t lenOutput);
43 const uint8_t* pInput,
44 uint32_t lenCipherText,
45 const SOPC_ExposedBuffer* pKey,
46 const SOPC_ExposedBuffer* pIV,
47 uint8_t* pOutput,
48 uint32_t lenOutput);
49
50/* ------------------------------------------------------------------------------------------------
51 * Basic256Sha256
52 * ------------------------------------------------------------------------------------------------
53 */
54
56 const uint8_t* pInput,
57 uint32_t lenPlainText,
58 const SOPC_ExposedBuffer* pKey,
59 const SOPC_ExposedBuffer* pIV,
60 uint8_t* pOutput,
61 uint32_t lenOutput);
63 const uint8_t* pInput,
64 uint32_t lenCipherText,
65 const SOPC_ExposedBuffer* pKey,
66 const SOPC_ExposedBuffer* pIV,
67 uint8_t* pOutput,
68 uint32_t lenOutput);
70 const uint8_t* pInput,
71 uint32_t lenInput,
72 const SOPC_ExposedBuffer* pKey,
73 uint8_t* pOutput);
75 const uint8_t* pInput,
76 uint32_t lenInput,
77 const SOPC_ExposedBuffer* pKey,
78 const uint8_t* pSignature);
80 SOPC_ExposedBuffer* pData,
81 uint32_t lenData);
83 const SOPC_ExposedBuffer* pSecret,
84 uint32_t lenSecret,
85 const SOPC_ExposedBuffer* pSeed,
86 uint32_t lenSeed,
87 SOPC_ExposedBuffer* pOutput,
88 uint32_t lenOutput);
89
91 const uint8_t* pInput,
92 uint32_t lenPlainText,
93 const SOPC_AsymmetricKey* pKey,
94 uint8_t* pOutput);
96 const uint8_t* pInput,
97 uint32_t lenPlainText,
98 const SOPC_AsymmetricKey* pKey,
99 uint8_t* pOutput,
100 uint32_t* pLenWritten);
101
103 const uint8_t* pInput,
104 uint32_t lenInput,
105 const SOPC_AsymmetricKey* pKey,
106 uint8_t* pSignature);
108 const uint8_t* pInput,
109 uint32_t lenInput,
110 const SOPC_AsymmetricKey* pKey,
111 const uint8_t* pSignature);
112
113/* ------------------------------------------------------------------------------------------------
114 * Aes256-Sha256-RsaOaep
115 * ------------------------------------------------------------------------------------------------
116 */
117
119 const uint8_t* pInput,
120 uint32_t lenPlainText,
121 const SOPC_AsymmetricKey* pKey,
122 uint8_t* pOutput);
124 const uint8_t* pInput,
125 uint32_t lenPlainText,
126 const SOPC_AsymmetricKey* pKey,
127 uint8_t* pOutput,
128 uint32_t* pLenWritten);
130 const uint8_t* pInput,
131 uint32_t lenInput,
132 const SOPC_AsymmetricKey* pKey,
133 uint8_t* pSignature);
135 const uint8_t* pInput,
136 uint32_t lenInput,
137 const SOPC_AsymmetricKey* pKey,
138 const uint8_t* pSignature);
139
140/* ------------------------------------------------------------------------------------------------
141 * Basic256
142 * ------------------------------------------------------------------------------------------------
143 */
144
146 const uint8_t* pInput,
147 uint32_t lenInput,
148 const SOPC_ExposedBuffer* pKey,
149 uint8_t* pOutput);
151 const uint8_t* pInput,
152 uint32_t lenInput,
153 const SOPC_ExposedBuffer* pKey,
154 const uint8_t* pSignature);
156 const SOPC_ExposedBuffer* pSecret,
157 uint32_t lenSecret,
158 const SOPC_ExposedBuffer* pSeed,
159 uint32_t lenSeed,
160 SOPC_ExposedBuffer* pOutput,
161 uint32_t lenOutput);
163 const uint8_t* pInput,
164 uint32_t lenInput,
165 const SOPC_AsymmetricKey* pKey,
166 uint8_t* pSignature);
168 const uint8_t* pInput,
169 uint32_t lenInput,
170 const SOPC_AsymmetricKey* pKey,
171 const uint8_t* pSignature);
172
173/* ------------------------------------------------------------------------------------------------
174 * PubSub AES-256
175 * ------------------------------------------------------------------------------------------------
176 */
177
179 const uint8_t* pInput,
180 uint32_t lenInput,
181 const SOPC_ExposedBuffer* pKey,
182 const SOPC_ExposedBuffer* pKeyNonce,
183 const SOPC_ExposedBuffer* pRandom,
184 uint32_t uSequenceNumber,
185 uint8_t* pOutput);
186#endif /* SOPC_CRYPTO_FUNCTIONS_LIB_H_ */
SOPC_ReturnStatus CryptoProvider_SymmEncrypt_AES256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, const SOPC_ExposedBuffer *pKey, const SOPC_ExposedBuffer *pIV, uint8_t *pOutput, uint32_t lenOutput)
SOPC_ReturnStatus CryptoProvider_AsymSign_RSASSA_PKCS1_v15_w_SHA256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_AsymDecrypt_RSA_OAEP_SHA256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, const SOPC_AsymmetricKey *pKey, uint8_t *pOutput, uint32_t *pLenWritten)
SOPC_ReturnStatus CryptoProvider_AsymEncrypt_RSA_OAEP_SHA256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, const SOPC_AsymmetricKey *pKey, uint8_t *pOutput)
SOPC_ReturnStatus CryptoProvider_SymmSign_HMAC_SHA1(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_ExposedBuffer *pKey, uint8_t *pOutput)
SOPC_ReturnStatus CryptoProvider_SymmDecrypt_AES256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenCipherText, const SOPC_ExposedBuffer *pKey, const SOPC_ExposedBuffer *pIV, uint8_t *pOutput, uint32_t lenOutput)
SOPC_ReturnStatus CryptoProvider_DeriveData_PRF_SHA1(const SOPC_CryptoProvider *pProvider, const SOPC_ExposedBuffer *pSecret, uint32_t lenSecret, const SOPC_ExposedBuffer *pSeed, uint32_t lenSeed, SOPC_ExposedBuffer *pOutput, uint32_t lenOutput)
SOPC_ReturnStatus CryptoProvider_SymmVerify_HMAC_SHA1(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_ExposedBuffer *pKey, const uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_SymmVerify_HMAC_SHA256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_ExposedBuffer *pKey, const uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_AsymSign_RSASSA_PKCS1_v15_w_SHA1(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_AsymEncrypt_RSA_OAEP(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, const SOPC_AsymmetricKey *pKey, uint8_t *pOutput)
SOPC_ReturnStatus CryptoProvider_GenTrueRnd(const SOPC_CryptoProvider *pProvider, SOPC_ExposedBuffer *pData, uint32_t lenData)
SOPC_ReturnStatus CryptoProvider_CTR_Crypt_AES256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_ExposedBuffer *pKey, const SOPC_ExposedBuffer *pKeyNonce, const SOPC_ExposedBuffer *pRandom, uint32_t uSequenceNumber, uint8_t *pOutput)
SOPC_ReturnStatus CryptoProvider_DeriveData_PRF_SHA256(const SOPC_CryptoProvider *pProvider, const SOPC_ExposedBuffer *pSecret, uint32_t lenSecret, const SOPC_ExposedBuffer *pSeed, uint32_t lenSeed, SOPC_ExposedBuffer *pOutput, uint32_t lenOutput)
SOPC_ReturnStatus CryptoProvider_SymmSign_HMAC_SHA256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_ExposedBuffer *pKey, uint8_t *pOutput)
SOPC_ReturnStatus CryptoProvider_AsymVerify_RSASSA_PKCS1_v15_w_SHA256(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, const uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_SymmDecrypt_AES128(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenCipherText, const SOPC_ExposedBuffer *pKey, const SOPC_ExposedBuffer *pIV, uint8_t *pOutput, uint32_t lenOutput)
SOPC_ReturnStatus CryptoProvider_AsymSign_RSASSA_PSS(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_SymmEncrypt_AES128(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, const SOPC_ExposedBuffer *pKey, const SOPC_ExposedBuffer *pIV, uint8_t *pOutput, uint32_t lenOutput)
SOPC_ReturnStatus CryptoProvider_AsymDecrypt_RSA_OAEP(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, const SOPC_AsymmetricKey *pKey, uint8_t *pOutput, uint32_t *pLenWritten)
SOPC_ReturnStatus CryptoProvider_AsymVerify_RSASSA_PSS(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, const uint8_t *pSignature)
SOPC_ReturnStatus CryptoProvider_AsymVerify_RSASSA_PKCS1_v15_w_SHA1(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, const uint8_t *pSignature)
Defines the common declarations for the cryptographic objects. The structures and macros defined in t...
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
uint8_t SOPC_ExposedBuffer
Definition sopc_secret_buffer.h:36
The asymmetric key representation.
Definition key_manager_cyclone.h:42
The SOPC_CryptoProvider context.
Definition sopc_crypto_provider.h:43