def decode_auth_eip8(ciphertext)
      size = ciphertext[0,2].unpack('S>').first + 2
      raise RLPxSessionError, 'invalid ciphertext size' unless ciphertext.size >= size

      message = begin
                  @ecc.ecies_decrypt ciphertext[2...size], ciphertext[0,2]
                rescue
                  raise AuthenticationError, $!
                end

      values = RLP.decode message, sedes: eip8_auth_sedes, strict: false
      raise RLPxSessionError, 'invalid values size' unless values.size >= 4

      [size] + values[0,4]
    end
def decode_auth_eip8(ciphertext)
      size = ciphertext[0,2].unpack('S>').first + 2
      raise RLPxSessionError, 'invalid ciphertext size' unless ciphertext.size >= size

      message = begin
                  @ecc.ecies_decrypt ciphertext[2...size], ciphertext[0,2]
                rescue
                  raise AuthenticationError, $!
                end

      values = RLP.decode message, sedes: eip8_auth_sedes, strict: false
      raise RLPxSessionError, 'invalid values size' unless values.size >= 4

      [size] + values[0,4]
    end
decode EIP-8 auth message format