Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reduce BearSSL code size by not -O2 FSMs#7807

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
d-a-v merged 2 commits intoesp8266:masterfromearlephilhower:minibssl
Jan 3, 2021

Conversation

@earlephilhower
Copy link
Collaborator

The FSMs that drive the encryption logic are not performance critical,
but they are very large. Build BearSSL using -Os on them, leaving -O2
everywhere else (i.e. encryption) for speed.

Saves 1-2KB of flash for SSL applications.

The FSMs that drive the encryption logic are not performance critical,but they are very large.  Build BearSSL using -Os on them, leaving -O2everywhere else (i.e. encryption) for speed.Saves 1-2KB of flash for SSL applications.
@devyte
Copy link
Collaborator

The FSMs that drive the encryption logic are not performance critical

What is the performance impact of this change?
Is the connection process impacted?
Is the encryption itself during communication impacted?
All of the above? none?
Is the impact negligible? ~1% slower? ~10%?

@earlephilhower
Copy link
CollaboratorAuthor

I wasn't able to measure a consistent performance difference (there is always some wiggle, this change is below that threshold) using the validation example's time-tests.

Encryption/BW is unimpacted as well, as far as I can tell (again, always some wiggle). Only the FSM (think of it as the control plane) had-Os used. Everything else is still at-O2 (AES, Elliptic Curve, SHA, etc.)

The FSM basically was inlining a copy-small-no-of-bytes-from-a-to-b multiple times. Saves a few register stores and call/ret, but it's only done 1-2 times per an entire connection.

The FSM itself doesn't have much option for logic optimization, it's a machine-generated, Forth-like interpreter with a byte-byte processor so eachcase is pretty minimal, and the case transitions are driven off of a big table, so GCC really can't look into things.

So, AFAICT, it's ~0 perf impact and 1-2K (depends on your calls) size savings.

Copy link
Collaborator

@devytedevyte left a comment

Choose a reason for hiding this comment

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

Approved!

@d-a-vd-a-v merged commit100a8df intoesp8266:masterJan 3, 2021
@earlephilhowerearlephilhower deleted the minibssl branchJanuary 3, 2021 23:12
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@d-a-vd-a-vd-a-v approved these changes

@devytedevytedevyte approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@earlephilhower@devyte@d-a-v

[8]ページ先頭

©2009-2025 Movatter.jp