SshWireReader.readMpint

const(ubyte)[] readMpint(size_t maxBytes = SshWireLimits.mpintMax) @safe

Reads an mpint in its canonical two's-complement form and validates RFC 4251 section 5 encoding rules.

The reader accepts only values used by this protocol family: non-negative integers in minimal encoding. Redundant leading zero bytes and negative values are rejected rather than silently normalized, so a misbehaving peer becomes visible.

Parameters

maxBytesLimit on the payload length.

Returns

The value as big-endian magnitude bytes with no sign padding;

zero reads as an empty array.