A compact portable X25519 + Ed25519 implementation
Find a file
Davy Landman 1ed9c87ab6
Some checks failed
Test C code / build (push) Has been cancelled
Fixing release code
2022-02-22 10:48:04 +01:00
.github/workflows Fixing release code 2022-02-22 10:48:04 +01:00
src Fixed issue #1 2022-02-22 10:28:09 +02:00
test Fixed issue #1 2022-02-22 10:28:09 +02:00
.gitattributes Ignore more in the sourc export 2020-01-28 21:17:50 +01:00
.gitignore Tried makeing a github actions config to build a release automatically 2020-01-28 20:58:25 +01:00
algamize.sh Small fix for generated c++ header 2020-01-29 20:11:03 +01:00
LICENSE Switched to CC0 license, more favoured over The Unlicense 2020-01-22 12:51:07 +01:00
Makefile Added license file to dist directory 2020-01-28 21:19:40 +01:00
README.md Fixed markdown rending issues 2020-01-28 21:27:37 +01:00

compact25519: A compact portable X25519 + Ed25519 implementation

This library is a compact and portable (c99) implementation of two popular operations on the Curve25519:

  • X25519: Diffie-Hellman Key Exchange
  • Ed25519: EdDSA signature system

There are quite some advantages over older RSA based algorithms:

  • compact key size (32 bytes for X25519 and 64bytes for Ed25519)
  • Less opportunities to introduce side-channels
  • Faster than other popular alternatives at the same 128bit security level

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:

  • Download release from Github and copy into your project directory
  • TODO: Use PlatformIO and take a dependency on compact25519

License and origins

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.

Smaller binaries

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%