psa: Pass the number of bits with explicit types

The GCM, CCM, RSA, and cipher modules inconsistently use int or unsigned
int for a count of bits. The PSA Crypto API uses size_t for counting
things. This causes issues on LLP64 systems where a size_t can hold more
than an unsigned int. Add casts for where key_bits and bits are passed to
mbedtls_* APIs.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index dc0a27d..1bea9ed 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1163,7 +1163,8 @@
     if( cipher_id != NULL )
         *cipher_id = cipher_id_tmp;
 
-    return( mbedtls_cipher_info_from_values( cipher_id_tmp, key_bits, mode ) );
+    return( mbedtls_cipher_info_from_values( cipher_id_tmp,
+                                             (int) key_bits, mode ) );
 }
 
 static size_t psa_get_hash_block_size( psa_algorithm_t alg )
@@ -2188,7 +2189,7 @@
     {
         ret = mbedtls_cipher_setkey( &operation->ctx.cipher,
                                      slot->data.raw.data,
-                                     key_bits, cipher_operation );
+                                     (int) key_bits, cipher_operation );
     }
     if( ret != 0 )
     {
@@ -2604,7 +2605,7 @@
         mbedtls_gcm_init( &gcm );
         ret = mbedtls_gcm_setkey( &gcm, cipher_id,
                                   slot->data.raw.data,
-                                  key_bits );
+                                  (unsigned int) key_bits );
         if( ret != 0 )
         {
             mbedtls_gcm_free( &gcm );
@@ -2637,7 +2638,8 @@
 
         mbedtls_ccm_init( &ccm );
         ret = mbedtls_ccm_setkey( &ccm, cipher_id,
-                                  slot->data.raw.data, key_bits );
+                                  slot->data.raw.data,
+                                  (unsigned int) key_bits );
         if( ret != 0 )
         {
             mbedtls_ccm_free( &ccm );
@@ -2743,7 +2745,8 @@
 
         mbedtls_gcm_init( &gcm );
         ret = mbedtls_gcm_setkey( &gcm, cipher_id,
-                                  slot->data.raw.data, key_bits );
+                                  slot->data.raw.data,
+                                  (unsigned int) key_bits );
         if( ret != 0 )
         {
             mbedtls_gcm_free( &gcm );
@@ -2775,7 +2778,8 @@
 
         mbedtls_ccm_init( &ccm );
         ret = mbedtls_ccm_setkey( &ccm, cipher_id,
-                                  slot->data.raw.data, key_bits );
+                                  slot->data.raw.data,
+                                  (unsigned int) key_bits );
         if( ret != 0 )
         {
             mbedtls_ccm_free( &ccm );
@@ -2882,7 +2886,7 @@
         ret = mbedtls_rsa_gen_key( rsa,
                                    mbedtls_ctr_drbg_random,
                                    &global_data.ctr_drbg,
-                                   bits,
+                                   (unsigned int) bits,
                                    exponent );
         if( ret != 0 )
         {