From 80bed236dee9885c43feb75292757b938acbd55f Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Thu, 26 Jul 2018 13:03:38 +0100 Subject: [PATCH] Change psa_structs to use unsigned ints These structs are using bitfields of length one, which can only represent 0 and -1 for signed ints. Changing these to unsigned int lets them represent 0 and 1, which is what we want. --- include/psa/crypto_struct.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index baf5b1495c..e38a9bfbac 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -98,11 +98,11 @@ typedef struct struct psa_mac_operation_s { psa_algorithm_t alg; - int key_set : 1; - int iv_required : 1; - int iv_set : 1; - int has_input : 1; - int is_sign : 1; + unsigned int key_set : 1; + unsigned int iv_required : 1; + unsigned int iv_set : 1; + unsigned int has_input : 1; + unsigned int is_sign : 1; uint8_t mac_size; union { @@ -119,9 +119,9 @@ struct psa_mac_operation_s struct psa_cipher_operation_s { psa_algorithm_t alg; - int key_set : 1; - int iv_required : 1; - int iv_set : 1; + unsigned int key_set : 1; + unsigned int iv_required : 1; + unsigned int iv_set : 1; uint8_t iv_size; uint8_t block_size; union