Fix NX, add constant time compare, add TF_Span

This commit is contained in:
2026-10-25 16:57:42 -05:00
parent b964ea04df
commit fae86d2eb5
10 changed files with 213 additions and 46 deletions
@@ -80,6 +80,15 @@ class NetworkStream : public Stream {
size_t ReadFrom(uint8_t *buff, size_t sz, std::string &ip, uint16_t &port);
size_t WriteTo(const uint8_t *buff, size_t sz, std::string ip,
uint16_t port);
size_t ReadFrom(TF_Span<uint8_t> buff, std::string &ip, uint16_t &port)
{
return ReadFrom(buff.data(),buff.size(),ip, port);
}
size_t WriteTo(const TF_Span<uint8_t> buff, std::string ip,
uint16_t port)
{
return WriteTo(buff.data(),buff.size(),ip, port);
}
static std::vector<std::pair<std::string, std::string>>
GetIPs(bool ipV6 = false);