Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1364: Error codes not systematically checked in the implementation #443

Merged
merged 20 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
15da2cf
Check return value for functions declared in ox_ec.h
dmorais-ledger Sep 18, 2023
76178c8
Make sure cx_bn_unlock() is not bypassed by CX_CHECK error
dmorais-ledger Sep 20, 2023
2274155
Check return value for functions declared in ox_bn.h
dmorais-ledger Sep 22, 2023
a2d79af
Check return value for functions declared in
dmorais-ledger Sep 25, 2023
e5edf3e
Check return value for functions declared in cx_ripemd160.h
dmorais-ledger Sep 22, 2023
cabddf3
Check return value for functions declared in cx_sha256.h
dmorais-ledger Sep 25, 2023
638f416
Check return value for functions declared in
dmorais-ledger Sep 25, 2023
24b0f73
Check return value for functions declared in lcx_aead.h
dmorais-ledger Sep 25, 2023
172d631
Check return value for functions declared in lcx_aes_siv.h
dmorais-ledger Sep 25, 2023
9914388
Check return value for functions declared in lcx_blake3.h
dmorais-ledger Sep 25, 2023
6c2607c
Check return value for functions declared in lcx_ecfp.h
dmorais-ledger Sep 25, 2023
3797ee0
Check return value for functions declared in lcx_hmac.h
dmorais-ledger Sep 26, 2023
6d7b6d3
Check return value for functions declared in lcx_ripemd160.h
dmorais-ledger Sep 26, 2023
a008d3b
Check return value for functions declared in lcx_rng.h
dmorais-ledger Sep 26, 2023
5e2005f
Check return value for functions declared in lcx_sha3.h
dmorais-ledger Sep 26, 2023
8c69a4f
Check return value for functions declared in
dmorais-ledger Sep 26, 2023
ba40e20
Check return value for functions declared in lcx_hash.h
dmorais-ledger Sep 27, 2023
1b0080b
Check return value for cx_hash_no_throw
dmorais-ledger Sep 27, 2023
7d96c8b
FIX CI issue: don't check return value of cx_ripemd160_init
dmorais-ledger Sep 29, 2023
bedb954
Fix typo
dmorais-ledger Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/ox_aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ typedef struct cx_aes_key_s cx_aes_key_t;
* - CX_OK on success
* - CX_INVALID_PARAMETER
*/
SYSCALL cx_err_t cx_aes_set_key_hw(const cx_aes_key_t *key PLENGTH(sizeof(cx_aes_key_t)),
uint32_t mode);
SYSCALL WARN_UNUSED_RESULT cx_err_t
cx_aes_set_key_hw(const cx_aes_key_t *key PLENGTH(sizeof(cx_aes_key_t)), uint32_t mode);

/**
* @brief Resets the AES context.
Expand All @@ -112,7 +112,7 @@ SYSCALL void cx_aes_reset_hw(void);
* - CX_OK on success
* - INVALID_PARAMETER
*/
SYSCALL cx_err_t cx_aes_block_hw(const unsigned char *inblock PLENGTH(16),
unsigned char *outblock PLENGTH(16));
SYSCALL WARN_UNUSED_RESULT cx_err_t cx_aes_block_hw(const unsigned char *inblock PLENGTH(16),
unsigned char *outblock PLENGTH(16));

#endif
52 changes: 26 additions & 26 deletions include/ox_bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
* - CX_EC_INVALID_POINT
* - CX_EC_INFINITE_POINT
*/
SYSCALL cx_err_t cx_bls12381_key_gen(uint8_t mode,
const uint8_t *secret,
size_t secret_len,
const uint8_t *salt,
size_t salt_len,
uint8_t *key_info,
size_t key_info_len,
cx_ecfp_384_private_key_t *private_key,
uint8_t *public_key,
size_t public_key_len);
SYSCALL WARN_UNUSED_RESULT cx_err_t cx_bls12381_key_gen(uint8_t mode,
const uint8_t *secret,
size_t secret_len,
const uint8_t *salt,
size_t salt_len,
uint8_t *key_info,
size_t key_info_len,
cx_ecfp_384_private_key_t *private_key,
uint8_t *public_key,
size_t public_key_len);

/**
* @brief Hash a message to be signed with BLS12-381 signature scheme.
Expand All @@ -96,12 +96,12 @@ SYSCALL cx_err_t cx_bls12381_key_gen(uint8_t mode,
* - CX_INVALID_PARAMETER
* - CX_MEMORY_FULL
*/
SYSCALL cx_err_t cx_hash_to_field(const uint8_t *msg,
size_t msg_len,
const uint8_t *dst,
size_t dst_len,
uint8_t *hash,
size_t hash_len);
SYSCALL WARN_UNUSED_RESULT cx_err_t cx_hash_to_field(const uint8_t *msg,
size_t msg_len,
const uint8_t *dst,
size_t dst_len,
uint8_t *hash,
size_t hash_len);

/**
* @brief Sign the hash of a message.
Expand Down Expand Up @@ -131,11 +131,11 @@ SYSCALL cx_err_t cx_hash_to_field(const uint8_t *msg,
* - CX_INTERNAL_ERROR
* - CX_INVALID_PARAMETER
*/
SYSCALL cx_err_t ox_bls12381_sign(const cx_ecfp_384_private_key_t *key,
const uint8_t *message,
size_t message_len,
uint8_t *signature,
size_t signature_len);
SYSCALL WARN_UNUSED_RESULT cx_err_t ox_bls12381_sign(const cx_ecfp_384_private_key_t *key,
const uint8_t *message,
size_t message_len,
uint8_t *signature,
size_t signature_len);

/**
* @brief Aggregate multiple signatures.
Expand All @@ -159,11 +159,11 @@ SYSCALL cx_err_t ox_bls12381_sign(const cx_ecfp_384_private_key_t *key,
* - CX_INTERNAL_ERROR
* - CX_INVALID_PARAMETER
*/
SYSCALL cx_err_t cx_bls12381_aggregate(const uint8_t *in,
size_t in_len,
bool first,
uint8_t *aggregated_signature,
size_t signature_len);
SYSCALL WARN_UNUSED_RESULT cx_err_t cx_bls12381_aggregate(const uint8_t *in,
size_t in_len,
bool first,
uint8_t *aggregated_signature,
size_t signature_len);

#endif // HAVE_BLS
#endif // OX_BLS_H
Loading