def pack_and_encrypt_grad_hess(self, grad, hess):
        """Pack and Encrypt Grad and Hess
        Args:
            grad: list of grad
            hess: list of hess
        Returns:
            encrypted number of packed grad and hess
        """
        grad_hess_encoding = self.pack_grad_hess(grad, hess)
        grad_hess_ciphertext = [
            self.public_key.raw_encrypt(encoding, random_value=None)
            for encoding in grad_hess_encoding
        ]
        enc_numbers = [
            PaillierEncryptedNumber(self.public_key, i, self.exponent)
            for i in grad_hess_ciphertext
        ]
        return enc_numbers
Pack and Encrypt Grad and Hess
        Args:
            grad: list of grad
            hess: list of hess
        Returns:
            encrypted number of packed grad and hess
        
fedlearner/model/tree/packing.py