Protecting Function Privacy and Input Privacy in the Publicly Veriﬁable Outsourcing Computation of Polynomial Functions

: With the prevalence of cloud computing, the outsourcing of computation has gained signiﬁcant attention. Clients with limited computing power often outsource complex computing tasks to the cloud to save on computing resources and costs. In outsourcing the computation of functions, a function owner delegates a cloud server to perform the function’s computation on the input received from the user. There are three primary security concerns associated with this process: protecting function privacy for the function owner, protecting input privacy for the user and guaranteeing that the cloud server performs the computation correctly. Existing works have only addressed privately veriﬁable outsourcing computation with privacy or publicly veriﬁable outsourcing computation without input privacy or function privacy. By using the technologies of homomorphic encryption, proxy re-encryption and veriﬁable computation, we propose the ﬁrst publicly veriﬁable outsourcing computation scheme that achieves both input privacy and function privacy for matrix functions, which can be extended to arbitrary multivariate polynomial functions. We additionally provide a faster privately veriﬁable method. Moreover, the function owner retains control over the function.


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.If they do not allow a user to use their function model, the cloud server cannot complete the computation.
The remainder of this paper is organized as follows.We present a brief overview of the related works in Section 2. We define the notation and review the necessary preliminaries in Section 3. We provide the system model and design goals in Section 4. In Section 5, we provide our publicly verifiable outsourcing computation scheme with privacy measures, and in Section 6, we analyze the performance of our scheme.Finally, Section 7 contains our conclusions and future works.

Related Works
There have been many works addressing one or more of the requirements mentioned above in outsourcing function computation.The schemes in [10][11][12] realize function privacy and input privacy based on FHE [2] or GCs [4].However, they can only achieve private verification and not public verification.Additionally, the expensiveness of cryptographic primitives, such as GCs and FHE, limits their practical relevance.The schemes in [13][14][15] use lightweight algorithms for encryption and decryption instead of FHE to construct schemes with input privacy and function privacy.They reduce the system costs but still do not realize public verification.
The scheme in [16] shares the function model and input data among multiple servers using additive secret sharing [20] rather than encryption, and the results are obtained through the cooperation of these servers.Although it protects both function privacy and input privacy, it only provides private verification and not public verification.It also requires a strong assumption of non-collusion for the servers or the private data will be leaked.
Some works construct publicly verifiable computation schemes for specific functions.For instance, the works in [7, [17][18][19] have constructed publicly verifiable computation schemes that are efficient for specific functions, such as univariate polynomial functions and matrix functions.In [8], a publicly verifiable computation scheme for Boolean functions was constructed based on key policy attribute-based encryption (KP-ABE) [21].However, this scheme does not offer input or function privacy.Moreover, ref. [9] proposed a publicly verifiable scheme with privacy protection, but it can only protect one element between function privacy and input privacy, i.e., either a publicly verifiable computation scheme with function privacy or a publicly verifiable computation scheme with input privacy.
Table 1 summarizes the requirements achieved in the surveyed literature, which can inform the research findings of our proposed scheme.×/× [9] / × or ×/ Our scheme / Note: -supported; and ×-not supported.
To improve efficiency, our work employs a partial homomorphic encryption scheme.The cloud server needs to perform a transformation on the ciphertexts from two different clients before computing.Several works have addressed this transformation on ciphertexts.For instance, Peter et al. [22] proposed a scheme that requires a participant to possess a strong private key that can decrypt any ciphertext in order to complete the transformation on ciphertexts.However, this approach poses a threat to data privacy and makes the data owner lose the right to control their data.
In contrast, our work ensures that the function owner retains control over their function, thereby strengthening data privacy.In [23], Ximeng Liu et al. split the strong private key in the BCP [24] scheme among multiple participants to decentralize the decryption power of the strong private key.However, their approach did not consider how to split the key securely.Additionally, their ciphertext transformation requires more cooperation among participants, which increases communication costs and decreases computing efficiency.
In contrast, our approach involves fewer participants, has lower communication costs and offers higher computing efficiency.In [25], Yutaka Kawai et al. proposed a homomorphic proxy re-encryption scheme that supports homomorphic operations for re-encrypted ciphertexts.However, this scheme requires a large number of computations of the discrete logarithm and group operations in bilinear groups, which increases the computational cost.Our approach is based on a lean homomorphic proxy re-encryption scheme, which makes computations more efficient.

Preliminaries
In this section, we review the basic notations and the primitives that are treated in this paper.The basic notations are shown in Table 2.

Notations Descriptions x
The lowercase bold letters denote vectors where x i indexes the i-th element

M
The uppercase bold letters denote matrices where M i,j indexes the (i, j)-th element x The transpose of vector x x . . .y The dot product of two vectors, x = (x 1 , . . ., x n ) and y = (y 1 , . . ., y n ), The matrix-vector multiplication of M and x x $ ← S Uniformly sample x from a set S at random.

N
The set of all natural numbers [n] The set {1, . . ., n}, where n ∈ N λ The security parameter p, q The odd primes The set of all m × d matrices over Z q G = g The cyclic group with generator g Φ m (X) The m-th cyclotomic polynomial, where The ring of integer polynomials modulo Φ m R p The ring R with coefficients modulo p χ The discrete Gaussian distribution over the ring (pk, sk) The key pair of public key and secret key

Additive Homomorphic Encryption (Additive HE)
Rivest et al. first proposed homomorphic encryption (HE) in 1978 [1], and this encryption performs homomorphic operations on ciphertexts without decryption.This is equivalent to performing the corresponding operations on plaintext, ensuring data privacy while also maintaining data availability.
Depending on the supported mathematical operations, HE can be classified into partial (additive or multiplicative) homomorphic encryption (PHE) [26,27], fully homomorphic encryption (FHE) [2] and somewhat homomorphic encryption (SWHE) [28][29][30].PHE supports only one type of operation (either additive or multiplicative) on the ciphertext.FHE supports both additive and multiplicative operations but with high computational costs.SWHE supports limited multiplication and addition operations, with lower computational costs compared with FHE.
The following describes the additive homomorphic encryption scheme that we use based on [24], which contains five algorithms: HE = (Setup, KeyGen, Enc, Dec, Eval).The details are as follows: • Setup(λ) → pp: The security parameter λ is taken as input, and two λ-bit large prime numbers, p , q , are chosen.Then, we have N = pq, where p = 2p + 1 and q = 2q + 1.A generator g ∈ Z * N 2 is randomly sampled, and then the public parameters pp = (N, g) are output.
• KeyGen(pp) → (pk, sk): The public parameters pp are taken as input.According The message m is encrypted with public key pk = g a and outputs ciphertext c = (A, B), where and the output message is m = B/(A For two ciphertexts c 1 and c 2 , whose corresponding plaintexts are m 1 , m 2 , where the additive homomorphism property is described as follows: In particular, given a constant γ, we have where

Linear Homomorphic Encryption (LHE)
Linear homomorphic encryption (LHE) [28][29][30] can support limited additive and multiplicative operations on ciphertexts.It is able to compute a linear combination of multiple ciphertexts, which has practical applications.
Given n plaintexts (m 1 , . . ., m n ), the corresponding ciphertext is (c 1 , . . ., c n ).Given n constant coefficients (γ 1 , . . ., γ n ), the ciphertext of the linear combination ∑ n i=1 γ i • m i can be computed by {c i } n i=1 and {γ i } n i=1 .Next, we describe the LHE algorithms based on the private key version by Brakerski and Vaikuntanathan [3].It contains five algorithms: LHE = (Setup, KeyGen, Enc, Dec, Eval).The details are as follows: • Setup(λ) → pp: The security parameter λ is taken as input.Two λ-bit large prime numbers q and p ∈ Z * q are chosen.Set n = 2 log λ −1 , and there is a cyclotomic polynomial f (x) = x n + 1. χ is the discrete Gaussian distribution over the ring R q = Z q [x]/ f (x) .The public parameters pp={n, f , q, χ} are obtained as outputs.

Homomorphic Proxy Re-Encryption (HPRE)
Blaze, Bleumer and Strauss first proposed proxy re-encryption (PRE) [31] at EURO-CRYPT 1998.The proxy can convert the ciphertext encrypted by the data owner into another ciphertext that can be decrypted by the specified data receiver.Homomorphic proxy re-encryption was introduced in [25], which combines the homomorphic property of HE and the "key-switching" property of PRE.
The following describes our homomorphic proxy re-encryption method, which consists of six algorithms: PRE = (Setup, KeyGen, Enc, ReKeyGen, ReEnc, Dec).It is based on the additive homomorphic encryption above, and the details are as follows: • Setup(λ) → pp: The security parameter λ is taken as input.HE.Setup(λ) → pp is run to generate pp = (N, g).Then, the output pp = (N, g) is obtained.• KeyGen(pp) → ((pk i , sk i ), (pk j , sk j )): The public parameter pp is taken as input.HE.KeyGen(pp) → (pk, sk) is run twice to generate (pk i = g a mod N 2 , sk i = a), (pk j = g b mod N 2 , sk j = b), which stands for the public/secret key pair of the data owner and data receiver, respectively.Then, the output ((pk i , sk i ), (pk j , sk j )) is obtained.• Enc(m, pk i ) → c i : For a message m ∈ Z N , the data owner runs HE.Enc(m, pk i ) Then, the output is c i .

•
ReKeyGen(sk i , sk j ) → rk i→j : The data owner's secret key sk i and the data receiver's secret key sk j are taken as input, and the re-encryption key rk i→j = The re-encryption key rk i→j and the ciphertext c i are taken as inputs, and the re-encryption ciphertext c j is obtained as the output, where • Dec(c j , sk j ) → m: The ciphertext c j = (A j , B j ) = (g br , g r (1 + mN)) is decrypted with the data receiver's secret key sk j = b, and the output is m = Verifiable computation is a computational model that allows the client to delegate computational tasks to a computational entity and then to verify the correctness of the computed result without re-executing the entire computation task.The schemes in [32,33] propose a critical observation of matrix-vector multiplication, and the scheme in [9] proposes a solution for publicly verifiable matrix-vector multiplication computation.
The following describes the publicly verifiable matrix-vector multiplication scheme that we use based on [9], which consists of four algorithms: VerM = (Setup, Prepare, Compute, Veri f y).Table 3 shows the data size in the scheme, and the details are given below: • Setup(λ) → pp: The security parameter λ is taken as input, and a λ-bit large prime number q is chosen.Let Z q be a finite field and G = g be a cyclic group of generator g and order q.Let m, d > 0 be integers, and then output pp = (q, m, d, g).

•
Prepare(F) → ver: The function owner takes their matrix F ∈ F , where F = Z m×d q is the set of all m × d matrices over Z q as input to generate the public verification data ver (once and for all).A vector t = (t 1 , . . ., t m ) $ ← Z m q is uniformly sampled, and s = (s 1 , . . ., s d ) = t•F is computed.The obtained output is ver = (T, S), where T = g t = (g t 1 , . . ., g t m ) , S = g s = (g s 1 , . . ., g s d ).
• Compute(F, x) → y: The function F ∈ F and the input x = (x 1 , . . ., x d ) ∈ Z d q are taken as inputs.The result y = Veri f y(ver, x, y) → (0, 1): The public verification data ver, the input x and the result y are taken as input.This convinces the user to accept the result if and only if If the equation is valid, then the output is 1; otherwise, the output is 0.
The correctness of the verification is as follows: The left side: The right side: If y = F • x, then it is easy to verify that Equation (7) holds.Consider a setting in our system model with three entities: a function owner who wants to outsource the function's computation; two non-collusive cloud service providers CSP 1 and CSP 2 that collaborate to complete the computation; and a series of request users who want to obtain the computation results on their inputs.Figure 2 outlines a rough sketch of our system model.It consists of the following three phases: Preparation, Computation and Verification.The number before the text corresponds to Figure 2.

•
Preparation: (1) The function owner encrypts the function parameters and prepares the public verification data.Then, they upload the function's ciphertext to the cloud service provider CSP 1 .(2) A request user encrypts their input when they request CSP 1 to perform the computation.(3) When CSP 1 receives the request from the user, it asks the function owner for permission.(4) The function owner generates a temporary public/secret key pair and a reencryption key when they permit the use of their function.(5) The function owner sends the temporary public key and the re-encryption key to CSP 1 and sends the temporary secret key to CSP 2 .
• Computation: (6) CSP 1 re-encrypts the original function ciphertext with a mask.Then, the new ciphertext can be decrypted by CSP 2 with the temporary secret key.CSP 1 then collaborates with CSP 2 to complete the computation.(7) CSP 1 returns the result ciphertext to the user.

•
Verification: (8) The public verification is performed using the public verification data, the input ciphertext and the result ciphertext.Simultaneously, the user decrypts the result ciphertext and verifies the result privately in a fast way with the public verification data and the plaintexts of their input and result.

Design Goals
There are five goals that need to be achieved in our model: • Maintain function privacy: The function ciphertext and public verification data cannot reveal any information about the function, so the encryption schemes that we use should be semantically secure so that no adversary can infer any information from the obtained ciphertext.• Maintain input privacy.Similarly, the input ciphertext must not reveal information about the input.The encryption scheme for the input, thus, needs to be semantically secure.• Maintain result privacy.No one should be able to obtain information about the result plaintext except for the request user.The result ciphertext cannot be distinguished from the random elements.• Achieve public verification.Anyone can complete the verification with the publicly available information, and there is no malicious CSP that can persuade the public to accept an incorrect result with a non-negligible probability.We assume that the public has limited computational resources, and so verification must be efficient.

•
Ensure the function owner's control over the function.CSPs cannot complete the computation if the function owner does not allow the user to use their function model.

The Proposed Solution
We propose a scheme for the publicly verifiable outsourcing of computation with both input privacy and function privacy for matrix-vector multiplication in this section.The scheme can also be extended to various polynomial functions.
We provide the extension method in Section 5.4.In our setting, the function owner has a matrix F ∈ Z m×d q , and the request user has a vector x.The user requests access from the cloud server for the result y = F • x.Our scheme consists of three phases: Preparation, Computation and Verification, which are specified below.

1.
The key pair of preparation steps for the function owner: -Run HE.Setup(λ) → pp he to generate pp he = (N, g).-Run HE.KeyGen(pp he ) → (pk f , sk f ) to generate (pk f , sk f )=(g a , a).

2.
The function owner encrypts the matrix and uploads it to CSP 1 : The function owner generates the verification data ver: -Run VerM.Prepare(F) → ver to generate ver = (T, S).It holds that T = g t = (g t 1 , . . ., g t m ), S = g s = (g s 1 , . . ., g s d ), where t $ ← Z m q and s = (s 1 , . . ., The request user encrypts the input vector and sends it to CSP 1 : -Run LHE.Setup(λ) → pp lhe to generate the public parameters pp lhe = (n, f , q, χ) for the request user.-Run LHE.KeyGen(pp lhe ) → sk to generate the secret key sk = s for the request user.-For each x i in the input vector x = (x 1 , . . ., The user sends the ciphertext c = (c 1 , . . ., c d ) to CSP 1 and requests computation.
The function owner will generate a temporary key pair and a re-encryption key if permission is granted: -The function owner runs HE.KeyGen(pp he ) → (pk f , sk f ) again to generate a temporary public/secret key pair (pk f = g a , sk f = a ).
The function owner sends pk f and rk f → f to CSP 1 and sends sk f to CSP 2 .

1.
CSP 1 re-encrypts the matrix ciphertext: -For each element ct i in the matrix ciphertext ct, 0 < i ≤ m × d, CSP 1 runs PRE.ReEnc(rk f → f , ct i ) → ct i to re-encrypt ct i into ct i , where

2.
CSP 1 sends the re-encryption ciphertext with a mask to CSP 2 : For each mask r i , run HE.Enc(r i , pk f ) → rct i with the temporary key pk f to generate rct i = (g a ri , g ri (1 + r i N) )mod N 2 , where ri CSP 1 computes the final result's first part res 1 : -Parse r as a m × d-size matrix and write r i,j to index the (i, j)-th element. - ) as an m × d-size matrix and write f i,j to index the (i, j)-th element.It holds that f i,j = f i,j + r i,j .

5.
CSP 2 computes the second part of the final result res 2 : Then, send the second part of the final result res 2 = [res 2 1 , ..., res 2 m ] T to CSP 1 .

6.
CSP 1 computes the final result res and returns it to the user: Then, the final result res=[res 1 , . . ., res m ] T is returned to the user.
Private Verification: -After the user receives the result ciphertext res=(res 1 , ..., res m ) T , for i ∈ [m], they run LHE.Dec(sk, res i ) → y i to generate the plaintext y i , where

The Extension Method for Arbitrary Polynomial Functions
In the previous subsection, we described the verifiable matrix-vector multiplication.However, the function may be arbitrary.The scheme in [9] gives a solution for outsourcing these arbitrary polynomial functions based on the verifiable matrix-vector multiplication scheme.
This scheme decomposes the computation of arbitrary polynomials into a two-phase computation in which the heavy part is the matrix-vector multiplication that can be delegated to the cloud server, and the other part provides a substantially fast computation for the user.Then, we describe the decomposition scheme for univariate polynomials and arbitrary multivariate polynomials based on [9].

Univariate Polynomials
Let F be the set of all univariate polynomials of higher order over a finite field Z q .For any as a matrix of order m, where f i = 0 for all i > d.Set x = (1, x, . . ., x m−1 ) and y = (1, x m , . . ., x m 2 −m ).Then, we have This is a two-phase computation: (i) the computation of u = Fx and (ii) the computation of f (x) = y • u.The first phase is a matrix-vector multiplication function that can be delegated to a cloud server using our verifiable computation scheme.It requires O(m 2 ) = O(d) arithmetic operations.The second phase is a substantially fast computation for the user that requires only O(m) = O( √ d) arithmetic operations locally.

Multivariate Polynomials
Let F be the set of all arbitrary multivariate polynomials over a finite field Z q .For any f (x 1 , . . . , where ; then, we have f (x 1 , . . . ,x m ) = y • (F • x).This is a two-phase computation: (i) the computation of u = Fx and (ii) the computation of f (x 1 , . . . ,x m ) = y • u.The first phase is a matrix-vector multiplication that can be delegated to a cloud server using our verifiable computation scheme.It requires O(d m ) arithmetic operations.The second phase is a substantially fast computation for the user that requires O(d m/2 ) arithmetic operations locally.

•
Correctness of the result ciphertext res from CSP 1 .Given the ciphertexts of the result res and the input vector c, for i ∈ [d], it holds that: Let ∑ d j=1 f i,j a i = âi and ∑ d j=1 f i,j e i = êi , such that the following holds: We can see that the result res corresponds to the multiplication of matrix F and vector x in plaintext.

•
Correctness of decryption for the result ciphertext res.Given the ciphertext of the result res, where for i ∈ [d], it holds that: We can see that the decryption for the result ciphertext is correct.

•
Correctness of public verification.
Given the input vector ciphertext c, the result ciphertext res and the public verification data ver = (T, S) = ((g t 1 , . . ., g t m ), (g s 1 , . . ., g s d )), where for i ∈ [d], it convinces the public to accept the result if and only if: The left side is: and the right side is: If y = F • x, then Equation ( 22) holds.

•
Correctness of private verification.The correctness of private verification is consistent with the description provided in Section 3.4.

Security Analysis
In our two-server setup, we assume that CSP 1 and CSP 2 are non-collusive.Our security model allows for one or both servers to be malicious, as our verifiable computation scheme can detect the malicious behavior and reject the computation result.However, they cannot cooperate with each other.Under the non-collusion assumption, suppose one of the CSPs is malicious; then, the two CSPs cannot collaborate to perform the correct computation because the other CSP updates its data, causing the temporary ciphertext to not correspond to the temporary key.In this process, the malicious CSP does not learn any valuable information.
In our system, the function owner cannot obtain any additional information other than the function parameters.CSP 1 learns only the original ciphertext, the temporary ciphertext after re-encryption and the input ciphertext.CSP 2 learns only the temporary private key, the masked function parameters and the user's input ciphertext.The request user only learns its own input and the computation result.Any public verification party can only learn the input ciphertext, the result ciphertext and the public verification data.
Next, we present the security analysis of our encryption schemes.
• HE.The scheme is based on the hardness of the Decisional Composite Residuosity Assumption and Decisional Diffie-Hellman Assumption, which is stated below: Definition 1. (Decisional Composite Residuosity Problem [26]) Given a composite n and an integer z, decide if z is an n − residue modulo n 2 or not, namely, if there exists y such that z = y n (modn 2 ).
Definition 2. (Decisional Diffie-Hellman Problem [24]) Let g be an element of prime order in a cyclic group G.Given g a , g b , h ∈ G, decide whether or not h = g ab .
Theorem 1.The scheme is semantically secure if and only if the Decisional Composite Residuosity Assumption and Decisional Diffie-Hellman Assumption hold.
Theorem 3. Let r = poly(n) and q = 2 n for some 0 < < 1.The scheme is semantically secure under the worst-case hardness of approximating the shortest vectors on ideal lattices to within a factor of O(2 n ).
• HPRE.It is based on the security of HE. • VerM.It is based on the hardness of the Discrete Logarithm Assumption [9].It will pass the verification by mistake with a probability of 1/q at most, which is negligible when q is a λ-bit prime.It is stated below: Definition 3. (Discrete Logarithm Problem) Let g be an element of prime order in a cyclic group G.Given h ∈ G, compute x such that h = g x .Theorem 4. The scheme is semantically secure if and only if the Discrete Logarithm Assumption holds.

Experimental Results
To verify the efficiency, we performed our experiments on a personal computer with an AMD Ryzen 5 3600 3.6 GHz processor with 8 GB memory and running on the Ubuntu Desktop-20.04.1-LTS operating system using python language.We used the charm-crypto library to implement HE operations, PRE operations and VerM operations and used Microsoft SEAL to implement LHE operations.In the experiment, we set the security parameter of LHE to 4096 and that of HE to 1024.We tested the efficiency for the four entities when the matrix size was (10 × 10, 50 × 50, 100 × 100, 150 × 150).The average time for each experiment was obtained by running it multiple times as shown in the graphs.
Figure 3 illustrates the time cost for the function owner, where the blue line presents the time for encrypting the matrix, the red line presents the time for preparing the generation of the verification data, and the gray line represents the time for the generation of the verification data.As shown in Figure 3, the function owner efficiently prepares the generation of verification data once for all parties.The primary overhead is the encryption of matrix parameters; however, since the function owner only needs to encrypt the function once for all parties, the computation cost can be amortized.Note that the vertical axis is on a logarithmic scale with a base of 10, and the same applies to Figures 4 and 5 4, the time for re-encryption and encrypting masks is nearly identical to that for the function owner to encrypt the matrix, and the homomorphic operations are highly efficient.The computation involving LHE ciphertexts is the most time-consuming, which would significantly burden the user if performed locally.Therefore, it was outsourced to the cloud server for computation.
Figure 5 illustrates the time cost for CSP 2 , where the blue line represents the time for decrypting the masked ciphertext, and the red line represents the time computing the second part of the result ciphertext.As can be seen from Figure 5, the computation with LHE ciphertexts is the most time-consuming, which is the same as CSP 1 , so it was outsourced to the cloud server.Figure 6 illustrates the time cost for the request user, where the blue line represents the time for encrypting their input vector and the red line represents the time for decrypting the final result ciphertext.As shown in Figure 6, the encryption and decryption for users are very efficient.
Figure 7 illustrates the time cost for verification, where the blue line represents the time for private verification, and the red line represents the time for public verification.As shown in Figure 7, the process of private verification is quick and efficient.Public verification, on the other hand, may take more time but is still accessible for the public.Next, we present the communication costs in Table 4, where the matrix size is m × d, N is the parameter in HE, and R p is the ring in LHE.The public Verification Compared with [9], our scheme achieves both function privacy and input privacy.In terms of computational complexity, our scheme is similar to their second scheme with only input privacy for the cloud server side, but we have two servers, which requires twice the computational overhead.At the same time, the two servers need to communicate with each other, which incurs additional communication overhead, but these additional costs provide privacy for the function.

Conclusions and Future Work
In this paper, we focused on the privacy-preserving and publicly verifiable outsourcing computation of matrix functions and polynomial functions.Our publicly verifiable computation scheme achieved both input privacy and function privacy for matrix functions, and it can be extended to arbitrary polynomial functions.Our scheme additionally provides a faster privately verifiable method and ensures the function owner's control over access to the function.Our solution may be of interest to applications in oblivious polynomial evaluation or polynomial prediction model inference.
In the future, we plan to construct a publicly verifiable outsourcing computation scheme for nonlinear functions, such as for activation functions in convolutional neural networks.Furthermore, we will address how to identify malicious cloud servers if the verification fails.

Figure 1 .
Figure 1.Outsourcing computation model of functions.
is taken as a sample, and the output ciphertext is c = (u, v) = (as + pe + m, −a).• Dec(sk, c) → m: The ciphertext c = (u, v) is decrypted with the secret key sk = s, and the output m

Figure 2 .
Figure 2. The publicly verifiable outsourcing computation model with privacy. .

Figure 3 .
Figure 3.The time cost for the function owner.

Figure 4
Figure 4 illustrates the time cost for CSP 1 .The blue line represents the time for reencrypting the ciphertext, the red line represents the time for encrypting the mask, the gray line represents the time for generating the masked ciphertext, and the yellow line represents the time for computing the first part of the result ciphertext.As shown in Figure4, the time for re-encryption and encrypting masks is nearly identical to that for the function owner to encrypt the matrix, and the homomorphic operations are highly efficient.The computation involving LHE ciphertexts is the most time-consuming, which would significantly burden the user if performed locally.Therefore, it was outsourced to the cloud server for computation.Figure5illustrates the time cost for CSP 2 , where the blue line represents the time for decrypting the masked ciphertext, and the red line represents the time computing the second part of the result ciphertext.As can be seen from Figure5, the computation

Figure 4 .
Figure 4.The time cost for CSP 1 .

Figure 5 .
Figure 5.The time cost for CSP 2 .

Figure 6 .
Figure 6.The time cost for the request user.

Figure 7 .
Figure 7.The time cost for verification.

Table 1 .
Comparison of the proposed scheme with previous works.

Table 2 .
Summary of notations.