module Net::SSH::Transport::GCMCipher

def initialize(encrypt:, key:)


The RFC's use IV and nonce interchangeably.
as it is not randomly generated due to being supplied from a counter.
Semantically gcm cipher supplies the OpenSSL iv interface with a nonce
def initialize(encrypt:, key:)
  @cipher = OpenSSL::Cipher.new(algo_name)
  @key    = key
  key_len = @cipher.key_len
  if key.size != key_len
    error_message = "#{cipher_name}: keylength does not match"
    error { error_message }
    raise error_message
  end
  encrypt ? @cipher.encrypt : @cipher.decrypt
  @cipher.key = key
  @nonce = {
    fixed: nil,
    invocation_counter: 0
  }
end