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

Added provisional FN-DSA implementation (2025-02-01, with ARM Cortex-… #377

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

pornin
Copy link

@pornin pornin commented Feb 1, 2025

FN-DSA (to-be-standardized Falcon) with M4F optimizations. This is a "provisional" FN-DSA, since the FN-DSA standard is not published yet. This PR relies on the following PR to be first imported in mupq: mupq/mupq#162
Additional M4F optimizations are imported from https://github.com/pornin/c-fn-dsa

This works on my STM32F4 Discovery board. I do not have any other M4 board to test on.

  • PR changes testvectors
  • Tests pass in qemu
  • Testvectors pass in qemu
  • Tests pass on Nucleo-L4R5ZI
  • Testvectors pass on Nucleo-L4R5ZI
  • Updated Benchmarks
  • Updated Skiplist entries

@mkannwischer
Copy link
Contributor

mkannwischer commented Feb 3, 2025

Tracking progress:

  • Tests pass in qemu
  • Testvectors pass in qemu
  • Tests pass on Nucleo-L4R5ZI
  • Testvectors pass on Nucleo-L4R5ZI
  • Updated Benchmarks
  • Updated Skiplist entries

mkannwischer added a commit to mupq/mupq that referenced this pull request Feb 3, 2025
@mkannwischer
Copy link
Contributor

Thanks @pornin for contributing this! Everything works fine on my end.
I've updated the benchmarks and also removed the outdated Falcon implementations.

What's possibly a bit confusing is that you are using a local SHA-3/SHAKE implementations which results in our hashing benchmarks showing 0 cycles spent in hashing.
Maybe we can resolve that in the next iteration of the code? Either by using the pqm4 SHA-3/SHAKE implementation (if that is feasible), or by adding the profiling to your local SHA-3 implementation?

@mkannwischer mkannwischer merged commit 34d92e5 into mupq:master Feb 3, 2025
6 checks passed
@pornin
Copy link
Author

pornin commented Feb 3, 2025

Switching implementation is kinda delicate; mine ensures that the output of Keccak-f is readable directly from the SHAKE buffer. Making an extra function call to do that shows up in the performance figures of verification (the hash-to-point process does that a lot). Alternatively, I could extract bytes by chunks of 136 bytes into an extra buffer, but that will increase stack usage by 136 bytes.

Adding the profiling should not be too hard, I'll check that now.

mkannwischer added a commit that referenced this pull request Feb 4, 2025
Superseded by provisional FN-DSA #377
mkannwischer added a commit that referenced this pull request Feb 4, 2025
mkannwischer added a commit that referenced this pull request Feb 4, 2025
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.

2 participants