[Showcase] ecmqv-rs: pure Rust ECMQV implementation (no_std, async, 3 curves)

โš“ Rust    ๐Ÿ“… 2026-06-21    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 1      

surdeus

I spent the last month reading NIST SP 800-56A Rev. 3 and writing a pure Rust ECMQV key exchange crate.

Features:

  • Curves: Curve25519, secp256k1, secp256r1 (feature-gated)
  • no_std + alloc
  • Async optional (tokio tested)
  • #![forbid(unsafe_code)]
  • Zeroize on drop

Benchmark (Curve25519):

  • Keygen: ~12.7 ยตs
  • Ephemeral-only: ~200 ยตs
  • Ephemeral-static: ~367 ยตs

What I'm least sure about:
The associate_value implementation for secp256k1/secp256r1. Formula is ศฒ = (x mod 2^L) + 2^L with L = ceil(field_bits/2). I used U256 wrapping arithmetic, but I'd appreciate someone checking if the modulo reduction is correct.

Links:
Repo: GitHub - cexpepe/ecmqv-rs ยท GitHub
crates.io: crates.io: Rust Package Registry
docs.rs: ecmqv_rs - Rust

Looking for review, feedback, and potential users.

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed