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

An avr assemble fix for Issue #154 #224

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

L1uTongweiNewAccount
Copy link

Yesterday, I am trying to compile the micro-ecc in MCU atmega328p (avr mcu) when uECC_OPTIMIZATION_LEVEL=4.

But I got an error about too long assembler code.

So I edit the code to split them in some process.

I know it will reduce the speed, but it's better than nothing.

@L1uTongweiNewAccount
Copy link
Author

L1uTongweiNewAccount commented Feb 19, 2024

This is an example when I am using uECC_OPTIMIZATION_LEVEL=4 (Running examples/ecc_test/ecc_test.ino):

20:25:52.404 -> Testing ecc
20:25:53.572 -> Made key 1 in 1171
20:25:54.655 -> Made key 2 in 1066
20:25:55.726 -> Shared secret 1 in 1063
20:25:56.754 -> Shared secret 2 in 1066
20:25:56.754 -> Shared secrets are identical

The test finals in 4.35s.

And this is an example when I am using uECC_OPTIMIZATION_LEVEL=2:

20:35:04.517 -> Testing ecc
20:35:05.638 -> Made key 1 in 1127
20:35:06.807 -> Made key 2 in 1183
20:35:07.875 -> Shared secret 1 in 1074
20:35:08.949 -> Shared secret 2 in 1068
20:35:08.949 -> Shared secrets are identical

This process finals in 4.432s.

@L1uTongweiNewAccount
Copy link
Author

I think the optimize -Os reduces the optimiztion.

So I use -Ofast, and got:

21:01:31.967 -> Testing ecc
21:01:32.756 -> Made key 1 in 791
21:01:33.362 -> Made key 2 in 632
21:01:33.968 -> Shared secret 1 in 583
21:01:34.529 -> Shared secret 2 in 580
21:01:34.529 -> Shared secrets are identical

only 2.562s!

@L1uTongweiNewAccount
Copy link
Author

@aeruder can you merge this or check it? this is a good PR for avr platform.

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.

1 participant