RustCrypto / elliptic-curves

Collection of pure Rust elliptic curve implementations: NIST P-224, P-256, P-384, P-521, secp256k1, SM2
661 stars 182 forks source link

Porting secp256k1 implementation to ESP32S3 (Xtensa architecture) #1073

Closed SafetyMustHave closed 3 weeks ago

SafetyMustHave commented 1 month ago

Dear RustCrypto team,

I'm working on porting the secp256k1 implementation to the ESP32S3 microcontroller, which uses the Xtensa architecture. I'm seeking advice on the following:

  1. Strategies for adapting the existing secp256k1 Rust implementation to the Xtensa architecture.
  2. Potential performance optimizations for running secp256k1 on a resource-constrained device like ESP32S3.
  3. Memory usage considerations and optimization techniques for this specific use case.
  4. Handling of any architecture-specific challenges that might arise.

Specific questions:

Any guidance, examples, or resources you could provide would be immensely helpful. Thank you for your expertise and support!

tarcieri commented 3 weeks ago

k256 is pure Rust. It should work on any 32-bit or 64-bit target. It's been written with no_std support.

As far as improved performance, it would likely need inline assembly for hotspots. See #55 as an existing tracking issue for that.

SafetyMustHave commented 3 weeks ago

I have already completed the implementation of secp256k1 on ARM.,I'm encountering compatibility issues with secp256k1 while linking a Rust static library for ESP32. and I found the following message: 'c928380082b86401-secp256k1.o: file format not recognized'.

tarcieri commented 3 weeks ago

I don't think that's related to this crate