pk_wrap: pass curve size instead of a larger size of the exported key

Whitespace fixes
diff --git a/library/pk.c b/library/pk.c
index c0ed542..024dcdc 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -573,7 +573,7 @@
 
     curve_id = mbedtls_ecp_curve_info_from_grp_id( ec->grp.id )->tls_id;
     key_type = PSA_KEY_TYPE_ECC_KEYPAIR(
-    		                     mbedtls_psa_parse_tls_ecc_group ( curve_id ) );
+                                 mbedtls_psa_parse_tls_ecc_group ( curve_id ) );
 
     /* allocate a key slot */
     if( PSA_SUCCESS != psa_allocate_key( key_type, d_len * 8, &key ) )
diff --git a/library/pk_wrap.c b/library/pk_wrap.c
index 9023457..08550d4 100644
--- a/library/pk_wrap.c
+++ b/library/pk_wrap.c
@@ -577,7 +577,9 @@
     psa_sig_md = PSA_ALG_ECDSA( psa_md );
     psa_type = PSA_KEY_TYPE_ECC_PUBLIC_KEY( curve );
 
-    if( ( ret = psa_allocate_key( psa_type, key_len * 8, &key_slot ) ) != PSA_SUCCESS )
+    if( ( ret = psa_allocate_key( psa_type,
+                                  MBEDTLS_PSA_ECC_KEY_BITS_OF_CURVE(curve),
+                                  &key_slot ) ) != PSA_SUCCESS )
           return( mbedtls_psa_err_translate_pk( ret ) );
 
     psa_key_policy_init( &policy );