Improve indentation of hash start functions

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott 2023-01-16 13:59:15 +00:00
parent 749dec54ef
commit 068fe07740

View File

@ -3482,8 +3482,13 @@ psa_status_t mbedtls_psa_sign_hash_start(
{ {
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
if (PSA_KEY_TYPE_IS_ECC(attributes->core.type)) { if (!PSA_KEY_TYPE_IS_ECC(attributes->core.type)) {
if (PSA_ALG_IS_ECDSA(alg)) { return PSA_ERROR_NOT_SUPPORTED;
}
if (!PSA_ALG_IS_ECDSA(alg)) {
return PSA_ERROR_INVALID_ARGUMENT;
}
#if (defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \ #if (defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA)) && \ defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA)) && \
@ -3525,6 +3530,8 @@ psa_status_t mbedtls_psa_sign_hash_start(
operation->hash = hash; operation->hash = hash;
operation->hash_length = hash_length; operation->hash_length = hash_length;
return PSA_SUCCESS;
#else #else
(void) operation; (void) operation;
(void) key_buffer; (void) key_buffer;
@ -3532,19 +3539,12 @@ psa_status_t mbedtls_psa_sign_hash_start(
(void) alg; (void) alg;
(void) hash; (void) hash;
(void) hash_length; (void) hash_length;
(void) status;
return PSA_ERROR_NOT_SUPPORTED; return PSA_ERROR_NOT_SUPPORTED;
#endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || #endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) ||
* defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) && * defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) &&
* defined( MBEDTLS_ECP_RESTARTABLE ) */ * defined( MBEDTLS_ECP_RESTARTABLE ) */
} else {
status = PSA_ERROR_INVALID_ARGUMENT;
}
} else {
status = PSA_ERROR_NOT_SUPPORTED;
}
return status;
} }
psa_status_t mbedtls_psa_sign_hash_complete( psa_status_t mbedtls_psa_sign_hash_complete(
@ -3677,8 +3677,13 @@ psa_status_t mbedtls_psa_verify_hash_start(
{ {
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
if (PSA_KEY_TYPE_IS_ECC(attributes->core.type)) { if (!PSA_KEY_TYPE_IS_ECC(attributes->core.type)) {
if (PSA_ALG_IS_ECDSA(alg)) { return PSA_ERROR_NOT_SUPPORTED;
}
if (!PSA_ALG_IS_ECDSA(alg)) {
return PSA_ERROR_INVALID_ARGUMENT;
}
#if (defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \ #if (defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA)) && \ defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA)) && \
@ -3748,6 +3753,8 @@ psa_status_t mbedtls_psa_verify_hash_start(
operation->hash = hash; operation->hash = hash;
operation->hash_length = hash_length; operation->hash_length = hash_length;
return PSA_SUCCESS;
#else #else
(void) operation; (void) operation;
(void) key_buffer; (void) key_buffer;
@ -3757,19 +3764,12 @@ psa_status_t mbedtls_psa_verify_hash_start(
(void) hash_length; (void) hash_length;
(void) signature; (void) signature;
(void) signature_length; (void) signature_length;
(void) status;
return PSA_ERROR_NOT_SUPPORTED; return PSA_ERROR_NOT_SUPPORTED;
#endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || #endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) ||
* defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) && * defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) &&
* defined( MBEDTLS_ECP_RESTARTABLE ) */ * defined( MBEDTLS_ECP_RESTARTABLE ) */
} else {
status = PSA_ERROR_INVALID_ARGUMENT;
}
} else {
status = PSA_ERROR_NOT_SUPPORTED;
}
return status;
} }
psa_status_t mbedtls_psa_verify_hash_complete( psa_status_t mbedtls_psa_verify_hash_complete(