lib/packetgen/plugin/crypto.rb
# Compute and set IV for deciphering mode
# @param [PacketGen::Types::String] salt
# @param [String] msg ciphered message
# @return [String] iv
Compute and set IV for deciphering mode
Compute and set IV for deciphering mode
def compute_iv_for_decrypting(salt, msg)
      case confidentiality_mode
      when 'gcm'
        iv = msg.slice!(0, 8)
        real_iv = salt + iv
      when 'cbc'
        @conf.padding = 0
        real_iv = iv = msg.slice!(0, 16)
      when 'ctr'
        iv = msg.slice!(0, 8)
        real_iv = salt + iv + [1].pack('N')
      else
        real_iv = iv = msg.slice!(0, 16)
      end
      @conf.iv = real_iv
      iv
    end
def compute_iv_for_decrypting ( salt , msg ) case confidentiality_mode when 'gcm' iv = msg . slice! ( 0 , 8 ) real_iv = salt + iv when 'cbc' @conf . padding = 0 real_iv = iv = msg . slice! ( 0 , 16 ) when 'ctr' iv = msg . slice! ( 0 , 8 ) real_iv = salt + iv + [ 1 ] . pack ( 'N' ) else real_iv = iv = msg . slice! ( 0 , 16 ) end @conf . iv = real_iv iv end
Compute and set IV for deciphering mode
Compute and set IV for deciphering mode
None
String
salt
msg
msg ciphered message
msg ciphered message