Files
moon-i2p/ntcp2/pkg.generated.mbti
T
nandi ae72b00323
check / check (windows-latest) (push) Failing after 27s
check / check (ubuntu-latest) (push) Failing after 29s
check / check (macos-latest) (push) Failing after 27s
feat: add ratchet, streaming, SU3 reseed, and router floodfill
- Add ratchet/ with ECIES-X25519-AEAD-Ratchet (Proposal 144), Garlic cloves, and ECIES DatabaseLookup replies
- Add streaming/ with Ed25519-signed I2P Streaming (SYN/ACK/NACK/CLOSE/RESET, retransmit, window) and Repliable/Raw Datagrams
- Add common/su3.mbt to parse and verify reseed .su3 bundles
- Add Elligator2 encoding in crypto/ and OfflineSignature support in LeaseSet2 (flags bit 0)
- Router: NTCP2 peer pool, floodfill NetDB crawl, transit tunnel relay, and Garlic/Streaming bridge
- cmd/router: add --peer-dir, --su3, --reseed, --floodfill, --no-clock-skew
- cmd/client: add --dest for persistent destination keys
- Mark Phase 6 complete in README and document the transport scope (NTCP2 only, no SSU2)
2026-11-27 22:23:46 -08:00

140 lines
5.0 KiB
Plaintext

// Generated using `moon info`, DON'T EDIT IT
package "experiments/moon_i2p/ntcp2"
import {
"experiments/moon_i2p/common",
"experiments/moon_i2p/crypto",
"experiments/moon_i2p/encoding",
"experiments/moon_i2p/i2np",
"experiments/moon_i2p/noise",
"moonbitlang/core/debug",
}
// Values
pub fn decode_blocks(Bytes) -> Array[Ntcp2Block] raise Ntcp2Error
pub fn decode_i2np_block(Bytes) -> (@i2np.ShortHeader, @i2np.I2npPayload) raise Ntcp2Error
pub fn derive_siphash_params(Bytes, Bytes) -> SipHashParams
pub fn encode_blocks(Array[Ntcp2Block]) -> Bytes raise Ntcp2Error
pub fn i2np_block(UInt32, UInt32, @i2np.I2npPayload) -> Ntcp2Block raise Ntcp2Error
pub fn router_info_block(@common.RouterInfo, flood? : Bool) -> Ntcp2Block raise Ntcp2Error
pub fn validate_clock_skew(UInt32, UInt32, max_skew_sec? : UInt32) -> Unit raise Ntcp2Error
// Errors
#derive(Eq, @debug.Debug)
pub suberror Ntcp2Error {
Crypto(@crypto.CryptoError)
Noise(@noise.NoiseError)
Encoding(@encoding.EncodingError)
Common(@common.CommonError)
I2np(@i2np.I2npError)
InvalidState(String)
InvalidFormat(String)
InvalidLength(String)
InvalidNetworkId(Byte)
ClockSkew(UInt32, UInt32)
ReplayDetected
}
// Types and methods
pub struct EphemeralReplayCache {
entries : Array[(Bytes, UInt32)]
max_entries : Int32
}
pub fn EphemeralReplayCache::check_and_insert(Self, Bytes, UInt32, window_sec? : UInt32) -> Bool
pub fn EphemeralReplayCache::check_or_raise(Self, Bytes, UInt32, window_sec? : UInt32) -> Unit raise Ntcp2Error
pub fn EphemeralReplayCache::new(max_entries? : Int32) -> Self
#derive(Eq, @debug.Debug)
pub(all) enum Ntcp2Block {
DateTime(UInt32)
Options(Bytes)
RouterInfo(flood_flag~ : Byte, router_info~ : Bytes)
I2np(Bytes)
Termination(valid_frames_received~ : UInt64, reason~ : Byte, additional_data~ : Bytes)
Padding(Bytes)
Unknown(Byte, Bytes)
}
pub fn Ntcp2Block::encode(Self, @encoding.Writer) -> Unit raise Ntcp2Error
pub struct Ntcp2DataSession {
send_cipher : @noise.CipherState
recv_cipher : @noise.CipherState
send_mask : @noise.SipHashLengthMask
recv_mask : @noise.SipHashLengthMask
handshake_hash : Bytes
remote_static : Bytes
}
pub fn Ntcp2DataSession::decrypt_frame(Self, Bytes) -> Array[Ntcp2Block] raise Ntcp2Error
pub fn Ntcp2DataSession::decrypt_frame_body(Self, Bytes) -> Array[Ntcp2Block] raise Ntcp2Error
pub fn Ntcp2DataSession::encrypt_frame(Self, Array[Ntcp2Block]) -> Bytes raise Ntcp2Error
pub fn Ntcp2DataSession::handshake_hash(Self) -> Bytes
pub fn Ntcp2DataSession::remote_static(Self) -> Bytes
pub fn Ntcp2DataSession::unmask_frame_length(Self, Bytes) -> Int32 raise Ntcp2Error
pub struct Ntcp2Handshake {
sym : @noise.SymmetricState
initiator : Bool
local_static : @noise.KeyPair
mut local_ephemeral : @noise.KeyPair?
mut remote_static : Bytes?
mut remote_ephemeral : Bytes?
responder_hash : Bytes
published_iv : Bytes
mut msg2_iv : Bytes
mut m3p2_len : Int32
mut step : Int32
}
pub fn Ntcp2Handshake::finish_read_session_created(Self, Bytes) -> Unit raise Ntcp2Error
pub fn Ntcp2Handshake::finish_read_session_request(Self, Bytes) -> Unit raise Ntcp2Error
pub fn Ntcp2Handshake::into_data_session(Self) -> Ntcp2DataSession raise Ntcp2Error
pub fn Ntcp2Handshake::m3p2_len(Self) -> Int32
pub fn Ntcp2Handshake::new_initiator(@noise.KeyPair, Bytes, Bytes, Bytes) -> Self raise Ntcp2Error
pub fn Ntcp2Handshake::new_responder(@noise.KeyPair, Bytes, Bytes) -> Self raise Ntcp2Error
pub fn Ntcp2Handshake::read_session_confirmed(Self, Bytes) -> Array[Ntcp2Block] raise Ntcp2Error
pub fn Ntcp2Handshake::read_session_created(Self, Bytes) -> SessionCreatedOptions raise Ntcp2Error
pub fn Ntcp2Handshake::read_session_created_head(Self, Bytes) -> SessionCreatedOptions raise Ntcp2Error
pub fn Ntcp2Handshake::read_session_request(Self, Bytes) -> SessionRequestOptions raise Ntcp2Error
pub fn Ntcp2Handshake::read_session_request_head(Self, Bytes, expected_network_id? : Byte) -> SessionRequestOptions raise Ntcp2Error
pub fn Ntcp2Handshake::remote_ephemeral(Self) -> Bytes?
pub fn Ntcp2Handshake::set_ephemeral(Self, @noise.KeyPair) -> Unit
pub fn Ntcp2Handshake::write_session_confirmed(Self, Array[Ntcp2Block]) -> Bytes raise Ntcp2Error
pub fn Ntcp2Handshake::write_session_created(Self, UInt32, padding? : Bytes) -> Bytes raise Ntcp2Error
pub fn Ntcp2Handshake::write_session_request(Self, Int32, UInt32, padding? : Bytes, network_id? : Byte) -> Bytes raise Ntcp2Error
#derive(Eq, @debug.Debug)
pub(all) struct SessionCreatedOptions {
pad_len : UInt32
timestamp_sec : UInt32
}
pub fn SessionCreatedOptions::decode(Bytes) -> Self raise Ntcp2Error
pub fn SessionCreatedOptions::encode(Self) -> Bytes
#derive(Eq, @debug.Debug)
pub(all) struct SessionRequestOptions {
network_id : Byte
version : Byte
pad_len : UInt32
m3p2_len : UInt32
timestamp_sec : UInt32
}
pub fn SessionRequestOptions::decode(Bytes) -> Self raise Ntcp2Error
pub fn SessionRequestOptions::encode(Self) -> Bytes
#derive(Eq, @debug.Debug)
pub(all) struct SipHashParams {
key_ab : Bytes
iv_ab : Bytes
key_ba : Bytes
iv_ba : Bytes
}
// Type aliases
// Traits