Skip to content

SshCipherContext

[Source]

class ref SshCipherContext

Constructors

aes_256_gcm

[Source]

new ref aes_256_gcm(
  key: Array[U8 val] val,
  iv: Array[U8 val] val,
  encrypting: Bool val)
: SshCipherContext ref^ ?

Parameters

Returns


aes_128_gcm

[Source]

new ref aes_128_gcm(
  key: Array[U8 val] val,
  iv: Array[U8 val] val,
  encrypting: Bool val)
: SshCipherContext ref^ ?

Parameters

Returns


aes_256_ctr

[Source]

new ref aes_256_ctr(
  key: Array[U8 val] val,
  iv: Array[U8 val] val,
  encrypting: Bool val)
: SshCipherContext ref^ ?

Parameters

Returns


aes_128_cbc

[Source]

new ref aes_128_cbc(
  key: Array[U8 val] val,
  iv: Array[U8 val] val,
  encrypting: Bool val)
: SshCipherContext ref^ ?

Parameters

Returns


chacha20_poly1305_raw

[Source]

ChaCha20-Poly1305 with explicit key and nonce (8 or 12 bytes).

new ref chacha20_poly1305_raw(
  key: Array[U8 val] val,
  nonce: Array[U8 val] val,
  encrypting: Bool val)
: SshCipherContext ref^ ?

Parameters

Returns


Public Functions

set_aad

[Source]

Set additional authenticated data for AEAD ciphers (GCM). Must be called before encrypt/decrypt.

fun ref set_aad(
  aad: Array[U8 val] val)
: None val ?

Parameters

Returns


encrypt

[Source]

fun ref encrypt(
  plaintext: Array[U8 val] val,
  is_aead: Bool val = true)
: Array[U8 val] val

Parameters

  • plaintext: Array[U8 val] val
  • is_aead: Bool val = true

Returns


set_tag

[Source]

fun ref set_tag(
  gcm_tag: Array[U8 val] val)
: None val ?

Parameters

Returns


tag_value

[Source]

fun box tag_value()
: (Array[U8 val] val | None val)

Returns


decrypt

[Source]

fun ref decrypt(
  ciphertext: Array[U8 val] val)
: (Array[U8 val] val | SshCryptoError)

Parameters

Returns


encrypt_stream

[Source]

Streaming encrypt (Update only, no Final). For CTR/CBC where the cipher context persists across packets.

fun ref encrypt_stream(
  plaintext: Array[U8 val] val)
: Array[U8 val] val

Parameters

Returns


decrypt_stream

[Source]

Streaming decrypt (Update only, no Final). For CTR/CBC where the cipher context persists across packets.

fun ref decrypt_stream(
  ciphertext: Array[U8 val] val)
: Array[U8 val] val

Parameters

Returns