Skip to content

SshMac

[Source]

primitive val SshMac

Constructors

create

[Source]

new val create()
: SshMac val^

Returns


Public Functions

compute_sha256

[Source]

fun box compute_sha256(
  key: Array[U8 val] val,
  data: Array[U8 val] val)
: Array[U8 val] val

Parameters

Returns


compute_sha512

[Source]

fun box compute_sha512(
  key: Array[U8 val] val,
  data: Array[U8 val] val)
: Array[U8 val] val

Parameters

Returns


verify

[Source]

Constant-time equality of two MAC/tag byte strings. The loop always visits every byte (XOR-accumulate, no early return) so its timing does not reveal where a mismatch occurred — do not "optimize" it into an early return, which would reintroduce a timing oracle. Used to compare a received MAC against the locally computed one.

fun box verify(
  expected: Array[U8 val] val,
  computed: Array[U8 val] val)
: Bool val

Parameters

Returns


eq

[Source]

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

Parameters

Returns


ne

[Source]

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

Parameters

Returns