RustCrypto / RustCrypto/traits

Does `elliptic-curve` with only the `serde` feature enabled still require `alloc`?

Open
#1,960 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

elliptic-curve
Dominant language
Rust
Stars
755
Forks
256
Avg merge
1h 27m
Merged PRs (30d)
2

Description

Hi,

We're trying to use some primitives from the p256 crate on an embedded target and would like to rely on the serde impls it provides, but sadly this transitively pulls in an alloc requirement that we cannot and do not want to satisfy.

Preliminary checks suggest that the problem is that p256/serde activates elliptic-curve/serde, which in turn unconditionally activates its alloc feature.

Is there a way to get rid of this requirement so that we can use the generated serde impls for Signature without being forced to draw in alloc?

Thanks,

Jona

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 inspecting the feature definitions linked in p256/Cargo.toml and elliptic-curve/Cargo.toml, then trace how enabling p256/serde reaches the alloc requirement. Verify whether the generated serde implementations for Signature can build on the embedded target without alloc; done means serde remains usable while alloc is no longer required.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.