feat(pqc): identity/COM v2, pqcMode config, selftest gates

Phases 3-6 (SPEC T19-T23): type-1 identity carries ML-KEM-768 + ML-DSA-65 pubs, COM type-2 double-sign, HELLO capability bit, local.conf settings.pqcMode (off/hybrid/pqconly) with classic fallback. selftest KAT + interop matrix + fragment-loss benchmark green.
This commit is contained in:
dedysutanto committed 2026-10-01 15:55:09 +07:00
1 parent d4568326af
commit 86c744897b
19 files changed
+1371 -126

No files matched your search

+15 -12
View File
@@ -43,17 +43,18 @@ namespace ZeroTier {
/* Public Node interface (C++, exposed via CAPI bindings) */
/****************************************************************************/
Node::Node(void *uptr,void *tptr,const struct ZT_Node_Callbacks *callbacks,int64_t now) :
_RR(this),
RR(&_RR),
_uPtr(uptr),
_networks(8),
_now(now),
_lastPingCheck(0),
_lastGratuitousPingCheck(0),
_lastHousekeepingRun(0),
_lastMemoizedTraceSettings(0),
_lowBandwidthMode(false)
Node::Node(void* uptr, void* tptr, const struct ZT_Node_Callbacks* callbacks, int64_t now)
: _RR(this)
, RR(&_RR)
, _uPtr(uptr)
, _networks(8)
, _now(now)
, _lastPingCheck(0)
, _lastGratuitousPingCheck(0)
, _lastHousekeepingRun(0)
, _lastMemoizedTraceSettings(0)
, _lowBandwidthMode(false)
, _pqcMode(ZT_PQC_MODE_HYBRID)
{
if (callbacks->version != 0) {
throw ZT_EXCEPTION_INVALID_ARGUMENT;
@@ -73,7 +74,9 @@ Node::Node(void *uptr,void *tptr,const struct ZT_Node_Callbacks *callbacks,int64
uint64_t idtmp[2];
idtmp[0] = 0;
idtmp[1] = 0;
char tmp[2048];
// Must hold the full private identity string form, which for a type 1
// (PQ hybrid) identity is ZT_IDENTITY_STRING_BUFFER_LENGTH bytes.
char tmp[ZT_IDENTITY_STRING_BUFFER_LENGTH];
int n = stateObjectGet(tptr,ZT_STATE_OBJECT_IDENTITY_SECRET,idtmp,tmp,sizeof(tmp) - 1);
if (n > 0) {
tmp[n] = (char)0;