Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 1 | /** |
Hanno Becker | afebf5a | 2018-11-13 21:01:41 +0000 | [diff] [blame] | 2 | * \file psa_util.h |
Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 3 | * |
| 4 | * \brief Utility functions for the use of the PSA Crypto library. |
| 5 | * |
| 6 | * \warning This function is not part of the public API and may |
| 7 | * change at any time. |
| 8 | */ |
| 9 | /* |
| 10 | * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved |
| 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 | * This file is part of mbed TLS (https://tls.mbed.org) |
| 26 | */ |
| 27 | |
Hanno Becker | 186b65a | 2018-11-19 15:14:21 +0000 | [diff] [blame] | 28 | #ifndef MBEDTLS_PSA_UTIL_H |
| 29 | #define MBEDTLS_PSA_UTIL_H |
Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 30 | |
| 31 | #if !defined(MBEDTLS_CONFIG_FILE) |
| 32 | #include "config.h" |
| 33 | #else |
| 34 | #include MBEDTLS_CONFIG_FILE |
| 35 | #endif |
| 36 | |
| 37 | #if defined(MBEDTLS_USE_PSA_CRYPTO) |
| 38 | |
| 39 | #include "psa/crypto.h" |
| 40 | |
| 41 | #include "ecp.h" |
| 42 | #include "md.h" |
Hanno Becker | 000334f | 2018-11-15 09:37:19 +0000 | [diff] [blame] | 43 | #include "pk.h" |
Hanno Becker | 493c171 | 2019-02-01 10:07:07 +0000 | [diff] [blame^] | 44 | #include "oid.h" |
Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 45 | |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 46 | /* Translations for symmetric crypto. */ |
| 47 | |
Hanno Becker | b26c193 | 2018-11-12 10:18:57 +0000 | [diff] [blame] | 48 | static inline psa_key_type_t mbedtls_psa_translate_cipher_type( |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 49 | mbedtls_cipher_type_t cipher ) |
| 50 | { |
| 51 | switch( cipher ) |
| 52 | { |
| 53 | case MBEDTLS_CIPHER_AES_128_CCM: |
| 54 | case MBEDTLS_CIPHER_AES_192_CCM: |
| 55 | case MBEDTLS_CIPHER_AES_256_CCM: |
| 56 | case MBEDTLS_CIPHER_AES_128_GCM: |
| 57 | case MBEDTLS_CIPHER_AES_192_GCM: |
| 58 | case MBEDTLS_CIPHER_AES_256_GCM: |
| 59 | case MBEDTLS_CIPHER_AES_128_CBC: |
| 60 | case MBEDTLS_CIPHER_AES_192_CBC: |
| 61 | case MBEDTLS_CIPHER_AES_256_CBC: |
| 62 | return( PSA_KEY_TYPE_AES ); |
| 63 | |
| 64 | /* ARIA not yet supported in PSA. */ |
| 65 | /* case MBEDTLS_CIPHER_ARIA_128_CCM: |
| 66 | case MBEDTLS_CIPHER_ARIA_192_CCM: |
| 67 | case MBEDTLS_CIPHER_ARIA_256_CCM: |
| 68 | case MBEDTLS_CIPHER_ARIA_128_GCM: |
| 69 | case MBEDTLS_CIPHER_ARIA_192_GCM: |
| 70 | case MBEDTLS_CIPHER_ARIA_256_GCM: |
| 71 | case MBEDTLS_CIPHER_ARIA_128_CBC: |
| 72 | case MBEDTLS_CIPHER_ARIA_192_CBC: |
| 73 | case MBEDTLS_CIPHER_ARIA_256_CBC: |
| 74 | return( PSA_KEY_TYPE_ARIA ); */ |
| 75 | |
| 76 | default: |
| 77 | return( 0 ); |
| 78 | } |
| 79 | } |
| 80 | |
Hanno Becker | b26c193 | 2018-11-12 10:18:57 +0000 | [diff] [blame] | 81 | static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode( |
Hanno Becker | 010cf7e | 2018-11-15 15:48:57 +0000 | [diff] [blame] | 82 | mbedtls_cipher_mode_t mode, size_t taglen ) |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 83 | { |
| 84 | switch( mode ) |
| 85 | { |
| 86 | case MBEDTLS_MODE_GCM: |
Hanno Becker | 010cf7e | 2018-11-15 15:48:57 +0000 | [diff] [blame] | 87 | return( PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_GCM, taglen ) ); |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 88 | case MBEDTLS_MODE_CCM: |
Hanno Becker | 010cf7e | 2018-11-15 15:48:57 +0000 | [diff] [blame] | 89 | return( PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_CCM, taglen ) ); |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 90 | case MBEDTLS_MODE_CBC: |
Hanno Becker | 010cf7e | 2018-11-15 15:48:57 +0000 | [diff] [blame] | 91 | if( taglen == 0 ) |
| 92 | return( PSA_ALG_CBC_NO_PADDING ); |
| 93 | /* Intentional fallthrough for taglen != 0 */ |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 94 | default: |
| 95 | return( 0 ); |
| 96 | } |
| 97 | } |
| 98 | |
Hanno Becker | b26c193 | 2018-11-12 10:18:57 +0000 | [diff] [blame] | 99 | static inline psa_key_usage_t mbedtls_psa_translate_cipher_operation( |
| 100 | mbedtls_operation_t op ) |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 101 | { |
| 102 | switch( op ) |
| 103 | { |
| 104 | case MBEDTLS_ENCRYPT: |
| 105 | return( PSA_KEY_USAGE_ENCRYPT ); |
| 106 | case MBEDTLS_DECRYPT: |
| 107 | return( PSA_KEY_USAGE_DECRYPT ); |
| 108 | default: |
| 109 | return( 0 ); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | /* Translations for hashing. */ |
| 114 | |
Hanno Becker | b26c193 | 2018-11-12 10:18:57 +0000 | [diff] [blame] | 115 | static inline psa_algorithm_t mbedtls_psa_translate_md( mbedtls_md_type_t md_alg ) |
Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 116 | { |
| 117 | switch( md_alg ) |
| 118 | { |
| 119 | #if defined(MBEDTLS_MD2_C) |
| 120 | case MBEDTLS_MD_MD2: |
| 121 | return( PSA_ALG_MD2 ); |
| 122 | #endif |
| 123 | #if defined(MBEDTLS_MD4_C) |
| 124 | case MBEDTLS_MD_MD4: |
| 125 | return( PSA_ALG_MD4 ); |
| 126 | #endif |
| 127 | #if defined(MBEDTLS_MD5_C) |
| 128 | case MBEDTLS_MD_MD5: |
| 129 | return( PSA_ALG_MD5 ); |
| 130 | #endif |
| 131 | #if defined(MBEDTLS_SHA1_C) |
| 132 | case MBEDTLS_MD_SHA1: |
| 133 | return( PSA_ALG_SHA_1 ); |
| 134 | #endif |
| 135 | #if defined(MBEDTLS_SHA256_C) |
| 136 | case MBEDTLS_MD_SHA224: |
| 137 | return( PSA_ALG_SHA_224 ); |
| 138 | case MBEDTLS_MD_SHA256: |
| 139 | return( PSA_ALG_SHA_256 ); |
| 140 | #endif |
| 141 | #if defined(MBEDTLS_SHA512_C) |
| 142 | case MBEDTLS_MD_SHA384: |
| 143 | return( PSA_ALG_SHA_384 ); |
| 144 | case MBEDTLS_MD_SHA512: |
| 145 | return( PSA_ALG_SHA_512 ); |
| 146 | #endif |
| 147 | #if defined(MBEDTLS_RIPEMD160_C) |
| 148 | case MBEDTLS_MD_RIPEMD160: |
| 149 | return( PSA_ALG_RIPEMD160 ); |
| 150 | #endif |
| 151 | case MBEDTLS_MD_NONE: /* Intentional fallthrough */ |
| 152 | default: |
| 153 | return( 0 ); |
| 154 | } |
| 155 | } |
| 156 | |
Hanno Becker | 5525126 | 2018-11-12 09:29:12 +0000 | [diff] [blame] | 157 | /* Translations for ECC. */ |
| 158 | |
Hanno Becker | 812e124 | 2019-02-01 10:06:51 +0000 | [diff] [blame] | 159 | static inline int mbedtls_psa_get_ecc_oid_from_id( |
| 160 | psa_ecc_curve_t curve, char const **oid, size_t *oid_len ) |
| 161 | { |
| 162 | switch( curve ) |
| 163 | { |
| 164 | #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) |
| 165 | case PSA_ECC_CURVE_SECP192R1: |
| 166 | *oid = MBEDTLS_OID_EC_GRP_SECP192R1; |
| 167 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP192R1 ); |
| 168 | return( 0 ); |
| 169 | #endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ |
| 170 | #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) |
| 171 | case PSA_ECC_CURVE_SECP224R1: |
| 172 | *oid = MBEDTLS_OID_EC_GRP_SECP224R1; |
| 173 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP224R1 ); |
| 174 | return( 0 ); |
| 175 | #endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ |
| 176 | #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) |
| 177 | case PSA_ECC_CURVE_SECP256R1: |
| 178 | *oid = MBEDTLS_OID_EC_GRP_SECP256R1; |
| 179 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP256R1 ); |
| 180 | return( 0 ); |
| 181 | #endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ |
| 182 | #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) |
| 183 | case PSA_ECC_CURVE_SECP384R1: |
| 184 | *oid = MBEDTLS_OID_EC_GRP_SECP384R1; |
| 185 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP384R1 ); |
| 186 | return( 0 ); |
| 187 | #endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ |
| 188 | #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) |
| 189 | case PSA_ECC_CURVE_SECP521R1: |
| 190 | *oid = MBEDTLS_OID_EC_GRP_SECP521R1; |
| 191 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP521R1 ); |
| 192 | return( 0 ); |
| 193 | #endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ |
| 194 | #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) |
| 195 | case PSA_ECC_CURVE_SECP192K1: |
| 196 | *oid = MBEDTLS_OID_EC_GRP_SECP192K1; |
| 197 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP192K1 ); |
| 198 | return( 0 ); |
| 199 | #endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ |
| 200 | #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) |
| 201 | case PSA_ECC_CURVE_SECP224K1: |
| 202 | *oid = MBEDTLS_OID_EC_GRP_SECP224K1; |
| 203 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP224K1 ); |
| 204 | return( 0 ); |
| 205 | #endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ |
| 206 | #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) |
| 207 | case PSA_ECC_CURVE_SECP256K1: |
| 208 | *oid = MBEDTLS_OID_EC_GRP_SECP256K1; |
| 209 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP256K1 ); |
| 210 | return( 0 ); |
| 211 | #endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ |
| 212 | #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) |
| 213 | case PSA_ECC_CURVE_BRAINPOOL_P256R1: |
| 214 | *oid = MBEDTLS_OID_EC_GRP_BP256R1; |
| 215 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_BP256R1 ); |
| 216 | return( 0 ); |
| 217 | #endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ |
| 218 | #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) |
| 219 | case PSA_ECC_CURVE_BRAINPOOL_P384R1: |
| 220 | *oid = MBEDTLS_OID_EC_GRP_BP384R1; |
| 221 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_BP384R1 ); |
| 222 | return( 0 ); |
| 223 | #endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ |
| 224 | #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) |
| 225 | case PSA_ECC_CURVE_BRAINPOOL_P512R1: |
| 226 | *oid = MBEDTLS_OID_EC_GRP_BP512R1; |
| 227 | *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_BP512R1 ); |
| 228 | return( 0 ); |
| 229 | #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ |
| 230 | } |
| 231 | |
| 232 | return( -1 ); |
| 233 | } |
| 234 | |
Hanno Becker | b26c193 | 2018-11-12 10:18:57 +0000 | [diff] [blame] | 235 | static inline psa_ecc_curve_t mbedtls_psa_translate_ecc_group( mbedtls_ecp_group_id grpid ) |
Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 236 | { |
| 237 | switch( grpid ) |
| 238 | { |
| 239 | #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) |
| 240 | case MBEDTLS_ECP_DP_SECP192R1: |
| 241 | return( PSA_ECC_CURVE_SECP192R1 ); |
| 242 | #endif |
| 243 | #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) |
| 244 | case MBEDTLS_ECP_DP_SECP224R1: |
| 245 | return( PSA_ECC_CURVE_SECP224R1 ); |
| 246 | #endif |
| 247 | #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) |
| 248 | case MBEDTLS_ECP_DP_SECP256R1: |
| 249 | return( PSA_ECC_CURVE_SECP256R1 ); |
| 250 | #endif |
| 251 | #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) |
| 252 | case MBEDTLS_ECP_DP_SECP384R1: |
| 253 | return( PSA_ECC_CURVE_SECP384R1 ); |
| 254 | #endif |
| 255 | #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) |
| 256 | case MBEDTLS_ECP_DP_SECP521R1: |
| 257 | return( PSA_ECC_CURVE_SECP521R1 ); |
| 258 | #endif |
| 259 | #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) |
| 260 | case MBEDTLS_ECP_DP_BP256R1: |
| 261 | return( PSA_ECC_CURVE_BRAINPOOL_P256R1 ); |
| 262 | #endif |
| 263 | #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) |
| 264 | case MBEDTLS_ECP_DP_BP384R1: |
| 265 | return( PSA_ECC_CURVE_BRAINPOOL_P384R1 ); |
| 266 | #endif |
| 267 | #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) |
| 268 | case MBEDTLS_ECP_DP_BP512R1: |
| 269 | return( PSA_ECC_CURVE_BRAINPOOL_P512R1 ); |
| 270 | #endif |
| 271 | #if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) |
| 272 | case MBEDTLS_ECP_DP_CURVE25519: |
| 273 | return( PSA_ECC_CURVE_CURVE25519 ); |
| 274 | #endif |
| 275 | #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) |
| 276 | case MBEDTLS_ECP_DP_SECP192K1: |
| 277 | return( PSA_ECC_CURVE_SECP192K1 ); |
| 278 | #endif |
| 279 | #if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) |
| 280 | case MBEDTLS_ECP_DP_SECP224K1: |
| 281 | return( PSA_ECC_CURVE_SECP224K1 ); |
| 282 | #endif |
| 283 | #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) |
| 284 | case MBEDTLS_ECP_DP_SECP256K1: |
| 285 | return( PSA_ECC_CURVE_SECP256K1 ); |
| 286 | #endif |
| 287 | #if defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) |
| 288 | case MBEDTLS_ECP_DP_CURVE448: |
| 289 | return( PSA_ECC_CURVE_CURVE448 ); |
| 290 | #endif |
| 291 | default: |
| 292 | return( 0 ); |
| 293 | } |
| 294 | } |
| 295 | |
Andrzej Kurek | 62594a8 | 2019-01-14 05:14:18 -0500 | [diff] [blame] | 296 | #define MBEDTLS_PSA_ECC_KEY_BITS_OF_CURVE( curve ) \ |
| 297 | ( curve == PSA_ECC_CURVE_SECP192R1 ? 192 : \ |
| 298 | curve == PSA_ECC_CURVE_SECP224R1 ? 224 : \ |
| 299 | curve == PSA_ECC_CURVE_SECP256R1 ? 256 : \ |
| 300 | curve == PSA_ECC_CURVE_SECP384R1 ? 384 : \ |
| 301 | curve == PSA_ECC_CURVE_SECP521R1 ? 521 : \ |
| 302 | curve == PSA_ECC_CURVE_SECP192K1 ? 192 : \ |
| 303 | curve == PSA_ECC_CURVE_SECP224K1 ? 224 : \ |
| 304 | curve == PSA_ECC_CURVE_SECP256K1 ? 256 : \ |
| 305 | curve == PSA_ECC_CURVE_BRAINPOOL_P256R1 ? 256 : \ |
| 306 | curve == PSA_ECC_CURVE_BRAINPOOL_P384R1 ? 384 : \ |
| 307 | curve == PSA_ECC_CURVE_BRAINPOOL_P512R1 ? 512 : \ |
| 308 | 0 ) |
| 309 | |
| 310 | #define MBEDTLS_PSA_ECC_KEY_BYTES_OF_CURVE( curve ) \ |
| 311 | ( ( MBEDTLS_PSA_ECC_KEY_BITS_OF_CURVE( curve ) + 7 ) / 8 ) |
| 312 | |
Hanno Becker | 000334f | 2018-11-15 09:37:19 +0000 | [diff] [blame] | 313 | /* Translations for PK layer */ |
| 314 | |
| 315 | static inline int mbedtls_psa_err_translate_pk( psa_status_t status ) |
| 316 | { |
| 317 | switch( status ) |
| 318 | { |
| 319 | case PSA_SUCCESS: |
| 320 | return( 0 ); |
| 321 | case PSA_ERROR_NOT_SUPPORTED: |
| 322 | return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE ); |
| 323 | case PSA_ERROR_INSUFFICIENT_MEMORY: |
| 324 | return( MBEDTLS_ERR_PK_ALLOC_FAILED ); |
Hanno Becker | 000334f | 2018-11-15 09:37:19 +0000 | [diff] [blame] | 325 | case PSA_ERROR_INSUFFICIENT_ENTROPY: |
| 326 | return( MBEDTLS_ERR_ECP_RANDOM_FAILED ); |
| 327 | case PSA_ERROR_BAD_STATE: |
| 328 | return( MBEDTLS_ERR_PK_BAD_INPUT_DATA ); |
Hanno Becker | f5f9ea2 | 2018-11-16 15:01:22 +0000 | [diff] [blame] | 329 | /* All other failures */ |
| 330 | case PSA_ERROR_COMMUNICATION_FAILURE: |
| 331 | case PSA_ERROR_HARDWARE_FAILURE: |
| 332 | case PSA_ERROR_TAMPERING_DETECTED: |
| 333 | return( MBEDTLS_ERR_PK_HW_ACCEL_FAILED ); |
| 334 | default: /* We return the same as for the 'other failures', |
| 335 | * but list them separately nonetheless to indicate |
| 336 | * which failure conditions we have considered. */ |
Hanno Becker | 000334f | 2018-11-15 09:37:19 +0000 | [diff] [blame] | 337 | return( MBEDTLS_ERR_PK_HW_ACCEL_FAILED ); |
| 338 | } |
| 339 | } |
| 340 | |
Andrzej Kurek | 93a38a3 | 2019-01-14 05:09:46 -0500 | [diff] [blame] | 341 | /* Translations for ECC */ |
| 342 | |
| 343 | /* This function transforms an ECC group identifier from |
| 344 | * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8 |
| 345 | * into a PSA ECC group identifier. */ |
| 346 | static inline psa_ecc_curve_t mbedtls_psa_parse_tls_ecc_group( |
| 347 | uint16_t tls_ecc_grp_reg_id ) |
| 348 | { |
| 349 | /* The PSA identifiers are currently aligned with those from |
| 350 | * the TLS Supported Groups registry, so no conversion is necessary. */ |
| 351 | return( (psa_ecc_curve_t) tls_ecc_grp_reg_id ); |
| 352 | } |
| 353 | |
Hanno Becker | 87837b2 | 2018-11-08 13:32:02 +0000 | [diff] [blame] | 354 | #endif /* MBEDTLS_USE_PSA_CRYPTO */ |
| 355 | |
Hanno Becker | 186b65a | 2018-11-19 15:14:21 +0000 | [diff] [blame] | 356 | #endif /* MBEDTLS_PSA_UTIL_H */ |