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

[gen3] disable some of the elliptic-curves not in use to save flash space #2273

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

avtolstoy
Copy link
Member

@avtolstoy avtolstoy commented Jan 29, 2021

Problem

nRF52840 CC310 hardware crypto support for each particular elliptic curve takes about 700 bytes in closed source Nordic CC310 support library (see ssi_ecpki_domain_* symbols in the map file).

Solution

Stub out ECC curves not supported by mbedTLS!

Original sizes

   text	   data	    bss	    dec	    hex	filename
 481540	   2588	  60404	 544532	  84f14	../../../build/target/system-part1/platform-12-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 511904	   2660	  61552	 576116	  8ca74	../../../build/target/system-part1/platform-13-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 512224	   2692	  61560	 576476	  8cbdc	../../../build/target/system-part1/platform-23-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 508688	   2692	  61560	 572940	  8be0c	../../../build/target/system-part1/platform-25-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 543608	   3076	  62592	 609276	  94bfc	../../../build/target/system-part1/platform-26-m/system-part1.elf

After PR

   text	   data	    bss	    dec	    hex	filename
 474180	   2588	  60408	 537176	  83258	../../../build/target/system-part1/platform-12-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 504528	   2660	  61556	 568744	  8ada8	../../../build/target/system-part1/platform-13-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 504864	   2692	  61564	 569120	  8af20	../../../build/target/system-part1/platform-23-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 501328	   2692	  61564	 565584	  8a150	../../../build/target/system-part1/platform-25-m/system-part1.elf
   text	   data	    bss	    dec	    hex	filename
 536248	   3068	  62596	 601912	  92f38	../../../build/target/system-part1/platform-26-m/system-part1.elf

About 8K savings!

Steps to Test

N/A

Example App

N/A

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy added this to the 3.0.0 milestone Jan 29, 2021
Copy link
Member

@sergeuz sergeuz left a comment

Choose a reason for hiding this comment

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

Niiiice

@avtolstoy avtolstoy force-pushed the fix/gen3-cc310-remove-some-ellitptic-curves branch from 83f912f to 18774b2 Compare February 12, 2021 12:02
@avtolstoy avtolstoy merged commit f7b43ca into develop Feb 12, 2021
@avtolstoy avtolstoy deleted the fix/gen3-cc310-remove-some-ellitptic-curves branch February 12, 2021 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants