RustCrypto / RustCrypto/elliptic-curves

Microcontroller optimizations.

Open
#55 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Rust
Stars
874
Forks
299
Avg merge
1d 4h
Merged PRs (30d)
12

Description

I have a rather fast implementation of the base field for Cortex-M4/M33 microcontrollers, wrapping stealing the assembly routines in https://github.com/Emill/P256-cortex-ecdh/blob/master/P256-cortex-m4-ecdh-speedopt-gcc.s. Would there be interest to include platform-specific arithmetic implementations in this crate, or should I focus on a "lean and mean" MCU fork?

Some complications are:

  • use [u32; 8] for base field
  • assemble routines and commit "binary" to repository (avoids need for assembler in dependent crates)
  • pick implementation in build.rs, possibly overridable
  • unit tests require a qemu-tests sub-library
  • the use of proptest in dev-dependencies breaks the build for no_std due Cargo feature additivity (byteorder with default features, as so often), not sure how to fix this :/
  • dev dependency hex is std
  • I'm experimenting with inline assembly as well, which might be pulled in if compiled on nightly

This relates to other decisions as well, such as in https://github.com/RustCrypto/elliptic-curves/issues/54 whether to enforce correct but slow constant-time scalar inversion, or open the door to non-constant time implementations which might be abused.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed P256-cortex-m4-ecdh-speedopt-gcc.s routines and the repository areas mentioned for build.rs, qemu-tests, no_std dependencies, and inline assembly. The issue does not define a settled implementation path; done would require an agreed platform-specific arithmetic design, integration strategy, and tests for the supported Cortex-M targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.