From 5d1888ebc547535294f20e9041680911b5d99e1b Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 12 Jul 2018 00:32:42 +0200 Subject: [PATCH] Rename PSA_ALG_STREAM_CIPHER -> PSA_ALG_STREAM_CIPHER_BASE Follow the usual naming convention: PSA_ALG_xxx_BASE for a constant that isn't an algorithm, just used to build one. --- include/psa/crypto.h | 5 +++-- library/psa_crypto.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index f1c8368349..95fe42d697 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -610,13 +610,14 @@ typedef uint32_t psa_algorithm_t; #define PSA_ALG_CFB_BASE ((psa_algorithm_t)0x04000002) #define PSA_ALG_OFB_BASE ((psa_algorithm_t)0x04000003) #define PSA_ALG_XTS_BASE ((psa_algorithm_t)0x04000004) -#define PSA_ALG_STREAM_CIPHER ((psa_algorithm_t)0x04800000) + +#define PSA_ALG_STREAM_CIPHER_BASE ((psa_algorithm_t)0x04800000) #define PSA_ALG_CTR ((psa_algorithm_t)0x04800001) #define PSA_ALG_ARC4 ((psa_algorithm_t)0x04800002) #define PSA_ALG_IS_STREAM_CIPHER(alg) \ (((alg) & (PSA_ALG_CATEGORY_MASK | PSA_ALG_CIPHER_SUBCATEGORY_MASK)) == \ - PSA_ALG_STREAM_CIPHER) + PSA_ALG_STREAM_CIPHER_BASE) #define PSA_ALG_CCM ((psa_algorithm_t)0x06000001) #define PSA_ALG_GCM ((psa_algorithm_t)0x06000002) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 9145a6df13..50a99904c5 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1191,7 +1191,7 @@ static const mbedtls_cipher_info_t *mbedtls_cipher_info_from_psa( switch( alg ) { - case PSA_ALG_STREAM_CIPHER: + case PSA_ALG_STREAM_CIPHER_BASE: mode = MBEDTLS_MODE_STREAM; break; case PSA_ALG_CBC_BASE: