Implementations of X25519 key agreement and Ed25519 signatures, optimized with ASM for Cortex-M4 processors or higher (ARMv7E-M or higher).
Not reviewed, could have bugs, use at your own risk, etc etc.
The crate can be used directly through the x25519 and ed25519 modules, or
as the driver behind embassy-crypto.
Each driver is behind one Cargo feature named embassy-crypto-<operation>
(embassy-crypto-x25519, embassy-crypto-ed25519). Enabling it registers this
crate's implementation as the global driver for that operation. The all
feature enables both.
[dependencies]
embassy-crypto = "0.1"
cortex25519 = { version = "0.1", features = ["embassy-crypto-x25519", "embassy-crypto-ed25519"] }To make sure Rust links this crate, add a dummy use like this:
use cortex25519 as _;Ed25519 hashes with the embassy-crypto SHA-512 driver, so the application must
register one (for example embassy-crypto-rustcrypto with the
embassy-crypto-sha512 feature, or a HAL with a hardware SHA-512 driver).
qemu-tests runs the X25519 and Ed25519 suites of embassy-crypto-test
(Wycheproof plus generated vectors) in QEMU; see its README.
Original X25519 ASM implementation by Emil Lenngren.
Extended to support Ed25519 verify by Dario Nieuwenhuis.
- Main
cortex25519crate is available under the BSD 2-clause license. - Wycheproof test vectors are available under Apache license.