mbed TLS v2.28.1
psa_util.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright The Mbed TLS Contributors
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License"); you may
14  * not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  */
25 
26 #ifndef MBEDTLS_PSA_UTIL_H
27 #define MBEDTLS_PSA_UTIL_H
28 
29 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include "mbedtls/config.h"
31 #else
32 #include MBEDTLS_CONFIG_FILE
33 #endif
34 
35 #if defined(MBEDTLS_USE_PSA_CRYPTO)
36 
37 #include "psa/crypto.h"
38 
39 #include "mbedtls/ecp.h"
40 #include "mbedtls/md.h"
41 #include "mbedtls/pk.h"
42 #include "mbedtls/oid.h"
43 
44 #include <string.h>
45 
46 /* Translations for symmetric crypto. */
47 
48 static inline psa_key_type_t mbedtls_psa_translate_cipher_type(
49  mbedtls_cipher_type_t cipher )
50 {
51  switch( cipher )
52  {
65  return( PSA_KEY_TYPE_AES );
66 
67  /* ARIA not yet supported in PSA. */
68  /* case MBEDTLS_CIPHER_ARIA_128_CCM:
69  case MBEDTLS_CIPHER_ARIA_192_CCM:
70  case MBEDTLS_CIPHER_ARIA_256_CCM:
71  case MBEDTLS_CIPHER_ARIA_128_GCM:
72  case MBEDTLS_CIPHER_ARIA_192_GCM:
73  case MBEDTLS_CIPHER_ARIA_256_GCM:
74  case MBEDTLS_CIPHER_ARIA_128_CBC:
75  case MBEDTLS_CIPHER_ARIA_192_CBC:
76  case MBEDTLS_CIPHER_ARIA_256_CBC:
77  return( PSA_KEY_TYPE_ARIA ); */
78 
79  default:
80  return( 0 );
81  }
82 }
83 
84 static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode(
85  mbedtls_cipher_mode_t mode, size_t taglen )
86 {
87  switch( mode )
88  {
89  case MBEDTLS_MODE_ECB:
90  return( PSA_ALG_ECB_NO_PADDING );
91  case MBEDTLS_MODE_GCM:
92  return( PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_GCM, taglen ) );
93  case MBEDTLS_MODE_CCM:
94  return( PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_CCM, taglen ) );
95  case MBEDTLS_MODE_CBC:
96  if( taglen == 0 )
97  return( PSA_ALG_CBC_NO_PADDING );
98  else
99  return( 0 );
100  default:
101  return( 0 );
102  }
103 }
104 
105 static inline psa_key_usage_t mbedtls_psa_translate_cipher_operation(
107 {
108  switch( op )
109  {
110  case MBEDTLS_ENCRYPT:
111  return( PSA_KEY_USAGE_ENCRYPT );
112  case MBEDTLS_DECRYPT:
113  return( PSA_KEY_USAGE_DECRYPT );
114  default:
115  return( 0 );
116  }
117 }
118 
119 /* Translations for hashing. */
120 
121 static inline psa_algorithm_t mbedtls_psa_translate_md( mbedtls_md_type_t md_alg )
122 {
123  switch( md_alg )
124  {
125 #if defined(MBEDTLS_MD2_C)
126  case MBEDTLS_MD_MD2:
127  return( PSA_ALG_MD2 );
128 #endif
129 #if defined(MBEDTLS_MD4_C)
130  case MBEDTLS_MD_MD4:
131  return( PSA_ALG_MD4 );
132 #endif
133 #if defined(MBEDTLS_MD5_C)
134  case MBEDTLS_MD_MD5:
135  return( PSA_ALG_MD5 );
136 #endif
137 #if defined(MBEDTLS_SHA1_C)
138  case MBEDTLS_MD_SHA1:
139  return( PSA_ALG_SHA_1 );
140 #endif
141 #if defined(MBEDTLS_SHA256_C)
142  case MBEDTLS_MD_SHA224:
143  return( PSA_ALG_SHA_224 );
144  case MBEDTLS_MD_SHA256:
145  return( PSA_ALG_SHA_256 );
146 #endif
147 #if defined(MBEDTLS_SHA512_C)
148  case MBEDTLS_MD_SHA384:
149  return( PSA_ALG_SHA_384 );
150  case MBEDTLS_MD_SHA512:
151  return( PSA_ALG_SHA_512 );
152 #endif
153 #if defined(MBEDTLS_RIPEMD160_C)
155  return( PSA_ALG_RIPEMD160 );
156 #endif
157  case MBEDTLS_MD_NONE:
158  return( 0 );
159  default:
160  return( 0 );
161  }
162 }
163 
164 /* Translations for ECC. */
165 
166 static inline int mbedtls_psa_get_ecc_oid_from_id(
167  psa_ecc_family_t curve, size_t bits,
168  char const **oid, size_t *oid_len )
169 {
170  switch( curve )
171  {
173  switch( bits )
174  {
175 #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
176  case 192:
179  return( 0 );
180 #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */
181 #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
182  case 224:
185  return( 0 );
186 #endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */
187 #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
188  case 256:
191  return( 0 );
192 #endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */
193 #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)
194  case 384:
197  return( 0 );
198 #endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */
199 #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
200  case 521:
203  return( 0 );
204 #endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */
205  }
206  break;
208  switch( bits )
209  {
210 #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED)
211  case 192:
214  return( 0 );
215 #endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */
216 #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED)
217  case 224:
220  return( 0 );
221 #endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */
222 #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)
223  case 256:
226  return( 0 );
227 #endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */
228  }
229  break;
231  switch( bits )
232  {
233 #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED)
234  case 256:
237  return( 0 );
238 #endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */
239 #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED)
240  case 384:
243  return( 0 );
244 #endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */
245 #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED)
246  case 512:
249  return( 0 );
250 #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */
251  }
252  break;
253  }
254  (void) oid;
255  (void) oid_len;
256  return( -1 );
257 }
258 
259 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH 1
260 
261 #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
262 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 192 + 7 ) / 8 ) + 1 )
263 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
264 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 192 + 7 ) / 8 ) + 1 )
265 #endif
266 #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */
267 
268 #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
269 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 224 + 7 ) / 8 ) + 1 )
270 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
271 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 224 + 7 ) / 8 ) + 1 )
272 #endif
273 #endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */
274 
275 #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
276 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 )
277 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
278 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 )
279 #endif
280 #endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */
281 
282 #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)
283 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 384 + 7 ) / 8 ) + 1 )
284 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
285 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 384 + 7 ) / 8 ) + 1 )
286 #endif
287 #endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */
288 
289 #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
290 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 521 + 7 ) / 8 ) + 1 )
291 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
292 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 521 + 7 ) / 8 ) + 1 )
293 #endif
294 #endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */
295 
296 #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED)
297 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 192 + 7 ) / 8 ) + 1 )
298 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
299 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 192 + 7 ) / 8 ) + 1 )
300 #endif
301 #endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */
302 
303 #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED)
304 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 224 + 7 ) / 8 ) + 1 )
305 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
306 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 224 + 7 ) / 8 ) + 1 )
307 #endif
308 #endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */
309 
310 #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)
311 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 )
312 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
313 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 )
314 #endif
315 #endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */
316 
317 #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED)
318 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 )
319 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
320 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 )
321 #endif
322 #endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */
323 
324 #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED)
325 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 384 + 7 ) / 8 ) + 1 )
326 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
327 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 384 + 7 ) / 8 ) + 1 )
328 #endif
329 #endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */
330 
331 #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED)
332 #if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 512 + 7 ) / 8 ) + 1 )
333 #undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH
334 #define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 512 + 7 ) / 8 ) + 1 )
335 #endif
336 #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */
337 
338 
339 /* Translations for PK layer */
340 
341 static inline int mbedtls_psa_err_translate_pk( psa_status_t status )
342 {
343  switch( status )
344  {
345  case PSA_SUCCESS:
346  return( 0 );
350  return( MBEDTLS_ERR_PK_ALLOC_FAILED );
353  case PSA_ERROR_BAD_STATE:
355  /* All other failures */
360  default: /* We return the same as for the 'other failures',
361  * but list them separately nonetheless to indicate
362  * which failure conditions we have considered. */
364  }
365 }
366 
367 /* Translations for ECC */
368 
369 /* This function transforms an ECC group identifier from
370  * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8
371  * into a PSA ECC group identifier. */
372 #if defined(MBEDTLS_ECP_C)
373 static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group(
374  uint16_t tls_ecc_grp_reg_id, size_t *bits )
375 {
376  const mbedtls_ecp_curve_info *curve_info =
377  mbedtls_ecp_curve_info_from_tls_id( tls_ecc_grp_reg_id );
378  if( curve_info == NULL )
379  return( 0 );
381  mbedtls_ecc_group_to_psa( curve_info->grp_id, bits ) ) );
382 }
383 #endif /* MBEDTLS_ECP_C */
384 
385 /* This function takes a buffer holding an EC public key
386  * exported through psa_export_public_key(), and converts
387  * it into an ECPoint structure to be put into a ClientKeyExchange
388  * message in an ECDHE exchange.
389  *
390  * Both the present and the foreseeable future format of EC public keys
391  * used by PSA have the ECPoint structure contained in the exported key
392  * as a subbuffer, and the function merely selects this subbuffer instead
393  * of making a copy.
394  */
395 static inline int mbedtls_psa_tls_psa_ec_to_ecpoint( unsigned char *src,
396  size_t srclen,
397  unsigned char **dst,
398  size_t *dstlen )
399 {
400  *dst = src;
401  *dstlen = srclen;
402  return( 0 );
403 }
404 
405 /* This function takes a buffer holding an ECPoint structure
406  * (as contained in a TLS ServerKeyExchange message for ECDHE
407  * exchanges) and converts it into a format that the PSA key
408  * agreement API understands.
409  */
410 static inline int mbedtls_psa_tls_ecpoint_to_psa_ec( unsigned char const *src,
411  size_t srclen,
412  unsigned char *dst,
413  size_t dstlen,
414  size_t *olen )
415 {
416  if( srclen > dstlen )
418 
419  memcpy( dst, src, srclen );
420  *olen = srclen;
421  return( 0 );
422 }
423 
424 #endif /* MBEDTLS_USE_PSA_CRYPTO */
425 
426 /* Expose whatever RNG the PSA subsystem uses to applications using the
427  * mbedtls_xxx API. The declarations and definitions here need to be
428  * consistent with the implementation in library/psa_crypto_random_impl.h.
429  * See that file for implementation documentation. */
430 #if defined(MBEDTLS_PSA_CRYPTO_C)
431 
432 /* The type of a `f_rng` random generator function that many library functions
433  * take.
434  *
435  * This type name is not part of the Mbed TLS stable API. It may be renamed
436  * or moved without warning.
437  */
438 typedef int mbedtls_f_rng_t( void *p_rng, unsigned char *output, size_t output_size );
439 
440 #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
441 
477 int mbedtls_psa_get_random( void *p_rng,
478  unsigned char *output,
479  size_t output_size );
480 
491 #define MBEDTLS_PSA_RANDOM_STATE NULL
492 
493 #else /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */
494 
495 #if defined(MBEDTLS_CTR_DRBG_C)
496 #include "mbedtls/ctr_drbg.h"
499 #elif defined(MBEDTLS_HMAC_DRBG_C)
500 #include "mbedtls/hmac_drbg.h"
503 #endif
505 
506 #define MBEDTLS_PSA_RANDOM_STATE mbedtls_psa_random_state
507 
508 #endif /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */
509 
510 #endif /* MBEDTLS_PSA_CRYPTO_C */
511 
512 #endif /* MBEDTLS_PSA_UTIL_H */
mbedtls_cipher_type_t
Supported {cipher type, cipher mode} pairs.
Definition: cipher.h:110
@ MBEDTLS_CIPHER_AES_128_ECB
Definition: cipher.h:113
@ MBEDTLS_CIPHER_AES_128_CBC
Definition: cipher.h:116
@ MBEDTLS_CIPHER_AES_192_GCM
Definition: cipher.h:126
@ MBEDTLS_CIPHER_AES_256_ECB
Definition: cipher.h:115
@ MBEDTLS_CIPHER_AES_192_CCM
Definition: cipher.h:155
@ MBEDTLS_CIPHER_AES_256_GCM
Definition: cipher.h:127
@ MBEDTLS_CIPHER_AES_256_CCM
Definition: cipher.h:156
@ MBEDTLS_CIPHER_AES_128_GCM
Definition: cipher.h:125
@ MBEDTLS_CIPHER_AES_192_CBC
Definition: cipher.h:117
@ MBEDTLS_CIPHER_AES_128_CCM
Definition: cipher.h:154
@ MBEDTLS_CIPHER_AES_256_CBC
Definition: cipher.h:118
@ MBEDTLS_CIPHER_AES_192_ECB
Definition: cipher.h:114
mbedtls_operation_t
Definition: cipher.h:220
@ MBEDTLS_DECRYPT
Definition: cipher.h:222
@ MBEDTLS_ENCRYPT
Definition: cipher.h:223
mbedtls_cipher_mode_t
Definition: cipher.h:194
@ MBEDTLS_MODE_ECB
Definition: cipher.h:196
@ MBEDTLS_MODE_CCM
Definition: cipher.h:203
@ MBEDTLS_MODE_GCM
Definition: cipher.h:201
@ MBEDTLS_MODE_CBC
Definition: cipher.h:197
Configuration options (set of defines)
Platform Security Architecture cryptography module.
This file contains definitions and functions for the CTR_DRBG pseudorandom generator.
int mbedtls_ctr_drbg_random(void *p_rng, unsigned char *output, size_t output_len)
This function uses CTR_DRBG to generate random data.
This file provides an API for Elliptic Curves over GF(P) (ECP).
#define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL
Definition: ecp.h:51
#define MBEDTLS_ERR_ECP_RANDOM_FAILED
Definition: ecp.h:59
const mbedtls_ecp_curve_info * mbedtls_ecp_curve_info_from_tls_id(uint16_t tls_id)
This function retrieves curve information from a TLS NamedCurve value.
#define MBEDTLS_OID_SIZE(x)
Definition: asn1.h:127
#define PSA_KEY_TYPE_ECC_KEY_PAIR(curve)
#define PSA_ALG_GCM
#define PSA_ALG_SHA_224
#define PSA_ALG_SHA_1
#define PSA_ECC_FAMILY_SECP_R1
#define PSA_ALG_SHA_384
#define PSA_ECC_FAMILY_SECP_K1
#define PSA_ALG_SHA_256
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:81
#define PSA_ALG_RIPEMD160
#define PSA_KEY_TYPE_AES
#define PSA_ALG_MD4
#define PSA_ALG_MD2
#define PSA_ALG_ECB_NO_PADDING
#define PSA_ALG_AEAD_WITH_SHORTENED_TAG(aead_alg, tag_length)
#define PSA_ECC_FAMILY_BRAINPOOL_P_R1
#define PSA_ALG_CCM
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:137
#define PSA_ALG_CBC_NO_PADDING
#define PSA_ALG_MD5
uint8_t psa_ecc_family_t
Definition: crypto_types.h:100
#define PSA_ALG_SHA_512
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:62
#define PSA_ERROR_HARDWARE_FAILURE
#define PSA_ERROR_CORRUPTION_DETECTED
#define PSA_ERROR_NOT_SUPPORTED
Definition: crypto_values.h:77
#define PSA_SUCCESS
Definition: crypto_values.h:61
#define PSA_ERROR_INSUFFICIENT_ENTROPY
#define PSA_ERROR_COMMUNICATION_FAILURE
#define PSA_ERROR_INSUFFICIENT_MEMORY
#define PSA_ERROR_BAD_STATE
#define PSA_KEY_USAGE_ENCRYPT
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:327
#define PSA_KEY_USAGE_DECRYPT
static psa_ecc_family_t mbedtls_ecc_group_to_psa(mbedtls_ecp_group_id grpid, size_t *bits)
Definition: crypto_extra.h:587
The HMAC_DRBG pseudorandom generator.
int mbedtls_hmac_drbg_random(void *p_rng, unsigned char *output, size_t out_len)
This function uses HMAC_DRBG to generate random data.
This file contains the generic message-digest wrapper.
mbedtls_md_type_t
Supported message digests.
Definition: md.h:62
@ MBEDTLS_MD_SHA512
Definition: md.h:71
@ MBEDTLS_MD_MD5
Definition: md.h:66
@ MBEDTLS_MD_RIPEMD160
Definition: md.h:72
@ MBEDTLS_MD_SHA384
Definition: md.h:70
@ MBEDTLS_MD_NONE
Definition: md.h:63
@ MBEDTLS_MD_SHA256
Definition: md.h:69
@ MBEDTLS_MD_SHA224
Definition: md.h:68
@ MBEDTLS_MD_SHA1
Definition: md.h:67
@ MBEDTLS_MD_MD4
Definition: md.h:65
@ MBEDTLS_MD_MD2
Definition: md.h:64
Object Identifier (OID) database.
#define MBEDTLS_OID_EC_GRP_SECP521R1
Definition: oid.h:365
#define MBEDTLS_OID_EC_GRP_SECP224R1
Definition: oid.h:353
#define MBEDTLS_OID_EC_GRP_SECP256K1
Definition: oid.h:377
#define MBEDTLS_OID_EC_GRP_SECP384R1
Definition: oid.h:361
#define MBEDTLS_OID_EC_GRP_SECP192K1
Definition: oid.h:369
#define MBEDTLS_OID_EC_GRP_BP384R1
Definition: oid.h:391
#define MBEDTLS_OID_EC_GRP_SECP224K1
Definition: oid.h:373
#define MBEDTLS_OID_EC_GRP_BP512R1
Definition: oid.h:394
#define MBEDTLS_OID_EC_GRP_SECP256R1
Definition: oid.h:357
#define MBEDTLS_OID_EC_GRP_SECP192R1
Definition: oid.h:349
#define MBEDTLS_OID_EC_GRP_BP256R1
Definition: oid.h:388
Public Key abstraction layer.
#define MBEDTLS_ERR_PK_HW_ACCEL_FAILED
Definition: pk.h:86
#define MBEDTLS_ERR_PK_BAD_INPUT_DATA
Definition: pk.h:60
#define MBEDTLS_ERR_PK_ALLOC_FAILED
Definition: pk.h:56
#define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE
Definition: pk.h:80
mbedtls_ctr_drbg_context mbedtls_psa_drbg_context_t
Definition: psa_util.h:497
static mbedtls_f_rng_t *const mbedtls_psa_get_random
Definition: psa_util.h:498
mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state
int mbedtls_f_rng_t(void *p_rng, unsigned char *output, size_t output_size)
Definition: psa_util.h:438
The CTR_DRBG context structure.
Definition: ctr_drbg.h:174
mbedtls_ecp_group_id grp_id
Definition: ecp.h:160