class CryptoToolchain::DiffieHellman::Messages::Datum

Attributes

contents[R]
initial[R]
initial?[R]
peer[R]

Public Class Methods

new(peer: , contents: , initial: false) click to toggle source
# File lib/crypto_toolchain/diffie_hellman/messages.rb, line 37
def initialize(peer: , contents: , initial: false)
  @peer = peer
  @contents = contents
  @initial = initial
end

Public Instance Methods

decrypt(key: ) click to toggle source
# File lib/crypto_toolchain/diffie_hellman/messages.rb, line 43
def decrypt(key: )
  iv = contents[0..15]
  contents[16..-1].decrypt_cbc(key: key, iv: iv)
end