A minimal, portable C implementation of Elliptic-Curve Diffie-Hellman for secure key exchange.
Tiny-ECDH-c is a minimal, portable C implementation of the Elliptic-Curve Diffie-Hellman key agreement algorithm. It allows two parties to establish a shared cryptographic secret over insecure channels using elliptic-curve cryptography, with a focus on small code size and no external dependencies.
Embedded systems developers, IoT engineers, and anyone needing lightweight cryptographic key exchange in resource-constrained C environments.
It offers the smallest known ECC implementation in C, is public domain, supports multiple standard curves, and requires zero internal memory allocation—making it ideal for systems where code size and portability are critical.
Small portable Elliptic-Curve Diffie-Hellman in C
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Compiles to only 2.1K ROM for ARM with zero internal RAM allocation, as demonstrated in the README's size report for embedded systems.
Written in standard C with no external dependencies, making it easy to integrate into various projects, including resource-constrained environments.
Supports 10 NIST curves offering 80 to 256 bits of security, providing flexibility for different security needs, as listed in ecdh.h.
Exposes just two functions—ecdh_generate_keys() and ecdh_shared_secret()—simplifying implementation, with examples in ecdh_example.c.
All material is in the public domain, allowing unrestricted use in any project without legal concerns, as stated in the README.
Only implements ECDH; ECDSA for signing is listed as a TODO, making it unsuitable for applications requiring digital signatures.
Users must provide their own random data for private keys, which can be error-prone and requires secure external random number generation.
No built-in protection against out-of-bounds memory access from malicious input, as the README warns, limiting its use in high-security contexts.
Beyond basic examples, the README lacks detailed tutorials or best practices for secure integration, which could hinder adoption.