File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,26 @@ void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx );
413
413
int mbedtls_cipher_setup ( mbedtls_cipher_context_t * ctx ,
414
414
const mbedtls_cipher_info_t * cipher_info );
415
415
416
+ #if defined(MBEDTLS_USE_PSA_CRYPTO )
417
+ /**
418
+ * \brief This function initializes a cipher context for
419
+ * PSA-based use with the given cipher primitive.
420
+ *
421
+ * \note See #MBEDTLS_USE_PSA_CRYPTO for information on PSA.
422
+ *
423
+ * \param ctx The context to initialize. May not be \c NULL.
424
+ * \param cipher_info The cipher to use.
425
+ *
426
+ * \return \c 0 on success.
427
+ * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
428
+ * parameter-verification failure.
429
+ * \return #MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the
430
+ * cipher-specific context fails.
431
+ */
432
+ int mbedtls_cipher_setup_psa ( mbedtls_cipher_context_t * ctx ,
433
+ const mbedtls_cipher_info_t * cipher_info );
434
+ #endif /* MBEDTLS_USE_PSA_CRYPTO */
435
+
416
436
/**
417
437
* \brief This function returns the block size of the given cipher.
418
438
*
Original file line number Diff line number Diff line change 58
58
#include "mbedtls/cmac.h"
59
59
#endif
60
60
61
+ #if defined(MBEDTLS_USE_PSA_CRYPTO )
62
+ #include "psa/crypto.h"
63
+ #endif /* MBEDTLS_USE_PSA_CRYPTO */
64
+
61
65
#if defined(MBEDTLS_PLATFORM_C )
62
66
#include "mbedtls/platform.h"
63
67
#else
@@ -204,6 +208,14 @@ int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx,
204
208
return ( 0 );
205
209
}
206
210
211
+ #if defined(MBEDTLS_USE_PSA_CRYPTO )
212
+ int mbedtls_cipher_setup_psa ( mbedtls_cipher_context_t * ctx ,
213
+ const mbedtls_cipher_info_t * cipher_info )
214
+ {
215
+ return ( MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE );
216
+ }
217
+ #endif /* MBEDTLS_USE_PSA_CRYPTO */
218
+
207
219
int mbedtls_cipher_setkey ( mbedtls_cipher_context_t * ctx ,
208
220
const unsigned char * key ,
209
221
int key_bitlen ,
You can’t perform that action at this time.
0 commit comments