Skip to content

Commit

Permalink
lib_cxng: Add missing WARN_UNUSED_RESULT
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Jan 23, 2024
1 parent 3f90beb commit fd35fed
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
28 changes: 14 additions & 14 deletions lib_cxng/include/lcx_ecdsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ DEPRECATED static inline size_t cx_ecdsa_sign(const cx_ecfp_private_key_t *pvkey
* - CX_EC_INFINITE_POINT
* - CX_INVALID_PARAMETER_VALUE
*/
cx_err_t cx_ecdsa_sign_rs_no_throw(const cx_ecfp_private_key_t *key,
uint32_t mode,
cx_md_t hashID,
const uint8_t *hash,
size_t hash_len,
size_t rs_len,
uint8_t *sig_r,
uint8_t *sig_s,
uint32_t *info);
WARN_UNUSED_RESULT cx_err_t cx_ecdsa_sign_rs_no_throw(const cx_ecfp_private_key_t *key,
uint32_t mode,
cx_md_t hashID,
const uint8_t *hash,
size_t hash_len,
size_t rs_len,
uint8_t *sig_r,
uint8_t *sig_s,
uint32_t *info);

/**
* @brief Verifies an ECDSA signature according to ECDSA specification.
Expand All @@ -180,11 +180,11 @@ cx_err_t cx_ecdsa_sign_rs_no_throw(const cx_ecfp_private_key_t *key,
*
* @return 1 if the signature is verified, 0 otherwise.
*/
bool cx_ecdsa_verify_no_throw(const cx_ecfp_public_key_t *pukey,
const uint8_t *hash,
size_t hash_len,
const uint8_t *sig,
size_t sig_len);
WARN_UNUSED_RESULT bool cx_ecdsa_verify_no_throw(const cx_ecfp_public_key_t *pukey,
const uint8_t *hash,
size_t hash_len,
const uint8_t *sig,
size_t sig_len);

/**
* @deprecated
Expand Down
28 changes: 14 additions & 14 deletions lib_cxng/include/lcx_ecschnorr.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
* - CX_EC_INFINITE_POINT
* - CX_INVALID_PARAMETER_VALUE
*/
cx_err_t cx_ecschnorr_sign_no_throw(const cx_ecfp_private_key_t *pvkey,
uint32_t mode,
cx_md_t hashID,
const uint8_t *msg,
size_t msg_len,
uint8_t *sig,
size_t *sig_len);
WARN_UNUSED_RESULT cx_err_t cx_ecschnorr_sign_no_throw(const cx_ecfp_private_key_t *pvkey,
uint32_t mode,
cx_md_t hashID,
const uint8_t *msg,
size_t msg_len,
uint8_t *sig,
size_t *sig_len);

/**
* @deprecated
Expand Down Expand Up @@ -128,13 +128,13 @@ DEPRECATED static inline size_t cx_ecschnorr_sign(const cx_ecfp_private_key_t *p
*
* @return 1 if signature is verified, 0 otherwise.
*/
bool cx_ecschnorr_verify(const cx_ecfp_public_key_t *pukey,
uint32_t mode,
cx_md_t hashID,
const uint8_t *msg,
size_t msg_len,
const uint8_t *sig,
size_t sig_len);
WARN_UNUSED_RESULT bool cx_ecschnorr_verify(const cx_ecfp_public_key_t *pukey,
uint32_t mode,
cx_md_t hashID,
const uint8_t *msg,
size_t msg_len,
const uint8_t *sig,
size_t sig_len);

#endif

Expand Down
12 changes: 6 additions & 6 deletions lib_cxng/include/lcx_eddsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ DEPRECATED static inline size_t cx_eddsa_sign(const cx_ecfp_private_key_t *pvkey
*
* @return 1 if the signature is verified, otherwise 0.
*/
bool cx_eddsa_verify_no_throw(const cx_ecfp_public_key_t *pukey,
cx_md_t hashID,
const uint8_t *hash,
size_t hash_len,
const uint8_t *sig,
size_t sig_len);
WARN_UNUSED_RESULT bool cx_eddsa_verify_no_throw(const cx_ecfp_public_key_t *pukey,
cx_md_t hashID,
const uint8_t *hash,
size_t hash_len,
const uint8_t *sig,
size_t sig_len);

/**
* @brief Verifies a signature.
Expand Down

0 comments on commit fd35fed

Please sign in to comment.