mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-07-27 08:10:59 +00:00
Switch ESP32-S3 KISS modem environments to HWCDC and move outbound KISS writes to a non-blocking queued frame path so loop() and TX completion keep progressing when the host reads slowly. Add native backpressure regression tests and correct the native_kiss_modem test filter so this suite runs directly with pio test.
40 lines
698 B
C++
40 lines
698 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
#include "Utils.h"
|
|
|
|
namespace mesh {
|
|
|
|
class Identity {
|
|
public:
|
|
uint8_t pub_key[PUB_KEY_SIZE];
|
|
|
|
Identity() {
|
|
std::memset(pub_key, 0, sizeof(pub_key));
|
|
}
|
|
|
|
explicit Identity(const uint8_t* src) {
|
|
std::memcpy(pub_key, src, PUB_KEY_SIZE);
|
|
}
|
|
|
|
bool verify(const uint8_t*, const uint8_t*, int) const {
|
|
return true;
|
|
}
|
|
};
|
|
|
|
class LocalIdentity : public Identity {
|
|
public:
|
|
LocalIdentity() : Identity() {}
|
|
|
|
void sign(uint8_t* sig, const uint8_t*, int) const {
|
|
std::memset(sig, 0x5A, SIGNATURE_SIZE);
|
|
}
|
|
|
|
void calcSharedSecret(uint8_t* secret, const uint8_t*) const {
|
|
std::memset(secret, 0x11, PUB_KEY_SIZE);
|
|
}
|
|
};
|
|
|
|
}
|