mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-23 00:11:20 +00:00
refactor(crypto): replace orlp/ed25519 with Monocypher 4.0.2
Swap the vendored orlp/ed25519 (frozen ~2017 ref10) for Monocypher 4.0.2, an actively maintained, audited, single-file implementation. The persisted private key keeps its 64-byte expanded layout (clamped SHA-512(seed) scalar a || nonce prefix), so identities written by older firmware load, sign, verify and key-exchange unchanged -- no re-key, no storage migration, full wire compatibility with the existing mesh and Arduino MeshCore. Because the stored key carries no seed for Monocypher's high-level EdDSA API, Identity drives signing from the low-level primitives (crypto_sha512 + crypto_eddsa_reduce/scalarbase/mul_add); verify uses crypto_ed25519_check and ECDH uses crypto_eddsa_to_x25519 + crypto_x25519. Nonce material is now wiped after signing. Validated byte-for-byte against the previous orlp output via a known-answer harness (keygen, sign-from-expanded-key, verify accept/reject, X25519-over-Ed25519 shared secret) before the swap. Frees ~42 KB of flash: orlp linked ~55 KB (dominated by its ~30 KB ref10 precomputed tables); the Monocypher Ed25519/X25519/SHA-512 paths link ~14 KB, with --gc-sections dropping all unused algos. wio_tracker_l1 pristine build: FLASH 54.14%, links clean. Monocypher is CC0-1.0 OR BSD-2-Clause.
This commit is contained in:
1 parent
2545f0220c
commit
09074d8852
27 files changed
+4015
-5069
No files matched your search
@@ -6,7 +6,6 @@
|
||||
#include "CompanionMesh.h"
|
||||
#include <mesh/Utils.h>
|
||||
#include <helpers/TxtDataHelpers.h>
|
||||
#include <ed_25519.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
Reference in new issue
Block a user