Some checks failed
Build and deploy Docs site to GitHub Pages / github-pages (push) Has been cancelled
PR Build Check / build (Heltec_v3_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (Heltec_v3_repeater) (push) Has been cancelled
PR Build Check / build (Heltec_v3_room_server) (push) Has been cancelled
PR Build Check / build (LilyGo_Tlora_C6_repeater_) (push) Has been cancelled
PR Build Check / build (PicoW_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_companion_radio_ble) (push) Has been cancelled
PR Build Check / build (RAK_4631_repeater) (push) Has been cancelled
PR Build Check / build (RAK_4631_room_server) (push) Has been cancelled
PR Build Check / build (wio-e5-mini_repeater) (push) Has been cancelled
- MeshCore-based Simple Sensor firmware - Heltec T114 without display - BME280 sensor support (temp/humidity/pressure) - Radio: 868.856018 MHz, SF7, BW62.5 kHz, CR4/7 - 2-byte path hash - PlatformIO project
24 lines
561 B
C
24 lines
561 B
C
#include "ed_25519.h"
|
|
#include "sha512.h"
|
|
#include "ge.h"
|
|
|
|
|
|
void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed) {
|
|
ge_p3 A;
|
|
|
|
sha512(seed, 32, private_key);
|
|
private_key[0] &= 248;
|
|
private_key[31] &= 63;
|
|
private_key[31] |= 64;
|
|
|
|
ge_scalarmult_base(&A, private_key);
|
|
ge_p3_tobytes(public_key, &A);
|
|
}
|
|
|
|
void ed25519_derive_pub(unsigned char *public_key, const unsigned char *private_key) {
|
|
ge_p3 A;
|
|
|
|
ge_scalarmult_base(&A, private_key);
|
|
ge_p3_tobytes(public_key, &A);
|
|
}
|