feat: implement NTCP2 protocol, native TCP transport, and live I2P interop

This commit is contained in:
nandi committed 2026-11-27 19:42:34 +00:00
1 parent dff69dfac6
commit e6d1c464dd
12 files changed
+2557 -2

No files matched your search

+7 -2
View File
@@ -181,6 +181,11 @@ pub fn SymmetricState::handshake_hash(self : SymmetricState) -> Bytes {
self.h
}
///|
pub fn SymmetricState::chaining_key(self : SymmetricState) -> Bytes {
self.ck
}
///|
pub fn SymmetricState::split(
self : SymmetricState,
@@ -515,8 +520,8 @@ pub fn SipHashLengthMask::next_mask(
next_iv[i] = ((h >> (i * 8)) & 0xFFUL).to_byte()
}
self.iv = Bytes::from_array(next_iv)
// First 2 bytes of the SipHash output (big-endian uint16 mask)
((next_iv[0].to_uint() << 8) | next_iv[1].to_uint()) & 0xFFFFU
// Low 16 bits of the 64-bit SipHash-2-4 output (per I2P NTCP2 spec)
(h & 0xFFFFUL).to_uint()
}
///|
+1
View File
@@ -67,6 +67,7 @@ pub struct SymmetricState {
mut h : Bytes
cipher : CipherState
}
pub fn SymmetricState::chaining_key(Self) -> Bytes
pub fn SymmetricState::decrypt_and_hash(Self, Bytes) -> Bytes raise NoiseError
pub fn SymmetricState::encrypt_and_hash(Self, Bytes) -> Bytes raise NoiseError
pub fn SymmetricState::handshake_hash(Self) -> Bytes