## 4 Proposed mmWave Assisted CR-IoV
### Dual Step Security Provisioning
#### 4.3.3 Mathematical Model of FA-TDoA  
The FA-TDoA uses a trilateration technique in which three reference receivers are considered. Here, the signal source is unknown and the objective is to detect the location of the unknown source. The range difference between receivers can be obtained as,  
\[RD_{i,j}=\mathbb{C}\times d_{i,j}=RD_{i}-RD_{j} \tag{8}\]  
Here, \(\mathbb{C}\) is the signal propagation speed and \(d_{i,j}\) is the TDoA between receivers \(i\) and \(j\). Consider the unknown source location as \([x_{u},y_{u}]\) and the known reference receiver location as \([x_{i},y_{i}]\). The distance between source and \(i\)th receiver is given as,  
\[d_{u,i}=\sqrt{(x_{i}-x_{u})^{2}+(y_{i}-y_{u})^{2}} \tag{9}\]  
Thus, the range difference is updated as follows,  
\[RD_{i,1}=\sqrt{\left(x_{i}-x_{u}\right)^{2}+\left(y_{i}-y_{u}\right)^{2}}-\sqrt {\left(x_{1}-x_{u}\right)^{2}+\left(y_{1}-y_{u}\right)^{2}} \tag{10}\]  
Here, \(x_{1},y_{1}\) is the location of the first receiver, also known as the reference receiver. For determining the unknown location, the above non-linear equation must be linearized. For that, the fang algorithm linearizes the equation by fixing one of the reference receivers at the origin. In FA-TDoA, the reference receivers form a coordinate system. As shown, we have one of the receivers at the origin, the coordinate becomes \([x_{1}=0,y_{1}=0]\), \([x_{2}=x_{2},\ y_{2}=0]\) and \([x_{3},y_{3}]\). The equations can be simplified as,  
\[RD_{1}=\left[(x_{1}-x_{u})^{2}+(y_{1}-y_{u})^{2}\right]=\left[x_{U}^{2}+y_{U}^ {2}\right]^{1/2} \tag{11}\]  
\[x_{i,1}=x_{i}-x_{1}=x_{i} \tag{12}\]  
\[y_{i,1}=y_{i}-y_{1}=y_{i} \tag{13}\]Applying the above equations in Equation (10) provides the following expression,  
\[2 RD_{2,1}RD_{1}=RD_{2,1}^{2}-x_{2}^{2}+2x_{2,1}^{2}x_{u} \tag{14}\]  
\[2 RD_{3,1}RD_{1}=RD_{3,1}^{2}-\left(x_{3}^{2}+x_{3}^{2}\right)+2x_{3,1}x_{u}+2y_{ 3,1}y_{u} \tag{15}\]  
By equating Equations (14) and (15), we can obtain the following result,  
\[y_{u}=gx_{u}+h \tag{16}\]  
where, \(g=\left\{\left(\frac{RD_{3,1}x_{2}}{RD_{2,1}}\right)-x_{3}\right\}/y_{3}\). \(\quad\) and \(h=\left\{x_{3}^{2}+y_{3}^{2}-RD_{3,1}^{2}+RD_{3,1}x_{u}RD_{2,1}\left(1-\left( x_{2}/RD_{2,1}\right)^{2}\right)\right\}/2y_{3}\). \[dx_{u}^{2}+ex_{u}+f=0 \tag{17}\]  
\(\quad\) Here, \(d=-\left\{\left(1-\left(\frac{x_{2}}{RD_{2,1}}\right)^{2}\right)+g^{2}\right\}\), \(e=x_{2}\times\left\{\left(1-\left(\frac{x_{2}}{RD_{2,1}}\right)^{2}\right) \right\}-2 gh\), and \(f=\left(\frac{RD_{2,1}^{2}}{4}\right)\times\left\{\left(1-\left(\frac{x_{2}} {RD_{2,1}}\right)^{2}\right\}-h^{2}\). From Equations (16) and (17), we can obtain the location of an unknown signal source as \([x_{u},y_{u}]\). Once the signal source's location is determined, that location is compared with PU's original location. If both locations are matched, then the signal source is PU; else, the signal is emitted by the PUE attacker. In this manner, the signal source is validated based on the location calculation. In proposed dual-step security provisioning, the first step detects the SSDF and PUE attackers presented in the network based on the sensing report and location, respectively. To further improve the accuracy, we then validate the certificates of the SUs to ensure that only legitimate SUs are participating in the network. In this work, the digital certificates tie the digital signature of each SU, which is generated by the Four Q-Curve algorithm. After the attack detection step, the CBS validates the signature of all SUs by the Four Q-Curve algorithm. Here, we have used the Four Q-Curve algorithm because it is lightweight and faster than other signature algorithms [53]. Presenting Four Q-Curve signature makes certificate generation and validation fast. Each vehicle has two secret keys, including a public key (\(Pu_{k}\)) and a private key (\(Pv_{k}\)) which are used in signature validation and generation, respectively. The process of signature validation is performed as follows,  
1.