## 1 Introduction  
With the explosive growth of data, the demand for data processing among users is constantly growing, which makes cloud services increasingly popular. These cloud services can help weak clients with limited resources store large-scale data or complete expensive computational tasks at a low cost. One of the most common applications of cloud services is outsourcing computation. Consider a setting with three entities in the process of outsourcing the computation of functions as shown in Figure 1: a function owner, who possesses the function model and wants to outsource its computation to a cloud server; a series of request users, who need to obtain the function's results on the private inputs; and a cloud server that performs the computation of the function based on the inputs and returns the results to the request users. In this process, the cloud server is untrusted. It should not learn anything about either the input or the function. Additionally, the correctness of the results should be verified. Thus, there are three requirements that need to be considered: function privacy, input privacy and public verifiability. For example, in a medical predication scenario, a doctor, as the function owner, has developed an expensive disease prediction function model; in addition, some patients, as the request users, want to predict the probability of contracting this disease with their personal health data. It would be stressful for the doctor to perform the computation locally, so he wants to outsource the computation of the function to a cloud server. The cloud server would then compute the prediction function based on the inputs from the patients and return the predicted results to them. The function parameters in this process are that private data owned by the doctor should remain confidential from the cloud server. Similarly, the health data of the patients should also be kept confidential. Since the cloud server is unreliable, it may compress the function model or simplify the computation for its own benefit, which can lead to a biased predicted result. Therefore, a fundamental requirement is that the patients can verify the correctness of the computed results. However, in many scenarios, individual verification is not sufficient. For example, patients may need to convince their insurance institutions to accept verification, which means that private verification cannot meet this requirement. Hence, we emphasize public verification, which allows anyone to verify the results of an outsourced function without learning anything about the sensitive data. To address these requirements, researchers have proposed a series of solutions, such as Homomorphic Encryption (HE) [1; 2; 3], Secure Multi-Party Computation (SMPC) [4; 5; 6] and Publicly Verifiable Computation (PVC) [7; 8; 9]. Among them, homomorphic encryption can perform computations on ciphertexts. Secure multi-party computation can enable multiple parties to jointly complete a computing task without revealing their secret information. Publicly verifiable computation can verify the correctness of the computation results. It is important to combine privacy protection with verifiable computation. Many works have been devoted to addressing one or more of the requirements in outsourcing the computation of functions [7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19], but none have achieved all of the above-mentioned requirements simultaneously. Our work aims to fill this gap, and the contributions of this study are listed below:  
* We propose the first publicly verifiable outsourcing computation scheme that achieves both function privacy and input privacy for matrix functions, which can be extended to arbitrary polynomial functions (the extension method is provided). * We additionally provide a faster privately verifiable method, which allows the request user to verify the results more efficiently than with public verification. * The function owner retains control over the function.