-
Notifications
You must be signed in to change notification settings - Fork 481
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
Cortex-M4 backend? #228
Comments
Update from my side, I wrote a dedicated library for the Cortex-M4 and Cortex-M33 microcontroller use case, implementing Ed25519 signatures with this approach: https://docs.rs/salty. It's still in alpha release, not every possible optimization is applied, and testing is not sufficient yet. I intend to add on X25519 agreement (with the same Haase field operations), and AEAD using RustCrypto libraries for the symmetric cryptography and hashes. Once this reaches maturity, it may make sense to merge this as another backed into If one is not interested in these fast field operations, using |
Just being able to turn off the lookup tables with a feature flag would be great already. I'm very sympathetic to the idea of a self-contained "field implementation" definition in terms of traits (even at risk of not overall optimal speed, as criticized in that linked issue - it's great for code comprehension to be able to read modular parts individually). I originally wanted the curve in salty.rs to be generic over a field implementation with associated Limbs type (instead of selecting backends via feature flags), e.g. to fuzz two implementations against each other, or even just generate docs for both! In my case, "TweetNaCl" is supposed to be the "didactic" backend, vs. the speedy "Haase" with its assembly. However I got myself into a type pickle (https://users.rust-lang.org/t/how-can-i-use-generic-add-trait-in-generic-mul-trait/34652), this might just be my incompetence though :) |
Adding a NEON field implementation sounds great. It has been inactive for about two years now, and it would be great if someone wants to do it. The best option would probably be to have a Regarding the tables, since they are defined in |
I'm using curve25519-dalek on a NEON-capable device (i.MX-6ULZ Cortex-A7) and may be interested in contributing a NEON backend. |
OK well since it's close to Christmas and everyone has their wishes... :) Future plans for Maybe instead of maintaining all sorts of backends here it would be easier and more useful to the Rust crypto ecosystem to extract interfaces at various abstraction levels (from Because then a higher-level logic/library that has need for signature or key agreement could depend on those traits (high stability requirements) and a specific implementation crate (possibly Cortex-A and desktop here, Cortex-M in salty, RISC-V... somewhere?). Practically, at minimum this (for me) has use for testing the higher-level logic (e.g. think of a PIV-like "app") on desktop instead of on device. Of course that is Christmassy wishful thinking, I can also stub things out or maintain parallel/modified APIs in |
Oh hmm that's dalek-cryptography/ed25519-dalek#80 I guess. |
There is a line of research implementing Curve25519 in constant time on Cortex-M4 microcontrollers by using multiply-and-accumulate instructions that this microcontroller has.
To my knowledge, this starts in [1], with an implementation [2] which unfortunately has LG copyrights. The latest I know of is [3], based on [5] and has no copyright restrictions.
While #187 blocks this, would there be interest in adding support for such a backend? Should this happen in this repository?
[1] http://www.cs.haifa.ac.il/~orrd/LC17/paper39.pdf
[2] https://github.com/hayatofujii/curve25519-cortex-m4
[3] https://github.com/BjoernMHaase/fe25519
[4] https://ches.2017.rump.cr.yp.to/fe534b32e52fcacee026786ff44235f0.pdf
[5] https://eprint.iacr.org/2018/286.pdf
The text was updated successfully, but these errors were encountered: