Make more code paths conditional in psa_crypto.c
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 2785eac..cb7b5cf 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -2091,7 +2091,9 @@
break;
#endif
#if defined(MBEDTLS_SHA512_C)
+#if !defined(MBEDTLS_SHA512_NO_SHA384)
case PSA_ALG_SHA_384:
+#endif
case PSA_ALG_SHA_512:
mbedtls_sha512_free( &operation->ctx.sha512 );
break;
@@ -2157,10 +2159,12 @@
break;
#endif
#if defined(MBEDTLS_SHA512_C)
+#if !defined(MBEDTLS_SHA512_NO_SHA384)
case PSA_ALG_SHA_384:
mbedtls_sha512_init( &operation->ctx.sha512 );
ret = mbedtls_sha512_starts_ret( &operation->ctx.sha512, 1 );
break;
+#endif
case PSA_ALG_SHA_512:
mbedtls_sha512_init( &operation->ctx.sha512 );
ret = mbedtls_sha512_starts_ret( &operation->ctx.sha512, 0 );
@@ -2229,7 +2233,9 @@
break;
#endif
#if defined(MBEDTLS_SHA512_C)
+#if !defined(MBEDTLS_SHA512_NO_SHA384)
case PSA_ALG_SHA_384:
+#endif
case PSA_ALG_SHA_512:
ret = mbedtls_sha512_update_ret( &operation->ctx.sha512,
input, input_length );
@@ -2302,7 +2308,9 @@
break;
#endif
#if defined(MBEDTLS_SHA512_C)
+#if !defined(MBEDTLS_SHA512_NO_SHA384)
case PSA_ALG_SHA_384:
+#endif
case PSA_ALG_SHA_512:
ret = mbedtls_sha512_finish_ret( &operation->ctx.sha512, hash );
break;
@@ -2391,7 +2399,9 @@
break;
#endif
#if defined(MBEDTLS_SHA512_C)
+#if !defined(MBEDTLS_SHA512_NO_SHA384)
case PSA_ALG_SHA_384:
+#endif
case PSA_ALG_SHA_512:
mbedtls_sha512_clone( &target_operation->ctx.sha512,
&source_operation->ctx.sha512 );
@@ -2519,8 +2529,10 @@
return( 64 );
case PSA_ALG_SHA_256:
return( 64 );
+#if !defined(MBEDTLS_SHA512_NO_SHA384)
case PSA_ALG_SHA_384:
return( 128 );
+#endif
case PSA_ALG_SHA_512:
return( 128 );
default: