Skip to content

SshMpint

[Source]

primitive val SshMpint

Constructors

create

[Source]

new val create()
: SshMpint val^

Returns


Public Functions

canonical

[Source]

Strip redundant leading 0x00 bytes from a big-endian magnitude so its mpint encoding is canonical. SSH mpint (RFC 4251) carries no leading zeros; a non-canonical encoding of the X25519 shared secret K diverges from OpenSSH (which canonicalizes), breaking the exchange hash on the ~1/256 of handshakes where K's top byte is zero. An all-zero (or empty) value canonicalizes to empty, which is the correct encoding of mpint 0.

fun box canonical(
  value: Array[U8 val] val)
: Array[U8 val] val

Parameters

Returns


eq

[Source]

fun box eq(
  that: SshMpint val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: SshMpint val)
: Bool val

Parameters

Returns