A compact portable X25519 + Ed25519 implementation
CC0-1.0 License
This library is a compact and portable (c99) implementation of two popular operations on the Curve25519:
There are quite some advantages over older RSA based algorithms:
compact25519 targets smaller embedded devices, binary size is modest and all operations are on a byte level, no assumption of fast int32/int64 operations.
Since there is no single C package management system, compact25519 is released as a single pair of c & h file. Deployment options:
The implementation of the X25519 and Ed25519 is extracted from Daniel Beer's c25519 version 2017-10-05. Daniel Beer released it under the Public Domain license. To remain in the same spirit, this library is also licensed as Public Domain using the CC0 license.
By default the library contains both X25519 and Ed25519. They share quite some code. compact25519 has several defines so that you can disable either one of the operations to reduce binary size.
Define Flag | Description |
---|---|
COMPACT_DISABLE_ED25519 |
Disable Ed25519 feature and the related code, shaves of 32% |
COMPACT_DISABLE_X25519 |
Disable X25519 feature and the related code, shaves of 25% |
COMPACT_DISABLE_X25519_DERIVE |
Disable custom derive secret feature, extra useful combined with COMPACT_DISABLE_ED25519 , in itself only saves 3%, combined with disabling Ed25519: 45% |