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

Verhoeff code is not using tables as const causing unnecessary RAM use #9564

Closed
tima-q opened this issue Sep 9, 2021 · 1 comment
Closed

Comments

@tima-q
Copy link
Contributor

tima-q commented Sep 9, 2021

Problem

The Verhoeff calculations use fixed tables sMultiplyTable and sPermTable which are currently not defined as const tables.
This adds 110 bytes RAM for example in the Verhoeff10 case.

The function using the permutation table in the Verfhoeff part also doesn't specify 'const' for the table pointer.
Verhoeff::Permute(int val, uint8_t * permTable, int permTableLen, uint64_t iterCount)

https://github.com/project-chip/connectedhomeip/tree/master/src/lib/support/verhoeff

uint8_t Verhoeff10::sMultiplyTable[] = {

Proposed Solution

  • Declare tables as const to remove the RAM use
  • Add const where applicable to API's
@bzbarsky-apple
Copy link
Contributor

Fixed in #11726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants