Skip to content

Commit 9924bdc

Browse files
Ron EldorPatater
authored andcommitted
Deprecate hardware acceleration errors
Deprecate the module-specific XXX_HW_ACCEL_FAILED and XXX_FEATURE_UNAVAILABLE errors, as alternative implementations should now return `MBEDTLS_ERR_PLATFORM_HW_FAILED` and `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED`.
1 parent bcca58c commit 9924bdc

28 files changed

+95
-29
lines changed

include/mbedtls/aes.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@
6060

6161
/* Error codes in range 0x0021-0x0025 */
6262
#define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021 /**< Invalid input data. */
63+
64+
/* MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE is deprecated and should not be used. */
6365
#define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023 /**< Feature not available. For example, an unsupported AES key size. */
66+
67+
/* MBEDTLS_ERR_AES_HW_ACCEL_FAILED is deprecated and should not be used. */
6468
#define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025 /**< AES hardware accelerator failed. */
6569

6670
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \

include/mbedtls/arc4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
#include <stddef.h>
3838

39+
/* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */
3940
#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */
4041

4142
#ifdef __cplusplus

include/mbedtls/aria.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@
4848

4949
#define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH -0x005C /**< Invalid key length. */
5050
#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E /**< Invalid data input length. */
51+
52+
/* MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE is deprecated and should not be used.
53+
*/
5154
#define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A /**< Feature not available. For example, an unsupported ARIA key size. */
55+
56+
/* MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED is deprecated and should not be used. */
5257
#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058 /**< ARIA hardware accelerator failed. */
5358

5459
#if !defined(MBEDTLS_ARIA_ALT)

include/mbedtls/blowfish.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */
4242

4343
#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016 /**< Invalid key length. */
44+
45+
/* MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED is deprecated and should not be used.
46+
*/
4447
#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 /**< Blowfish hardware accelerator failed. */
48+
4549
#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 /**< Invalid data input length. */
4650

4751
#ifdef __cplusplus

include/mbedtls/camellia.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838

3939
#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0024 /**< Invalid key length. */
4040
#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026 /**< Invalid data input length. */
41+
42+
/* MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED is deprecated and should not be used.
43+
*/
4144
#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED -0x0027 /**< Camellia hardware accelerator failed. */
4245

4346
#ifdef __cplusplus

include/mbedtls/ccm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353

5454
#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */
5555
#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F /**< Authenticated decryption failed. */
56+
57+
/* MBEDTLS_ERR_CCM_HW_ACCEL_FAILED is deprecated and should not be used. */
5658
#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011 /**< CCM hardware accelerator failed. */
5759

5860

include/mbedtls/chacha20.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@
4343
#include <stddef.h>
4444

4545
#define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA -0x0051 /**< Invalid input parameter(s). */
46+
47+
/* MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE is deprecated and should not be
48+
* used. */
4649
#define MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE -0x0053 /**< Feature not available. For example, s part of the API is not implemented. */
50+
51+
/* MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED is deprecated and should not be used.
52+
*/
4753
#define MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED -0x0055 /**< Chacha20 hardware accelerator failed. */
4854

4955
#ifdef __cplusplus

include/mbedtls/cipher.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
#define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED -0x6280 /**< Decryption of block requires a full block. */
6363
#define MBEDTLS_ERR_CIPHER_AUTH_FAILED -0x6300 /**< Authentication failed (for AEAD modes). */
6464
#define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT -0x6380 /**< The context is invalid. For example, because it was freed. */
65+
66+
/* MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED is deprecated and should not be used. */
6567
#define MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED -0x6400 /**< Cipher hardware accelerator failed. */
6668

6769
#define MBEDTLS_CIPHER_VARIABLE_IV_LEN 0x01 /**< Cipher accepts IVs of variable length. */

include/mbedtls/cmac.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
extern "C" {
3535
#endif
3636

37+
/* MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED is deprecated and should not be used. */
3738
#define MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED -0x007A /**< CMAC hardware accelerator failed. */
3839

3940
#define MBEDTLS_AES_BLOCK_SIZE 16

include/mbedtls/des.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#define MBEDTLS_DES_DECRYPT 0
4343

4444
#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -0x0032 /**< The data input has an invalid length. */
45+
46+
/* MBEDTLS_ERR_DES_HW_ACCEL_FAILED is deprecated and should not be used. */
4547
#define MBEDTLS_ERR_DES_HW_ACCEL_FAILED -0x0033 /**< DES hardware accelerator failed. */
4648

4749
#define MBEDTLS_DES_KEY_SIZE 8

include/mbedtls/dhm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@
8484
#define MBEDTLS_ERR_DHM_INVALID_FORMAT -0x3380 /**< The ASN.1 data is not formatted correctly. */
8585
#define MBEDTLS_ERR_DHM_ALLOC_FAILED -0x3400 /**< Allocation of memory failed. */
8686
#define MBEDTLS_ERR_DHM_FILE_IO_ERROR -0x3480 /**< Read or write of file failed. */
87+
88+
/* MBEDTLS_ERR_DHM_HW_ACCEL_FAILED is deprecated and should not be used. */
8789
#define MBEDTLS_ERR_DHM_HW_ACCEL_FAILED -0x3500 /**< DHM hardware accelerator failed. */
90+
8891
#define MBEDTLS_ERR_DHM_SET_GROUP_FAILED -0x3580 /**< Setting the modulus and generator failed. */
8992

9093
#ifdef __cplusplus

include/mbedtls/ecp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
#define MBEDTLS_ERR_ECP_RANDOM_FAILED -0x4D00 /**< Generation of random value, such as ephemeral key, failed. */
5050
#define MBEDTLS_ERR_ECP_INVALID_KEY -0x4C80 /**< Invalid private or public key. */
5151
#define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH -0x4C00 /**< The buffer contains a valid signature followed by more data. */
52+
53+
/* MBEDTLS_ERR_ECP_HW_ACCEL_FAILED is deprecated and should not be used. */
5254
#define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED -0x4B80 /**< The ECP hardware accelerator failed. */
55+
5356
#define MBEDTLS_ERR_ECP_IN_PROGRESS -0x4B00 /**< Operation in progress, call again with the same parameters to continue. */
5457

5558
#ifdef __cplusplus

include/mbedtls/gcm.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
#define MBEDTLS_GCM_DECRYPT 0
4242

4343
#define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */
44+
45+
/* MBEDTLS_ERR_GCM_HW_ACCEL_FAILED is deprecated and should not be used. */
4446
#define MBEDTLS_ERR_GCM_HW_ACCEL_FAILED -0x0013 /**< GCM hardware accelerator failed. */
47+
4548
#define MBEDTLS_ERR_GCM_BAD_INPUT -0x0014 /**< Bad input parameters to function. */
4649

4750
#ifdef __cplusplus
@@ -146,9 +149,9 @@ int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx,
146149
* \return \c 0 if the encryption or decryption was performed
147150
* successfully. Note that in #MBEDTLS_GCM_DECRYPT mode,
148151
* this does not indicate that the data is authentic.
149-
* \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths are not valid.
150-
* \return #MBEDTLS_ERR_GCM_HW_ACCEL_FAILED or a cipher-specific
151-
* error code if the encryption or decryption failed.
152+
* \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths are not valid or
153+
* a cipher-specific error code if the encryption
154+
* or decryption failed.
152155
*/
153156
int mbedtls_gcm_crypt_and_tag( mbedtls_gcm_context *ctx,
154157
int mode,
@@ -185,9 +188,8 @@ int mbedtls_gcm_crypt_and_tag( mbedtls_gcm_context *ctx,
185188
*
186189
* \return \c 0 if successful and authenticated.
187190
* \return #MBEDTLS_ERR_GCM_AUTH_FAILED if the tag does not match.
188-
* \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths are not valid.
189-
* \return #MBEDTLS_ERR_GCM_HW_ACCEL_FAILED or a cipher-specific
190-
* error code if the decryption failed.
191+
* \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths are not valid or
192+
* a cipher-specific error code if the decryption failed.
191193
*/
192194
int mbedtls_gcm_auth_decrypt( mbedtls_gcm_context *ctx,
193195
size_t length,

include/mbedtls/md.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */
4040
#define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */
4141
#define MBEDTLS_ERR_MD_FILE_IO_ERROR -0x5200 /**< Opening or reading of file failed. */
42+
43+
/* MBEDTLS_ERR_MD_HW_ACCEL_FAILED is deprecated and should not be used. */
4244
#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED -0x5280 /**< MD hardware accelerator failed. */
4345

4446
#ifdef __cplusplus

include/mbedtls/md2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include <stddef.h>
3939

40+
/* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */
4041
#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B /**< MD2 hardware accelerator failed */
4142

4243
#ifdef __cplusplus

include/mbedtls/md4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <stddef.h>
3939
#include <stdint.h>
4040

41+
/* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */
4142
#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D /**< MD4 hardware accelerator failed */
4243

4344
#ifdef __cplusplus

include/mbedtls/md5.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <stddef.h>
3838
#include <stdint.h>
3939

40+
/* MBEDTLS_ERR_MD5_HW_ACCEL_FAILED is deprecated and should not be used. */
4041
#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F /**< MD5 hardware accelerator failed */
4142

4243
#ifdef __cplusplus

include/mbedtls/pk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
#define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -0x3A00 /**< Elliptic curve is unsupported (only NIST curves are supported). */
6565
#define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -0x3980 /**< Unavailable feature, e.g. RSA disabled for RSA key. */
6666
#define MBEDTLS_ERR_PK_SIG_LEN_MISMATCH -0x3900 /**< The buffer contains a valid signature followed by more data. */
67+
68+
/* MBEDTLS_ERR_PK_HW_ACCEL_FAILED is deprecated and should not be used. */
6769
#define MBEDTLS_ERR_PK_HW_ACCEL_FAILED -0x3880 /**< PK hardware accelerator failed. */
6870

6971
#ifdef __cplusplus

include/mbedtls/poly1305.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@
4343
#include <stddef.h>
4444

4545
#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057 /**< Invalid input parameter(s). */
46+
47+
/* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be
48+
* used. */
4649
#define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE -0x0059 /**< Feature not available. For example, s part of the API is not implemented. */
50+
51+
/* MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED is deprecated and should not be used.
52+
*/
4753
#define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED -0x005B /**< Poly1305 hardware accelerator failed. */
4854

4955
#ifdef __cplusplus

include/mbedtls/ripemd160.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include <stddef.h>
3434
#include <stdint.h>
3535

36+
/* MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED is deprecated and should not be used.
37+
*/
3638
#define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED -0x0031 /**< RIPEMD160 hardware accelerator failed */
3739

3840
#ifdef __cplusplus

include/mbedtls/rsa.h

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@
5555
#define MBEDTLS_ERR_RSA_VERIFY_FAILED -0x4380 /**< The PKCS#1 verification failed. */
5656
#define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE -0x4400 /**< The output buffer for decryption is not large enough. */
5757
#define MBEDTLS_ERR_RSA_RNG_FAILED -0x4480 /**< The random generator failed to generate non-zeros. */
58+
59+
/* MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION is deprecated and should not be used.
60+
*/
5861
#define MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION -0x4500 /**< The implementation does not offer the requested operation, for example, because of security violations or lack of functionality. */
62+
63+
/* MBEDTLS_ERR_RSA_HW_ACCEL_FAILED is deprecated and should not be used. */
5964
#define MBEDTLS_ERR_RSA_HW_ACCEL_FAILED -0x4580 /**< RSA hardware accelerator failed. */
6065

6166
/*
@@ -281,7 +286,7 @@ int mbedtls_rsa_complete( mbedtls_rsa_context *ctx );
281286
* zero Bytes.
282287
*
283288
* Possible reasons for returning
284-
* #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION:<ul>
289+
* #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:<ul>
285290
* <li>An alternative RSA implementation is in use, which
286291
* stores the key externally, and either cannot or should
287292
* not export it into RAM.</li>
@@ -301,7 +306,7 @@ int mbedtls_rsa_complete( mbedtls_rsa_context *ctx );
301306
* \param E The MPI to hold the public exponent, or NULL.
302307
*
303308
* \return \c 0 on success.
304-
* \return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION if exporting the
309+
* \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the
305310
* requested parameters cannot be done due to missing
306311
* functionality or because of security policies.
307312
* \return A non-zero return code on any other failure.
@@ -321,7 +326,7 @@ int mbedtls_rsa_export( const mbedtls_rsa_context *ctx,
321326
* zero Bytes.
322327
*
323328
* Possible reasons for returning
324-
* #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION:<ul>
329+
* #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:<ul>
325330
* <li>An alternative RSA implementation is in use, which
326331
* stores the key externally, and either cannot or should
327332
* not export it into RAM.</li>
@@ -350,7 +355,7 @@ int mbedtls_rsa_export( const mbedtls_rsa_context *ctx,
350355
* \param E_len The size of the buffer for the public exponent.
351356
*
352357
* \return \c 0 on success.
353-
* \return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION if exporting the
358+
* \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the
354359
* requested parameters cannot be done due to missing
355360
* functionality or because of security policies.
356361
* \return A non-zero return code on any other failure.
@@ -563,7 +568,7 @@ int mbedtls_rsa_private( mbedtls_rsa_context *ctx,
563568
*
564569
* \note Alternative implementations of RSA need not support
565570
* mode being set to #MBEDTLS_RSA_PRIVATE and might instead
566-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
571+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
567572
*
568573
* \param ctx The RSA context.
569574
* \param f_rng The RNG function. Needed for padding, PKCS#1 v2.1
@@ -598,7 +603,7 @@ int mbedtls_rsa_pkcs1_encrypt( mbedtls_rsa_context *ctx,
598603
*
599604
* \note Alternative implementations of RSA need not support
600605
* mode being set to #MBEDTLS_RSA_PRIVATE and might instead
601-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
606+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
602607
*
603608
* \param ctx The RSA context.
604609
* \param f_rng The RNG function. Needed for padding and
@@ -633,7 +638,7 @@ int mbedtls_rsa_rsaes_pkcs1_v15_encrypt( mbedtls_rsa_context *ctx,
633638
*
634639
* \note Alternative implementations of RSA need not support
635640
* mode being set to #MBEDTLS_RSA_PRIVATE and might instead
636-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
641+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
637642
*
638643
* \param ctx The RSA context.
639644
* \param f_rng The RNG function. Needed for padding and PKCS#1 v2.1
@@ -682,7 +687,7 @@ int mbedtls_rsa_rsaes_oaep_encrypt( mbedtls_rsa_context *ctx,
682687
*
683688
* \note Alternative implementations of RSA need not support
684689
* mode being set to #MBEDTLS_RSA_PUBLIC and might instead
685-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
690+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
686691
*
687692
* \param ctx The RSA context.
688693
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.
@@ -725,7 +730,7 @@ int mbedtls_rsa_pkcs1_decrypt( mbedtls_rsa_context *ctx,
725730
*
726731
* \note Alternative implementations of RSA need not support
727732
* mode being set to #MBEDTLS_RSA_PUBLIC and might instead
728-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
733+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
729734
*
730735
* \param ctx The RSA context.
731736
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.
@@ -770,7 +775,7 @@ int mbedtls_rsa_rsaes_pkcs1_v15_decrypt( mbedtls_rsa_context *ctx,
770775
*
771776
* \note Alternative implementations of RSA need not support
772777
* mode being set to #MBEDTLS_RSA_PUBLIC and might instead
773-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
778+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
774779
*
775780
* \param ctx The RSA context.
776781
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.
@@ -817,7 +822,7 @@ int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx,
817822
*
818823
* \note Alternative implementations of RSA need not support
819824
* mode being set to #MBEDTLS_RSA_PUBLIC and might instead
820-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
825+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
821826
*
822827
* \param ctx The RSA context.
823828
* \param f_rng The RNG function. Needed for PKCS#1 v2.1 encoding and for
@@ -856,7 +861,7 @@ int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx,
856861
*
857862
* \note Alternative implementations of RSA need not support
858863
* mode being set to #MBEDTLS_RSA_PUBLIC and might instead
859-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
864+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
860865
*
861866
* \param ctx The RSA context.
862867
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.
@@ -911,7 +916,7 @@ int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx,
911916
*
912917
* \note Alternative implementations of RSA need not support
913918
* mode being set to #MBEDTLS_RSA_PUBLIC and might instead
914-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
919+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
915920
*
916921
* \param ctx The RSA context.
917922
* \param f_rng The RNG function. Needed for PKCS#1 v2.1 encoding and for
@@ -957,7 +962,7 @@ int mbedtls_rsa_rsassa_pss_sign( mbedtls_rsa_context *ctx,
957962
*
958963
* \note Alternative implementations of RSA need not support
959964
* mode being set to #MBEDTLS_RSA_PRIVATE and might instead
960-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
965+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
961966
*
962967
* \param ctx The RSA public key context.
963968
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.
@@ -995,7 +1000,7 @@ int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx,
9951000
*
9961001
* \note Alternative implementations of RSA need not support
9971002
* mode being set to #MBEDTLS_RSA_PRIVATE and might instead
998-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
1003+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
9991004
*
10001005
* \param ctx The RSA public key context.
10011006
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.
@@ -1044,7 +1049,7 @@ int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
10441049
*
10451050
* \note Alternative implementations of RSA need not support
10461051
* mode being set to #MBEDTLS_RSA_PRIVATE and might instead
1047-
* return #MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION.
1052+
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
10481053
*
10491054
* \param ctx The RSA public key context.
10501055
* \param f_rng The RNG function. Only needed for #MBEDTLS_RSA_PRIVATE.

include/mbedtls/sha1.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <stddef.h>
4141
#include <stdint.h>
4242

43+
/* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */
4344
#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 /**< SHA-1 hardware accelerator failed */
4445

4546
#ifdef __cplusplus

include/mbedtls/sha256.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <stddef.h>
3737
#include <stdint.h>
3838

39+
/* MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED is deprecated and should not be used. */
3940
#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037 /**< SHA-256 hardware accelerator failed */
4041

4142
#ifdef __cplusplus

0 commit comments

Comments
 (0)