Secure NOMA Systems With a Dual-Functional RIS: Simultaneous Information Relaying and Jamming

In this paper, we propose a new simultaneous information relaying and jamming (SIRJ) scheme based on a dual-functional reconfigurable intelligent surface (RIS) to achieve secure non-orthogonal multiple access communications. Specifically, the RIS elements are split into two groups, where elements in one group perform signal reflection to enhance the legitimate reception quality while elements in the other group generate artificial jamming to interfere with the eavesdropper (Eve). Based on different channel state information (CSI) availabilities of Eve, the system sum-rate is maximized by jointly optimizing the transmit beamforming of the base station, reflect beamforming of the RIS, and mode selection of each RIS element, subject to a maximum tolerable information leakage to Eve. For the case with perfect Eve’s CSI, a penalty based alternating algorithm is proposed to deal with the challenging multivariate coupled and mixed integer non-convex optimization problem. For the case with imperfect Eve’s CSI, we consider the infinite number of secrecy constraints, for which the traditional $\mathcal {S}$ -procedure cannot be directly applied. To tackle this challenge, we devise an efficient transformation that fits the $\mathcal {S}$ -procedure to the problem and propose a robust secure beamforming design. Simulation results demonstrate the performance advantage of the proposed SIRJ scheme over the existing baseline schemes.


I. INTRODUCTION
I N THE development process of fifth generation (5G) wireless communications, both academia and industry made great efforts to design enhanced mobile broadband (eMBB), massive machine type communication (mMTC) and ultra-reliable low latency communication (URLLC) schemes.As a result, many promising technologies have emerged, such as the massive multiple-input multiple-output (MIMO), millimeter wave (mmWave) and ultra-dense network (UDN) [2].With the commercialization of 5G, the research focus has shifted to future 6th generation (6G) wireless communication.In 6G, it is expected that the network can support connections of about 10 7 devices per square kilometer to cope with the explosive growth of communication devices.Meanwhile, to meet various advanced digital services and multimedia entertainment, such as truly immersive extended reality (XR), digital replica and so on, it is imperative that 6G can provide a peak data rate of 1000 Gbps [3].However, these 6G requirements undoubtedly make the problem of spectrum resource shortage even more critical.
Against this background, non-orthogonal multiple access (NOMA), which was first proposed in [4], is one of the promising technologies for 6G networks due to its high spectrum utilization.Different from conventional orthogonal multiple access (OMA), NOMA allows users to share the same time or frequency resource block but distinguishes them in the power domain.Under the NOMA protocol, a transmitter sends a superimposed signal that contains multiple users' information with different power levels.At the receiver end, successive interference cancellation (SIC) is applied for decoding, that is, the strong signal is decoded first by treating the weak signal as interference, and this process is repeated until the desired signal is obtained [5].Therefore, existing works point out that NOMA can provide a massive connection with a high spectral efficiency while ensuring good fairness among users with different channel conditions, which is superior to OMA [5], [6], [7], and promises to meet the 6G requirements.
Every coin has two sides.Although NOMA can achieve a high spectral efficiency, it also faces security challenges like other technologies, and needs more attention due to not only the broadcast characteristic of wireless channels, but also NOMA itself.In particular, SIC provides a chance for the eavesdropper (Eve) to intercept all users' information contained in the superimposed signal [8].Therefore, necessary physical layer security (PLS) designs are needed to safeguard, such as the applications of secure beamforming, artificial noise (AN), and specially-designed jamming [9], [10], [11], [12].In [9], the beamforming for users were jointly designed, and AN was adopted via zero forcing with an optimized power allocation.Arafa et al. [10] realized secure transmission in which all users sending jamming in a cooperative way to degrade the reception quality at an untrusted relay.Another jamming based secure scheme was proposed in [11], where the jamming power was maximized so that the jamming can be canceled by SIC firstly at legitimate users.Different from designing the decoding order of jamming, the transmission rate of jamming was adapted according to channel conditions to protect the communication from an untrusted relay in [12].However, these approaches all need excessive energy consumption, which makes them not sustainable and not conforming to the future paradigm of green communications.In addition, these approaches only offer a very limited performance when the legitimate link and wiretap link are spatially highly correlated, which makes them only applicable in limited scenarios [15].
Recently, as one of the most promising technologies towards 6G networks, reconfigurable intelligent surface (RIS) has been demonstrated to improve wireless communication security not only in a more green and cost-effective manner, but also in more widely scenarios [13].RIS is composed of a large number of passive reflective elements, each of which can reflect the incident signal with adjustable amplitude and/or phase, thus controlling the propagation environment.Since RIS does not need to decode or amplify the incident signal, it does not introduce thermal noise and consumes less energy than traditional relays, which is in line with our expectation for a higher energy efficiency in 6G networks.Moreover, RIS can provide comparable performance to beamforming using a massive antenna array at much lower cost [14].Furthermore, RIS has demonstrated its benefits in enhancing PLS.By adjusting the phase of the incident signal, we can make the reflected signal and the direct signal superimposed at Eve to realize a signal cancellation, where the received signal power at the Eve can be reduced to achieve a certain degree of security [15].
A. Related Works 1) RIS Enhanced OMA Networks: At present, the application of RIS in PLS is widely studied in [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [33], and [34].A typical example of RIS assisted PLS scheme was proposed in [16], where the channels of Eve and the legitimate user are highly correlated in space to demonstrate the ability of RIS to enhance security, and this scenario was further extended to multiple users and multiple Eves in [17].Yu et al. [18] investigated small-and large-scale RIS for secrecy performance and two kinds of algorithms were proposed for different scales.In [19], the transmit power was minimized under the secrecy constraint with the help of an RIS to demonstrate the RIS ability to enhance security while being power efficient.In addition, RIS assisted PLS was introduced to mmWave and THz networks in [20], and Lu et al. [21] maximized secrecy rate with an imperfect channel state information (CSI) of Eve for mmWave communication.Whether AN can further enhance security for RIS-assisted network was studied in [22].This was followed by additional studies that proposed to use AN/jamming to improve secrecy performance [23], [24], [25], [26], [27], [28], [29], [30].A PLS scenario was investigated in [23] where only an imperfect CSI of Eve is known at the base station (BS).Further, AN and RIS were adopted to provide secure transmission without Eve's CSI in [24].Hong et al. [25] maximized secrecy rate for single user and multiple users MIMO scenarios.In [26], transmit power was minimized considering the effect of imperfect CSI on security.Similarly, energy efficiency was optimized with an imperfect Eve's CSI in [27], and a cooperative jammer was introduced to guarantee secrecy performance.A self-sustainable RIS was proposed in [28], and AN was also adopted to counter Eve's channel uncertainty.Not satisfied with the secrecy performance of single RIS, Li et al. [29] investigated a multiple RIS assisted PLS scheme with the help of AN.In [30], different from introducing AN directly, a two way secrecy communication scheme was considered where the signal of one user was used as jamming to disturb Eve.However, it should be noted that all RISs mentioned above are used to reflect the signal.Since RIS has the ability to act as a phase shifter, there is the possibility of using RIS for modulation [31], [32], and this can also offer performance gains for PLS.In particular, Xu et al. [33] designed an RIS assisted secure communication scheme to remodulate the jamming from an attacker into the desired signal to improve the signal to interference to noise ratio (SINR) at the user.On the contrary, the useful signal was converted into jamming via RIS to interfere with Eve in [34].
2) RIS Enhanced NOMA Networks: According to existing works, there is no doubt that RIS can offer a significant improvement to the secrecy performance of wireless communication via phase shifting, which is equivalent to indirectly increasing the channel condition gap between the legitimate and wiretap communication links.This ability is appealing to NOMA, since it can take advantage of this power difference to artificially introduce differences between channels of two paired users, which can decrease the interference during SIC under the NOMA power allocation strategy [35].Therefore, RIS is expected to further improve the security of NOMA transmissions [36], [37], [38], [39], [40], [41], [42], [43], [44].The PLS of an RIS assisted NOMA network was first investigated in [36], where AN was exploited and the transmit power was minimized.In [37] and [38], internal and external Eves were considered with different CSI availabilities under RIS-NOMA, and power allocation was optimized to balance AN and the useful signal.Wang et al. [38] proposed a jamming based RIS PLS scheme for NOMA networks to resist the scenario where Eve's CSI was unknown, and the jamming was specially designed to be canceled at first by SIC at legitimate users.Furthermore, distributed RISs based secure scheme considering the statistical CSI of Eve was investigated for NOMA in [39].Gong et al. [40] analyzed the secrecy outage probability for RIS-NOMA networks.In [41], an uplink RIS-NOMA scenario was considered and a max-min fair beamforming was optimized.The average secrecy capacity was analyzed in [42] for RIS-NOMA where the RIS only served the cell-edge user.

B. Motivations and Contributions
Based on the above discussion, it is important to point out that using RIS only either for information relaying [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [36], [37], [38], [39], [40], [41], [42], [43] or jamming [33], [34] may not always guarantee secure NOMA communications, due to the following two reasons: • On the one hand, utilizing RIS for information relaying can enhance the legitimate reception quality and realize signal cancellation at Eve at the same time.However, when the exact CSI of Eve is not known, i.e., the case of imperfect Eve's CSI, this approach may even benefit eavesdropping.To this end, it is necessary to let the transmitter insert AN for intentionally confusing Eve.However, this may be impossible for situations when the transmitter does not have sufficient degrees of freedom (e.g., active antennas or radio frequency chains) to insert AN. • On the other hand, when the direct communication link between the transceivers cannot support reliable information reception (e.g., in deep fading or blockage), it is not wise to use RIS only for jamming, which will lead to a poor reception quality at receivers.Moreover, this effect becomes even worse under imperfect CSI of Eve, since in this case the RIS cannot align the jamming signal towards Eve.Hence, if the RIS can be designed more flexibly to provide both information relaying and jamming services, secure NOMA communications will be better safeguarded, especially for the case of imperfect Eve CSI.However, to the best of the authors' knowledge, such a dual-functional RIS empowered security-enhanced design for NOMA systems has not been reported in the literature yet, which thus motivates this work.
In this paper, we investigate secure NOMA communications by fully unlocking the dual-functionality of RIS, i.e., information relaying and jamming.The transmit beamforming of the BS, reflect beamforming of the RIS, and mode selection matrix of the RIS are optimized jointly to improve the system security performance.The main contributions of this paper are summarized as follows.
• We make full advantage of the RIS and propose a new simultaneous information relaying and jamming (SIRJ) scheme based on a dual-functional RIS to secure NOMA communications.Specifically, the RIS elements are divided into two parts, where elements in one part perform signal reflection to improve the reception quality at the legitimate users, and elements in the remaining part remodulate the incident signal as useful jamming to degrade the performance of Eve.The working mode of each RIS element is adaptively selected to balance between information relaying and jamming for reliability and security.
• The fundamental performance limits of the proposed SIRJ scheme is first unveiled by assuming perfect CSI of Eve.
To achieve secure and reliable NOMA communication, we aim to maximize the system sum-rate by jointly optimizing the active beamforming of the BS, the passive beamforming of the RIS, and the mode selection matrix of the RIS.Particularly, security is realized by considering the maximum tolerable information leakage to Eve.
The optimization problem is difficult to handle since there are two phase-shift matrices under the SIRJ scheme, and both of them are highly coupled with each other and with the transmit beamforming.Moreover, the existence of a non-convex binary constraint makes the problem more challenging.To overcome these obstacles, we propose a penalty based alternating optimization (AO) algorithm, where the binary constraint is converted into a penalty term, and the rank-one constraints of active and passive beamforming are solved by semidefinite relaxation (SDR) and difference-of-convex (DC) technique, respectively.• Furthermore, we consider a practical case with only imperfect CSI of Eve.In this scenario, the model for channel uncertainty of Eve is first described.However, the challenge here is that the secrecy constraint becomes an infinite number of non-convex constraints due to the channel estimation error, which makes the traditional S-procedure method inapplicable to dealing with this constraint.To this end, we propose an efficient transformation based on matrix properties to tackle this challenge, based on which a robust secure beamforming scheme is designed to combat the imperfect CSI of Eve.• We provide numerical results to demonstrate the performance advantage of the proposed SIRJ scheme and verify the efficiency of the developed optimization algorithms.
Based on these results, we reveal several important insights: 1) The proposed SIRJ scheme achieves a higher sum-rate than the existing baseline schemes where the RIS is only used for either information relaying or jamming; 2) The SIRJ scheme will split more elements to generate jamming as the channel uncertainty level becomes larger, which again demonstrates the advantage of the SIRJ scheme in terms of the dynamic adjustment of RIS elements; 3) With the SIRJ scheme, increasing the number of RIS elements can achieve a significant secrecy enhancement than increasing the number of antennas at the BS, which represents a practically cost-effective approach to enhance NOMA security.The rest of this paper is organized as follows.Section II introduces the system model and formulates the optimization problem.In Section III, we develop a penalty based AO algorithm to solve the problem with perfect CSI of Eve.A robust and secure transmission design is investigated in Section IV.In Section V, we provide numerical results and discussions.Finally, we conclude the paper in Section VI.
Notations: In this paper, boldface capital letters and lower-case letters stand for matrices and vectors, respectively.C N ×M denotes the space of N × M matrices with complex entries, and H N ×N denotes the set of N × N Hermitian matrices.I stands for the identity matrix.(•) T and Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.(•) H represent transpose and conjugate transpose.CN (µ, σ 2 ) stands for the distribution of a circularly symmetric complex Gaussian (CSCG) random variable with mean µ and variance σ 2 .Tr(•) and rank(•) denote the trace and rank operations, respectively, and vec(•) generates a column vector from sequentially stacking the columns of a matrix.X ⪰ 0 means X is a positive semidefinite matrix.The Frobenius norm of matrix and ℓ 2 -norm of vector are represented as ∥•∥ F and ∥•∥, respectively.Diag(•) stands for a vector whose elements are extracted from the diagonal of a matrix, and diag(•) denotes a diagonal matrix whose diagonal elements are extracted from a vector.Re(•) represent the real part of a complex number, and ⊗ denotes the Kronecker product.

II. SYSTEM MODEL
Consider an RIS assisted NOMA system shown as in Fig. 1, where a BS equipped with L antennas communicates with a NOMA user group consists of N single antenna users, and an illegal single antenna Eve tries to eavesdrop on this communication.The RIS with K elements is deployed to assist in the secure transmission.A controller, for example, a filed-programmable gate array (FPGA), is connected to the RIS to adjust the working mode and the phase shift of each element, and exchange information with the BS.Specifically, in this work, we unlock the full potential of the RIS to secure NOMA transmission by exploiting its dual-functionality of simultaneous signal reflection and jamming injection. 1To be specific, the entire phase shift matrix Θ at the RIS consists of two parts Θ = Θ r + Θ J , where Θ r = diag(r) is the phase shift matrix used to reflect the useful signal, and r = [ β r 1 e iϕ r 1 , . . ., β r K e iϕ r K ] H .In terms of the jamming mode elements, Θ J = Θ j Φ j , where Θ j = diag(j) is the phase shift matrix used to beamform the modulated jamming signal and j = [ β j 1 e iϕ j 1 , . . ., β j K e iϕ j K ] H . Different from 1 It is intuitive to find out that whether dividing RIS into two at different locations can bring performance gain.The reason is as follows.Although dividing RIS into two can make the jamming and signal close to the Eve and legitimate users, respectively, it is still the conventional information relaying RIS or jamming RIS for each divided RIS.However, the proposed SIRJ scheme aims to adaptively adjust the number of elements working in different modes on one RIS to balance the power of generated jamming and useful signal.In other words, whether dividing RIS into two can bring performance gain depends on whether the number of elements of each divided RIS can be adaptively adjusted according to the security requirement and the channel state information of the Eve, but this could be difficult in practice.
Θ r and Θ j , Φ j = diag(m) is the modulating matrix used to transform the incident useful signal to a jamming signal, and m = [e iϕ m 1 , . . ., e iϕ m K ] H . Here, the jamming modulation at the RIS aims to create as much randomness as pssible in the signal phase to intentionally confuse Eve, i.e., e iϕ m k is updated rapidly, independently and randomly during each symbol period, which is similar to making the signal experience a fast fading, and this makes the RIS modulating matrix fairly complicated [33], [34].It can be seen that Φ j only influences the process of generation for jamming, while Θ j influences the direction of the jamming.Therefore, compared to Φ j , Θ j is more directly related to system performance, which attracts us to concern more about the influence of the phase shift matrix Θ j on the overall secrecy performance, thus ignoring the design of modulation matrix Φ j [33], [34].In terms of the amplitude responses of the k-th element, β r k , β j k ∈ {0, 1}, ∀k ∈ K ≜ {1, 2, . . ., K}, i.e., each element either reflects signal or generates jamming, and satisfies β r k + β j k = 1 according to the law of energy conservation.Furthermore, due to the high path loss, the powers of signals reflected by the RIS two or more times are too weak, which can be practically neglected [14].We assume that all communication links are quasi-static block fading channels, i.e., the coefficient of each channel changes independently under different fading blocks but stays constant during one fading block.Meanwhile, the instantaneous CSI of all legitimate channel links are assumed to be available at the BS, where the anchor-assisted channel estimation approach can be utilized [44].For the CSI related to Eve, two cases are considered below.
• Eve is an active user but untrusted by the other NOMA users in the system, such that perfect CSI of Eve can be obtained by the BS [16], [22], [41]; • Eve prefers to hide its existence when it is an external wiretap node, and it is not expected to cooperate with the BS for CSI acquisition.Even if the BS can utilize power leakage from the local oscillator at Eve to estimate the CSI, this usually results in inaccurate and outdated CSI.Therefore, the BS can only possess the imperfect CSI of Eve [21], [23], [26], [28], [36].The transmit signal at the BS can be expressed as s = N n=1 p n x n , where x n is the signal of user n and x n ∼ CN (0, 1), p n ∈ C L×1 is the precoding vector for each user with N n=1 ||p n || 2 ≤ P t , and P t is the transmit power budget at the BS.The received signal at user n is expressed as where h rn ∈ C K×1 denotes the channel vector between user n and the RIS, h bn ∈ C L×1 denotes the channel vector between user n and the BS, H br ∈ C K×L stands for the channel matrix from the BS to the RIS, z = Θ j H br s is the reflected jamming signal vector, and w n ∼ CN (0, σ 2 0 ) is the additive white Gaussian noise (AWGN) at user n.
According to the NOMA protocol, the signal of user with weak channel gain is allocated with more power.Accordingly, SIC is performed at the receiver to process the superimposed signal, where the strong signal is decoded first by treating the weak signal as interference, and the weak signal is decoded Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
after the substraction of the strong signal.In other words, the user with strong channel gain needs to decode the signal of user with weak channel gain.However, there is no doubt that the design of the phase shift matrix at the RIS as well as the precoding vectors at the BS can change the channel gain of each user, so this order may be changed due to the joint beamforming design of the BS and RIS.Without loss of generality and to facilitate the secure transmission design, we assume that the design of Θ r makes the channel gain satisfy the condition that (h and 1 ≤ m ≤ n ≤ N .Note that for a successful SIC, the achievable rate of user n for decoding the signal of user m should be no less than the achievable rate of user m for decoding its own signal, i.e., R nm ≥ R mm for m ≤ n [35], [36], [39].
As for Eve, the received signal is expressed as where h be ∈ C L×1 denotes the channel vector between the BS and Eve, h re ∈ C K×1 denotes the channel vector between the RIS and Eve, and w e ∼ CN (0, σ2 0 ) is the AWGN at Eve. Considering the worst case, where Eve has the ability to cancel the interference from SIC, which is a widely adopted assumption in the literature of secure NOMA systems [36], [39], [45], [46], [47], i.e., the eavesdropping SINR towards the signal of user m at Eve can be written as Therefore, the achievable rate of Eve for wiretapping user m's information is

III. BEAMFORMING DESIGN WITH PERFECT CSI OF EVE
In this section, Eve is assumed to be an active user that is untrsuted in the system, hence the BS can access the complete CSI of Eve.Under this case, we first state the optimization problem, the problem reformulation process and corresponding algorithm structure are described in detail.

A. Problem Formulation
We aim to maximize the sum-rate of the legitimate users while ensuring that the information leakage to Eve is under an acceptable level, by jointly designing the active beamforming at the BS as well as the mode selection (e.g., for signal reflection or jamming generation) and the phase shift matrix at the RIS.The optimization problem is formulated as Specifically, (7b) is the maximum transmit power constraint at the BS.Constraint (7c) guarantees that a successful SIC can be performed at each user, and (7d) constrains the decoding order of legitimate users.(7e) ensures the law of energy conservation at the RIS, and constraint (7f) gives the range of reflect amplitude of each element.(7g) guarantees the network physical layer security, where τ is a predefined parameter that presents the maximum tolerable information leakage to Eve, such that the system secrecy rate can be bounded from below by , [28].Remark 1: Recall that the primary purpose of communication is to complete the information transmission with legitimate users, the proposed formulation aims to maximize the user sum-rate while satisfying a certain information leakage constraint, rather than being overly constrained by the secrecy performance of the system.In particular, the optimization problem in (7) can make the system control its expected secrecy performance via the adjustment of τ .Therefore, compared to maximizing the secrecy rate directly, the considered optimization objective can provide a higher flexibility for resource allocation, especially for different applications with heterogeneous secrecy requirements [23], [28].
However, problem (7) is intractable since not only the conventional variables Θ r and p m are coupled, but also Θ j makes this coupling even tighter, per constraints (7c), (7g) and the objective function.Meanwhile, the binary constraint (7f) makes the problem a mixed-integer non-convex problem, which makes the problem even more difficult to solve.To overcome these challenges, we split the original problem into two subproblems, where variables are the active transmit beamforming at the BS and the passive reflect beamforming at the RIS, respectively.To deal with the intractable binary constraint and rank-one constraint in the reformulated subproblems, we propose a penalty based AO algorithm, where p m and Θ r , Θ j are solved alternately by fixing the other variables Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
while punishing the solution that cannot satisfy the binary constraint and the rank-one constraint, which is described next.
Next, we define R = θ r θ H r and θ r = [r; 1], where R ⪰ 0 and rank(R) = 1, and Diag(R) = β r , where . Hence, we can rewrite constraint (7d) as where Similarly, we define J = θ j θ H j and θ j = [j; 0] where J ⪰ 0 and rank(J) = 1, and Diag(J) = β j , where where 1 ≤ m ≤ n ≤ N .Considering the monotonically increasing feature of the logarithmic function, constraint (7c) is equivalent to Next, we introduce a slack variable r nm which satisfies r nm ≤ SINR nm with 1 ≤ m ≤ n ≤ N , i.e., To solve the coupled fractional form, we adopt the arithmetic-geometric mean (AGM) inequality to transform it into where The equality holds if and only if µ nm = rnm Γ .Lemma 1: When the objective function achieves the optimum, we have R mm = log 2 (1 + r mm ).
Proof: According to (13), it is not hard to see that r mm ≤ r  Tr(H e P u H H e J), (16) where T e = 2 τ − 1 and 1 ≤ m ≤ N .
To tackle the non-convexity of the objective function, we first employ the following fundamental property of the logarithmic function Next, by using the monotonically increasing property of the logarithmic function and introducing another auxiliary variable s, we have N m=1 (1 + r mm ) where the left side of above equation is in the form of geometric mean.Next, we turn our attention to (8d  9), ( 10), ( 14), ( 15), ( 16), (18).(19b) Lemma 2: The obtained SDR solution always satisfies the rank-one condition rank(P m ) = 1 and hence is optimal.
Proof: Please refer to Appendix A.

C. Passive Reflect Beamforming
With fixed P m and following similar transformation steps as above, the subproblem of passive reflect beamforming at the RIS is reduced to max s,X,β t ,rnm s (20a) Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
s.t.(10), ( 14), ( 15), ( 16), ( 18), X ⪰ 0, X ∈ {R, J}, (20b) Diag(X) = β t , X ∈ {R, J}, t ∈ {r, j}, (20c) The remaining challenges of problem (20) lie mainly in constraints (20d) and (20f), where the rank-one constraint (20d) cannot be solved by applying SDR again similar to the active beamforming design, since the rank of the solution for problem (20) is generally large than one because of the mode selection constraint and the simultaneous optimization of Θ r and Θ j .Meanwhile, according to the proof for the tightness of the SDR for active beamforming, it relies on the rank-one of the passive beamforming matrix.Furthermore, the binary constraint (20f) is also hard to handle directly.Thus, some processing needs to be done to overcome these obstacles, which is detailed next.
In terms of the binary constraint (20f), a more normal condition is considered, i.e., β t k ∈ [0, 1], which can be written as It is clear that the equality holds if and only if β t k = 0 or 1.In other words, we need to punish β t k when it belongs to (0, 1).Thus, we add constraint (21) as a penalty term into the objective function.Also, the first-order Taylor expansion is adopted to approximate this penalty term into a convex form as follows where is the i-th iteration result.Now, problem (20) can be reformulated as s.t.(10), ( 14), ( 15), ( 16), ( 18), (20b), (20c), (20d), (20e), where ρ > 0 is the penalty factor that starts with a small value to obtain a feasible initial point, and gradually increases to make the solution satisfy the binary constraint tightly.However, problem (23a) is still a non-convex problem due to the rank-one constraint (20d).It is known that for any square matrix, we have where the equality holds if and only if rank(X) = 1.Note that ∥X∥ * = i σ i (X) to be the nuclear norm, and ∥X∥ 2 = σ 1 (X) is the spectral norm, where σ i denotes the i-th largest singular value of X. Recall that the eigenvalue equals singular value for a positive semi-definite square matrix, which suggests that ∥X∥ * = Tr(X) since Tr(X) = i λ i (X) where λ i is the i-th largest eigenvalue.Meanwhile, we use the Until Update R (1) , J (1) , β (1)   r and β (1) j with the output solutions, and ρ = ωρ, ϱ = ωϱ;

15:
Until ∥X∥ * − ∥X∥ 2 < ε 1 , and first-order Taylor expansion to approximate ∥X∥ 2 .Then, (24) can be further transformed into where T (X, , and X (i) stands for the i-th iteration result.Finally, we need to punish X if Tr(X) − T (X, X (i) ) > 0, i.e., the optimization problem is recast as s.t.(10), ( 14), ( 15), ( 16), ( 18), (20b), (20c), (20e), where R(X, X (n) ) = Tr(X) − T (X, X (n) ), and ϱ is the corresponding penalty factor.Now, problem ( 26) is a convex one which can be solved by CVX efficiently.The overall algorithm is summarized in Algorithm 1.It should be noted that, different from solving problem (19), the structure of solving problem (26) contains two layers of loops, where the inner loop ensures the convergence of the objective function, and the outer loop ensures that the obtained solution is sufficient to satisfy the binary constraint and the rank-one constraint via thresholds ε 1 and ε 2 .

D. Convergence and Complexity Analysis
Since the objective value is obtained by solving problems (19) and (26) alternately, it can be denoted as a function of the active beamforming and passive beamforming, i.e., f (P m , R, J).The steps 3-6 of Algorithm 1 ensure that f (P Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply. in the i-th iteration, and the steps 8-15 lead to f (P 1) , J (i−1) ).Therefore, we have f (P 1) , J (i−1) ), which indicates that the objective value obtained by Algorithm 1 can keep non-decreasing.Meanwhile, f (P m , R, J) is continuous over the compact feasible set of problem (26), thus the upper bound on the objective value is limited by a finite positive number [40], which guarantees the convergence of the proposed algorithm.
Since problems ( 19) and ( 26) contain only LMI, linear constraints and second-order cone (SOC) constraints, they can be solved by a standard interior point method, and the general expression of complexity is given by where p is the number of variables, Q is the number of LMIs with size c q , and V is the number of SOC with size d v [48].Hence, the complexity of Algorithm 1 can be calculated as , where i AO denotes the number of iterations for AO, and i act denotes the number of iterations for solving problem (19), while i in pas and i out pas denote the number of inner and outer iterations for solving problem (26).To be specific, p 1 = N L 2 +0.5N (N +1)+1 and p 2 = 2(M 2 + M ) + 0.5N (N + 1) + 1, V = 0.5N (N + 1), A 1 = 0.5N (N − 1) + N L + 2N + 1 and A 2 = 0.5N (N − 1) + 2N + 5M + 2, B 1 = N L 2 + 0.5N (N − 1) + 2N + 1 and B 2 = 2(M +1) 2 +0.5N (N −1)+2N +3M , C 1 = N L 3 +0.5N(N − 1) + 2N + 1 and C 2 = 2(M + 1) 3 + 0.5N (N − 1) + 2N + 3M , and D = 0.5N (N + 1).For more concise, we retain the highest order term of each variable, and the complexity of the proposed algorithm comes to Remark 2: The proposed scheme can be extended to the multi-eavesdropper case easily.When there are multiple eavesdroppers in the system, each eavesdropper has a eavesdropping rate for each legitimate user's signal.However, the secrecy constraint can still ensures that the beamforming design satisfies the secrecy requirement of the system.It can be seen from the transformation result (16) of the secrecy constraint, multiple eavesdroppers means increased number of secrecy constraints.Although this will significantly reduce the feasible domain of the original optimization problem, the proposed algorithm can still be applied in this scenario.

E. Extension to Discrete Phase
It is difficult to continuously adjust the phase of RIS in practice.In order to investigate the performance of discrete phase shifts, a uniform quantized phase-shift feasible region is required.In particular, where k ∈ K = {1, 2, • • • , K}, and b stands for the number of quantization bits.Based on this, the discrete phase shift solution can be obtained from the continuous phase shift solution of Algorithm 1. Specifically, where ϕ is the discrete phase shift solution, and ϕ r(j),opt k is the continuous phase shift solution obtained from Algorithm 1.

IV. ROBUST BEAMFORMING DESIGN WITH IMPERFECT CSI OF EVE
In this section, Eve is assumed to be a passive external eavesdropper that prefers to hide its existence.Thus, the BS can only obtain its partial CSI via, for example, the power leakage at Eve.Under this scenario, a robust beaforming design is necessary to counter the channel uncertainty of Eve.Hence, this uncertainty is modeled at first, and then, we focus on dealing with secrecy constraint which translates to an infinite number of non-convex constraints due to the channel uncertainty of Eve.Note that since the RIS elements work in different modes, which makes the conventional S-procedure not directly applicable.This poses another significant challenge for robust beamforming designs.Thus, an effective transformation is proposed to deal with this challenging problem, which is detailed in the following.

A. Channel Uncertainty Modeling
For modeling Eve's channel uncertainty, we adopt the norm-bounded CSI error model, where the CSI error is bounded in a region defined by norm, and this model has been widely used in the literature, e.g., [23], [26], [27], [28], [36], and [48].In particular, the CSI of the direct link between the BS and Eve is modeled as where ĥbe is the estimated CSI of the Eve, and ∆h be stands for the CSI estimation error lying in a continuous set Ω be , which is norm-bounded by δ be ≥ 0, involving all possible CSI estimation errors, and the parameter δ be represents the level of channel uncertainty.Similarly, we can model the CSI of the cascaded RIS link between the BS and Eve as Based on (31) and (32), we can obtain the uncertainty model of the equivalent channel H e between the BS and Eve, i.e., Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
where the estimation error and uncertainty level are given by ∥∆H e ∥ F = ∥∆G e ∥ 2 F + ∥∆h be ∥ 2 and δ e = δ 2 re + δ 2 be , respectively.

B. Robust Beamforming Design
Under this scenario, we follow similar steps as in Section III for the problem reformulation and algorithm structure.Specifically, we decompose the original problem into two subproblems, and optimize active transmit beamforming and passive reflect beamforming alternately, while converting the binary constraint and the rank-one constraint into penalty terms.However, the difference is the secrecy constraint (7g) in the original problem.Particularly, the robust active transmit beamforming subproblem is formulated as s.t.(8c), ( 9), ( 10), ( 14), ( 15), ( 18), (34b) According to the channel uncertainty model, it is not difficult to see that (34c) contains infinite constraints.To handle this challenge, the S-procedure is a commonly used and effective method [23], [27], [28], [36], [48].To apply this powerful method to our problem, some mathematical processing needs to be performed, as described next.
First, we define h e = vec(H H e ).Then, we exploit the following two matrix identities, i. where The implication f 1 (x) ≤ 0 ⇒ f 2 (x) ≤ 0 holds if and only if there exists a nonnegative γ that satisfies where there exists x such that f 1 (x) ≤ 0.
Now, Algorithm 1 proposed in Section III can be adopted to solve problem (41) and problem (42) alternately for the robust beamforming design.

V. NUMERICAL RESULTS
In this section, we provide numerical results to demonstrate the secrecy performance enhancement of our proposed SIRJ scheme as well as the joint beamforming design.For channel model, we assume Rician fading for the channels related to the RIS, given by where i ∈ {e, n}, λ 0 denotes the path loss at the reference distance of 1 meter, d br , d re , and d rn denote the link distances, α br , α re , and α rn stand for the pass loss exponents, and K br , K re , and K rn represent the Rician factors.(•) LoS denotes the deterministic line-of-sight (LoS) component and (•) NLoS denotes the non-line-of-sight (NLoS) component.For the direct link between the BS and user n/Eve, Rayleigh fading is assumed such that where α be and α bn are the path loss exponents.The locations of the BS, RIS and Eve are set as (0, 10), (60, 10) and (50, 0) respectively.The NOMA users are randomly distributed in a circle whose center is located at (60, 0) with a radius of 5 m.In terms of the imperfect Eve's CSI, we define the CSI error bound as δ e = ξ∥H e ∥ F , where ξ ∈ [0, 1) stands for the relative amount of CSI uncertainty [36], [50], [51].The simulation parameters are given in Table I, and each point is averaged by 100 channel realizations.
Fig. 2 shows the convergence of the proposed algorithm when the CSI of Eve is perfectly and imperfectly known.It can be observed that both two subproblems converge to a stationary point within few iterations, which guarantees the overall algorithm convergence.Furthermore, problems (26) and (42) can achieve a larger value based on the solution of problems ( 19) and (41), which demonstrates the accuracy of our convergence analysis and the efficiency of the developed AO algorithm.
In Figs. 3 and 4, we compare the proposed SIRJ scheme with other baseline schemes: • SIRJ based OMA (SIRJ-OMA): In this scheme, users served by the BS equally share the overall spectrum resource, where the bandwidth of each user is 1/N .• Conventional information relaying RIS (r-RIS): In this scheme, all RIS elements are used to reflect the incident signal.
• Conventional jamming RIS (j-RIS): The RIS elements are all set to convert the incident signal into jamming to confuse the Eve.• Without RIS (WoR): There is no RIS deployed and only the transmit beamforming of the BS is optimized.
It can be observed from Fig. 3 that the performance of SIRJ-NOMA is similar to that of r-RIS, but the performance gain is remarkable in Fig. 4. The reasons are as follows.When perfect CSI of Eve is available at the BS, for both the BS and RIS, they only need to keep the beam away from the direction of Eve and concentrate the signal power in the directions of users, which makes SIRJ-NOMA not much different from r-RIS, implying that nearly all RIS elements are used for signal reflection.However, as transmit power becomes large, SIRJ-NOMA begins to use a small number of elements to remodulate the incident signal as jamming to ensure that the secrecy constraint is satisfied, such that SIRJ-NOMA can offer a higher sum-rate than that of r-RIS.When the BS has only imperfect CSI of Eve, its position cannot be determined exactly.In this case, the secrecy constraint is difficult to meet, and r-RIS will reflect a part of the signal in the direction of Eve to perform signal cancellation, which reduces the received signal power at the legitimate users.Moreover, since the exact position of Eve cannot be known, this approach may not achieve an ideal signal cancellation, resulting in a waste of signal power and even an increased received signal power at Eve.However, SIRJ-NOMA is quite different.Since the jamming signal generated by the RIS is reflected in the direction of Eve, and jamming can play an important role in degrading the performance of Eve.Therefore, the proposed SIRJ scheme offers a significant performance gain under imperfect CSI of Eve.
However, this does not mean that using all RIS elements to generate jamming can achieve a much better performance.In Fig. 3, it can be seen that j-RIS provides a much smaller sum-rate compared to SIRJ-NOMA and r-RIS.This is because  j-RIS cannot reflect the legitimate signal, and too much jamming significantly degrades the reception quality of legitimate users.Especially for the case with perfect CSI of Eve, no jamming is needed.In Fig. 4, although j-RIS brings a higher sum-rate compared to r-RIS as transmit power increases since jamming can make the secrecy constraint easier to satisfy, and too much jamming in the system even makes the sum-rate of j-RIS decrease.However, SIRJ-NOMA performs much better than j-RIS under both CSI conditions, due to the fact that it is able to adaptively select the working mode of each RIS element, which makes RIS not only confuse Eve, but also enhance signal transmission and keep the jamming power under an acceptable level but meet the security requirement.
For SIRJ-OMA, since users equally divide the frequency band, the achievable rate of each user is lower than that of NOMA where users share the same spectrum resource, and thus SIRJ-OMA cannot provide a sum-rate as high as the proposed SIRJ-NOMA scheme in Figs. 3 and 4. In Fig. 3, WoR is similar to j-RIS, since the useful signal only comes from the BS.But in Fig. 4, the jamming in j-RIS may affect users more, which results in a little worse performance than WoR.Moreover, since there is no need to split a part of the transmit power for signal cancellation at Eve, WoR can achieve even better performance than r-RIS with a high transmit power.The reason behind this observation is that the conventional RIS has only a single functionality, while the proposed SIRJ-NOMA has dual functionalities that can be adjusted to provide a high sum-rate and achieve secure NOMA communication with a controllable cost.It can be also observed that r-RIS is slightly better than SIRJ-NOMA with a low transmit power in Figs. 3 and 4, which is due to the binary constraint.In Algorithm 1, we set a convergence threshold to make the reflection amplitude close to 1.In other words, it cannot be exactly equal to 1, but this is realistic.While for r-RIS, the reflection amplitude constraint is usually set to 1, which provides a performance upper bound.
We compared the performance of different optimization methods in Fig. 5, including SDR with Gaussian Randomization (GR) method in [16], and Ring Penalty (RP) method in [40].It can be seen that as the transmit power increases, there is a gap between three methods.In terms of GR, it randomly generates a large number of vectors that obey the CSCG distribution, and selects the vector closest to the optimization result as an alternative solution.Because of the large randomness, the performance of GR is slightly worse among the three.As for RP, its core is unit modulus constraint according to [40].Compared to GR, it is closely related to the original rank-one constraint, which leads to a better performance.However, as for the DC method adopted by this paper, the rank-one constraint is converted into a equivalent constraint on the basis of the matrix property, for example, inequality (24), which maintains a more closer relationship with the original rank-one constraint, so the performance is the best among the three.
In Fig. 6, we investigate the impact of discrete phase on the system performance and its relation with the continuous phase.It can be observed that the performance loss caused by discrete phase becomes smaller with the quantization bits increase, and it comes to around 0.3% with 4-bit quantization.Different from the conventional single functional RIS, SIRJ needs to control the beam of signal and jamming at the same time, so more quantization bits are required.
In Fig. 7, we investigate the impact of different CSI uncertainties on the sum-rate.It can be seen that the performance is the best when the CSI of Eve is completely known.However, as the CSI uncertainty increases, the system sum-rate becomes smaller.This is because the increased channel uncertainty makes it more difficult to satisfy the secrecy constraint, which decreases the received signal power at users.This can be seen more clearly from Fig. 8, where the number of Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.RIS elements in each working mode is plotted.We observe that more RIS elements are used to convert the incident signal into jamming to counteract the influence of channel uncertainty.This, in turn, demonstrates the efficiency of our SIRJ scheme that can adaptively adjust the working mode of each RIS element according to different communication requirements.
Fig. 9 shows the effect of the number of RIS elements and BS antennas on the sum-rate.As the number of RIS elements increases, the SIRJ scheme can provide higher degrees of freedom not only for signal reflection but also for jamming, which leads to an increased sum-rate.Similarly, increasing the number of BS antennas can also benefit the sum-rate.It is worth noting that the improvement from N = 3 to N = 4 is less than that from N = 2 to N = 3 under the two CSI conditions.This is because fixing the number of elements on RIS also fixes the degree of freedom, i.e., increasing the number of antennas at the BS can only improve the receiving quality of the direct link.In other words, when the gain brought by the number of antennas is saturated, increasing the number of RIS elements can still continue to improve the system.Although the performance gain brought by 1 antenna is equivalent to 5 to 10 elements, taking into account the difference in cost between the antennas and the elements, increasing the number of elements on RIS provides us with an efficient and cost-effective approach to enhance the system performance.

VI. CONCLUSION
In this paper, we proposed a new SIRJ scheme using a dual-functional RIS to improve physical layer security of NOMA systems, where the working mode (e.g., reflecting or remodulating incident signal as jamming) of each RIS element can be adaptively selected to enhance the reception quality of the legitimate users while degrading the performance of Eve.The transmit beamforming of the BS, reflect beamforming of the RIS, and mode selection matrix of the RIS were jointly optimized to maximize the system sum-rate, where two CSI conditions related to Eve were considered.In the case of perfect CSI, a penalty based AO algorithm was developed to tackle the challenging mixed integer non-convex optimization problem.Under the imperfect CSI condition, we concentrated on dealing with the infinite number of secrecy constraints, and devised some effective mathematical processing methods to apply the S-procedure.Simulation results reveal that our proposed SIRJ scheme can achieve a better performance than the existing baseline schemes.Furthermore, a stable performance improvement can be achieved by increasing the number of RIS elements rather than the number of BS antennas.
This work can be extended to several scenarios.For example, the proposed SIRJ strategy can be combined with wireless information and energy/power transmission, where the element
mm = SINR mm .While from the objective function, we can obtain the following lower bound on the user sum-rate, N m=1 R mm ≥ N m=1 log 2 (1+r mm ), which is monotonically increasing with r mm .Hence, the objective function reaches the optimum when r mm = r [max] mm = SINR mm .Based on Lemma 1, constraint (7c) becomes e., Tr(A H B) = vec H (A)vec(B) and vec(ACB) = (B T ⊗A)vec(C).Finally, rearrange constraint (34c) as followsh H e (R T ⊗ P m ) − T e J T ⊗ N u=1 P u h e − T e σ 2 0 ≤ 0,(35)where 1 ≤ m ≤ N , and h e = ĥe + ∆h e .Considering the calculation of the Frobenius norm and the ℓ 2 -norm, ∆h e and ∆H e share the same uncertainty level that ∥∆h e ∥ ≤ δ e .More precisely, we rewrite the above inequality as ∆h H e Φ m ∆h e + 2Re{ ĥH e Φ m ∆h e } + ĥH e Φ m ĥe − T e σ 2 0 ≤ 0,

Fig. 7 .
Fig. 7. Sum rate versus the transmit power under different CSI uncertainties of the Eve with L = 2, N = 2, and K = 30.
(2)der this case, user n needs to decode the signals from user 1 to user n − 1 in this order.Based on the above decoding order, the SINR of user n for decoding user m's signal is(2), as shown at the bottom of the next page, where m ≤ n.If m = n, the result reduces to the SINR of user m for decoding its own signal.Hence, the achievable rate of user n for decoding the signal of user m is ρ, ϱ, and set i = 1;