Skip to content

Conversation

@ViezeVingertjes
Copy link
Contributor

@ViezeVingertjes ViezeVingertjes commented Feb 8, 2026

Fixes a stack overflow in ed25519_verify() by making large local variables static, removing the need for rweather's Ed25519::verify() workaround.

Only vendors the AES128+SHA256 subset of rweather/Crypto instead of all 37 files.

No issues observed so far. Additional testing and confirmation are welcome. This change frees up stack space for future improvements and improves support for resource-limited devices.

Fixes ed25519_verify() stack overflow by making large locals static,
removing the need for rweather's Ed25519::verify() workaround. Vendors
only the AES128+SHA256 subset of rweather/Crypto instead of all 37 files.
@ViezeVingertjes ViezeVingertjes marked this pull request as ready for review February 8, 2026 15:36
Copy link
Contributor

@weebl2000 weebl2000 left a comment

Choose a reason for hiding this comment

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

Nice improvement — vendoring the minimal subset is clean and the stack savings are real (~1.8KB moved to BSS). One concern about the static locals in ge.c.

Copy link

@JosiahWI JosiahWI left a comment

Choose a reason for hiding this comment

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

The code looks great. I'm giving my capstone team an opportunity to build this PR and test it and then I'll approve. :)

@ViezeVingertjes ViezeVingertjes force-pushed the reduce-crypto-duplication branch from 25b64dd to 48019bf Compare February 9, 2026 21:45
…_verify to ensure thread safety during concurrent calls.
Copy link

@JosiahWI JosiahWI left a comment

Choose a reason for hiding this comment

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

The reduction in program size from this PR will be very useful for my school capstone. One of my teammates has built our branch with it and confirmed that the Flash saving makes it possible to fit the program on an nRF52840 Dongle alongside an InternalFS and DFU bootloader.

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