From a0c0655c912500e96a5d78f93e76d90261b16825 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 21 May 2019 15:54:54 +0200 Subject: [PATCH] Add missing declarations to the API document PSA_KEY_ATTRIBUTES_INIT and psa_key_attributes_init weren't declared in the API document, only defined in our implementation, but they are referenced in the API document. --- include/psa/crypto.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index f4198c8d0..f1a290d7b 100644 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -204,6 +204,22 @@ psa_status_t psa_crypto_init(void); */ typedef struct psa_key_attributes_s psa_key_attributes_t; +/** \def PSA_KEY_ATTRIBUTES_INIT + * + * This macro returns a suitable initializer for a key attribute structure + * of type #psa_key_attributes_t. + */ +#ifdef __DOXYGEN_ONLY__ +/* This is an example definition for documentation purposes. + * Implementations should define a suitable value in `crypto_struct.h`. + */ +#define PSA_KEY_ATTRIBUTES_INIT {0} +#endif + +/** Return an initial value for a key attributes structure. + */ +static psa_key_attributes_t psa_key_attributes_init(void); + /** Declare a key as persistent and set its key identifier. * * If the attribute structure currently declares the key as volatile (which