Skip to content

Commit

Permalink
More code formatting and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Lundblade committed Nov 16, 2023
1 parent e9e54cb commit 2055ce7
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/t_cose_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2055ce7

Please sign in to comment.