From 2055ce776818b8150b28ffcd56976c971a81932a Mon Sep 17 00:00:00 2001 From: Laurence Lundblade Date: Thu, 16 Nov 2023 11:03:10 -0800 Subject: [PATCH] More code formatting and comments --- src/t_cose_util.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/t_cose_util.h b/src/t_cose_util.h index bd3e2659..8574dd20 100644 --- a/src/t_cose_util.h +++ b/src/t_cose_util.h @@ -155,29 +155,30 @@ bits_iv_alg(int32_t cose_algorithm_id); /** * \brief Create the ToBeMaced (TBM) structure bytes for COSE. * - * \param[in] mac_inputs The input to be mac'd -- payload, aad, - * protected headers. - * \param[in] tbm_first_part_buf The buffer to contain the first part. - * \param[out] tbm_first_part Pointer and length of buffer into which - * the resulting TBM is put. + * \param[in] cose_alg_id Which MAC algorithm to use. + * \param[in] mac_key Key used to perform MAC. + * \param[in] mac_inputs The input to be mac'd -- payload, ext supp data, + * protected headers. + * \param[in] is_mac0 COSE_MAC0 or COSE_MAC. + * \param[out] tag_buf Pointer and length of buffer into which the + * computed HMAC tag is put. + * \param[out] mac_tag Pointer and length of computed tag. * * \return This returns one of the error codes defined by \ref t_cose_err_t. * - * \retval T_COSE_ERR_SIG_STRUCT - * Most likely this is because the protected_headers passed in - * is larger than \ref T_COSE_MAC0_MAX_PROT_HEADER. - * \retval T_COSE_ERR_UNSUPPORTED_HASH + * \retval T_COSE_ERR_UNSUPPORTED_HMAC * If the hash algorithm is not known. - * \retval T_COSE_ERR_HASH_GENERAL_FAIL + * \retval T_COSE_ERR_HMAC_GENERAL_FAIL * In case of some general hash failure. */ enum t_cose_err_t -create_tbm(const int32_t cose_algorithm_id, - struct t_cose_key mac_key, - bool is_mac0, - const struct t_cose_sign_inputs *mac_inputs, - const struct q_useful_buf tag_buf, - struct q_useful_buf_c *mac_tag); +create_tbm(const int32_t cose_alg_id, + struct t_cose_key mac_key, + bool is_mac0, + const struct t_cose_sign_inputs *mac_inputs, + const struct q_useful_buf tag_buf, + struct q_useful_buf_c *mac_tag); + /** * Serialize the to-be-signed (TBS) bytes for COSE.