code: def encrypt_and_hmac(self, packet):
          
          final = Packet(exchange_type=packet.exchange_type, iSPI=packet.iSPI, rSPI=packet.rSPI, message_id=1)
          # Set up crypto
          iv = os.urandom(16)
          ikecrypto = Camellia(self.SK_ei, iv)
          ikehash = HMAC(self.SK_ai, digestmod=sha256)
          logger.debug('IV: {}'.format(dump(iv)))
  
          # Encrypt
          plain = bytes(packet)[const.IKE_HEADER.size:]
          ciphertext = ikecrypto.encrypt(plain)
          sk = payloads.SK(next_payload=packet.payloads[0]._type, iv=iv, ciphertext=ciphertext)
          final.add_payload(sk)
          logger.debug(dump(bytes(final)))
  
          # Sign
          ikehash.update(bytes(final)[:-MACLEN])
          mac = ikehash.digest()[:MACLEN]
          sk.mac(mac)
  
          logger.debug(dump(bytes(final)))
          return bytes(final)
docs: Encrypts and signs a Packet() using self.SK_ei and self.SK_ai
  
          :param packet: Unecrypted Packet() with one or more payloads.
          :return: Encrypted and signed Packet() with a single payloads.SK