class CryptoToolchain::DiffieHellman::Messages::KeyExchange
Attributes
g[R]
initial[R]
initial?[R]
p[R]
peer[R]
pubkey[R]
Public Class Methods
new(peer: , pubkey: , p: nil, g: nil, initial: false)
click to toggle source
# File lib/crypto_toolchain/diffie_hellman/messages.rb, line 18 def initialize(peer: , pubkey: , p: nil, g: nil, initial: false) if initial && (p.nil? || g.nil?) raise ArgumentError.new("Initial message must provide p and g") end @p = p @g = g @pubkey = pubkey @peer = peer @initial = initial end
Public Instance Methods
to_s()
click to toggle source
# File lib/crypto_toolchain/diffie_hellman/messages.rb, line 31 def to_s "PEER: #{peer.name} P: #{p} G: #{g} PUBKEY: #{pubkey % 1000}" end