Skip to content

Commit

Permalink
cx_wrappers.c: Fix missing const attribute on cx_ccitt32
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Jan 31, 2024
1 parent 7bb31ca commit 5567b62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cx_wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ cx_err_t cx_ecdsa_sign_rs_no_throw(const cx_ecfp_private_key_t *key,

#define CX_CRC32_INIT 0xFFFFFFFF

static unsigned int cx_ccitt32[] = {
static const unsigned int cx_ccitt32[] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
Expand Down

2 comments on commit 5567b62

@aido
Copy link
Contributor

@aido aido commented on 5567b62 Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xchapron-ledger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar should probably be done in Speculos also: https://github.com/LedgerHQ/speculos/blob/037612dd4cdfeedc05cd067b455d6b8c35b80d7c/src/bolos/cx_crc.c#L53

Yep we could, yet:

  • On application it still ends in .rodata only when building with the version of GCC used for apps.
  • On Speculos RAM is less precious and .data is supported.

Still I did it here: LedgerHQ/speculos#450

Please sign in to comment.