NoiseXXPattern class

Implementation of the Noise XX pattern for libp2p

The XX pattern: -> e // Initial: Initiator sends ephemeral key <- e, ee, s, es // Response: Responder sends ephemeral key, performs ee+es -> s, se // Final: Initiator sends static key, performs se

Properties

debugChainKey → Uint8List
no setter
debugEphemeralKeys → SimpleKeyPair
no setter
debugHandshakeHash → Uint8List
no setter
debugRemoteStaticKey → Uint8List?
no setter
hashCode → int
The hash code for this object.
no setterinherited
isComplete → bool
no setter
recvKey → SecretKey
no setter
remoteStaticKey → Uint8List
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sendKey → SecretKey
no setter
state → XXHandshakeState
no setter

Methods

getStaticPublicKey() → Future<Uint8List>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readMessage(Uint8List message) → Future<Uint8List?>
Process an incoming handshake message. Returns the decrypted payload if present (msg2 and msg3 may contain payloads).
toString() → String
A string representation of this object.
inherited
writeMessage(List<int> payload) → Future<Uint8List>
Generate the next handshake message with optional payload. For XX pattern: msg1 has no payload, msg2 has responder payload, msg3 has initiator payload.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

create(bool isInitiator, SimpleKeyPair staticKeys) → Future<NoiseXXPattern>
Creates a new NoiseXXPattern instance
createForTesting(bool isInitiator, SimpleKeyPair staticKeys, SimpleKeyPair ephemeralKeys) → Future<NoiseXXPattern>

Constants

KEY_LEN → const int
MAC_LEN → const int
PROTOCOL_NAME → const String