|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Ed25519 (RFC 8032) sign + verify over edwards25519. More...
#include "network_drivers/presentation/ssh/crypto/ssh_ed25519.h"#include "network_drivers/presentation/ssh/crypto/ssh_curve25519.h"#include "network_drivers/presentation/ssh/crypto/ssh_fe25519.h"#include "network_drivers/presentation/ssh/crypto/ssh_sha512.h"Go to the source code of this file.
Functions | |
| void | ssh_ed25519_pubkey (uint8_t pub[32], const uint8_t seed[32]) |
| void | ssh_ed25519_sign (uint8_t sig[64], const uint8_t *msg, size_t mlen, const uint8_t seed[32]) |
| bool | ssh_ed25519_verify (const uint8_t pub[32], const uint8_t *msg, size_t mlen, const uint8_t sig[64]) |
Ed25519 (RFC 8032) sign + verify over edwards25519.
Points are held in extended twisted-Edwards coordinates (X, Y, Z, T) as four field elements; scalar multiplication is a constant-time bit-by-bit double-and-add; scalars are reduced mod the group order L. SHA-512 hashes the seed, the nonce input, and R||A||M. Deterministic (no RNG). Validated against the RFC 8032 §7.1 vectors and a reference implementation (test_ssh_ed25519).
The field elements and point arithmetic have two implementations: the portable radix-2^16 ssh_gf (from ssh_curve25519, the native / non-S3 path), and on the ESP32-S3 a canonical uint32[8] layer that does each field multiply as one 256-bit modular multiply on the RSA/MPI accelerator (ssh_fe25519.h, active as DETWS_FE25519_MPI_HW) - the same engine that accelerates the X25519 KEX, here driving the Edwards point arithmetic so the host-key signature runs several times faster. Only the point/field layer differs; the SHA-512 hashing and the scalar arithmetic mod L are shared. Both paths are byte-identical by construction.
Definition in file ssh_ed25519.cpp.
| void ssh_ed25519_pubkey | ( | uint8_t | pub[32], |
| const uint8_t | seed[32] | ||
| ) |
Definition at line 554 of file ssh_ed25519.cpp.
References ssh_sha512().
Referenced by ssh_hostkey_ed25519_set().
| void ssh_ed25519_sign | ( | uint8_t | sig[64], |
| const uint8_t * | msg, | ||
| size_t | mlen, | ||
| const uint8_t | seed[32] | ||
| ) |
Definition at line 564 of file ssh_ed25519.cpp.
References ssh_sha512(), ssh_sha512_final(), ssh_sha512_init(), and ssh_sha512_update().
| bool ssh_ed25519_verify | ( | const uint8_t | pub[32], |
| const uint8_t * | msg, | ||
| size_t | mlen, | ||
| const uint8_t | sig[64] | ||
| ) |
Definition at line 609 of file ssh_ed25519.cpp.
References ssh_sha512_final(), ssh_sha512_init(), and ssh_sha512_update().