Skip to content

Memory usage improvements#6333

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:memusage_6
May 4, 2023
Merged

Memory usage improvements#6333
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:memusage_6

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

@SparkiDev SparkiDev commented Apr 24, 2023

Description

ECC: make private key field 'k' able to be smaller when ALT_ECC_SIZE is
defined.
WOLFSSL_SMALL_STACK_CACHE: allocate temps using new macros.

When compiled for low memory usage (including ALT_ECC_SIZE) and RSA/DH included:
Previously:

  Application: client_p256_rsa_tls12
    Accept/Connect: 914
    Max in use SSL: 23010
    Errors: 0
  Application: server_p256_rsa_tls12
    Accept/Connect: 1458
    Max in use SSL: 31313
    Errors: 0
  Application: client_p256_rsa_tls12_nca
    Accept/Connect: 914
    Max in use SSL: 19549
    Errors: 0
  Application: server_p256_rsa_tls12_nca
    Accept/Connect: 1458
    Max in use SSL: 23764
    Errors: 0

  Application: client_p256_ecc_tls12
    Accept/Connect: 914
    Max in use SSL: 24690
    Errors: 0
  Application: server_p256_ecc_tls12
    Accept/Connect: 1458
    Max in use SSL: 27614
    Errors: 0
  Application: client_p256_ecc_tls12_nca
    Accept/Connect: 914
    Max in use SSL: 23282
    Errors: 0
  Application: server_p256_ecc_tls12_nca
    Accept/Connect: 1458
    Max in use SSL: 23300
    Errors: 0

With PR changes:

  Application: client_p256_rsa_tls12
    Accept/Connect: 914
    Max in use SSL: 17854
    Errors: 0
  Application: server_p256_rsa_tls12
    Accept/Connect: 1458
    Max in use SSL: 23705
    Errors: 0
  Application: client_p256_rsa_tls12_nca
    Accept/Connect: 914
    Max in use SSL: 14393
    Errors: 0
  Application: server_p256_rsa_tls12_nca
    Accept/Connect: 1458
    Max in use SSL: 20187
    Errors: 0

  Application: client_p256_ecc_tls12
    Accept/Connect: 914
    Max in use SSL: 13708
    Errors: 0
  Application: server_p256_ecc_tls12
    Accept/Connect: 1458
    Max in use SSL: 16629
    Errors: 0
  Application: client_p256_ecc_tls12_nca
    Accept/Connect: 914
    Max in use SSL: 12302
    Errors: 0
  Application: server_p256_ecc_tls12_nca
    Accept/Connect: 1458
    Max in use SSL: 13396
    Errors: 0

Testing

Standard and memory usage.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev SparkiDev self-assigned this Apr 24, 2023
@SparkiDev SparkiDev force-pushed the memusage_6 branch 12 times, most recently from d9af55d to aba7200 Compare April 28, 2023 01:26
@SparkiDev SparkiDev force-pushed the memusage_6 branch 3 times, most recently from 4400444 to aace628 Compare May 2, 2023 06:33
@dgarske dgarske self-assigned this May 3, 2023
@dgarske dgarske self-requested a review May 3, 2023 15:07
Copy link
Copy Markdown
Member

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Very good work on this! Just a couple minor things.

Comment thread wolfssl/wolfcrypt/ecc.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Spelling integr -> integer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread src/pk.c Outdated
Comment thread wolfcrypt/src/ecc.c Outdated
@dgarske
Copy link
Copy Markdown
Member

dgarske commented May 3, 2023

Can you also provide some memory use differences in the PR description?

Copy link
Copy Markdown
Member

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Great work! Also confirmed with async / QuickAssist.

@dgarske dgarske self-assigned this May 3, 2023
ECC: make private key field 'k' able to be smaller when ALT_ECC_SIZE is
defined.
WOLFSSL_SMALL_STACK_CACHE: allocate temps using new macros.
@SparkiDev SparkiDev removed their assignment May 4, 2023
@dgarske
Copy link
Copy Markdown
Member

dgarske commented May 4, 2023

Retest this please

@dgarske dgarske merged commit 4cdf32e into wolfSSL:master May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants