Introduction {#Sec1}
============

Quantum key distribution (QKD) is one of the advanced technology to date, and the security of the shared keys is guaranteed by the quantum mechanics^[@CR1]--[@CR5]^. Allowing two authenticated parties to establish secret keys in an insecure channel, QKD provides a secure way.  In the discrete-variable quantum key distribution (DVQKD), several significant achievements have been achieved^[@CR6]--[@CR12]^. For implementing DVQKD, Pan *et al*.  has launched a low-Earth-orbit satellite, with key rate around 20 orders of magnitudes greater than optical fiber^[@CR13]^. For decades, continuous-variable quantum key distribution (CVQKD) without the requirement of single-photon detection, has made significant progress of QKD research^[@CR14]--[@CR16]^. However, there is a fundamental limit on the maximum number of secret bits that can be generated by two remote parties.  This limit is the secret key capacity of the lossy channel, which also known as the PLOB bound^[@CR17]^. In this general context, Gaussian-modulated coherent state (GMCS) protocol has been experimentally achieved both in long distance and high speed^[@CR18]--[@CR21]^. Moreover, the protocol has already proved secure in the asymptotic regime^[@CR22],[@CR23]^ and finite-size regime^[@CR24],[@CR25]^. To be specific, the signal pulses and local oscillator (LO) pulses are simultaneously prepared by Alice in the GMCS protocol.  In other words, the LO is deemed as a fixed phase reference for the signal detection, which can reduce the phase noise. 

Nevertheless, the transmission of the LO brings about several limitations^[@CR26]--[@CR29]^. Firstly, the LO may be controlled and modified by eavesdropper.  Eve may launch attacks by manipulating the LO, such as LO fluctuation attacks^[@CR30]^, calibration attacks^[@CR31]^, saturation attacks^[@CR32]^ and wavelength attacks^[@CR28],[@CR33]^. Secondly, the complicated techniques of multiplexing and de-multiplexing are necessary to transmit and separate the two pulses, respectively.  Thirdly, sending the strong LO pulses can reduce the transmission efficiency.  In order to solve these problems, self-reference CVQKD protocols are proposed, which can generate the LO locally at Bob's side.  Besides, several protocols have been proposed to solve the flaws of phase drift in the self-reference CVQKD protocol^[@CR34]--[@CR36]^.

Recently, Qin *et al*.  formalize an attack strategy; Eve cuts down the quantum channel and inserts an external light into the self-reference CVQKD system^[@CR37]^. However, the countermeasure for this attack is proposed in the reference^[@CR38]^. Shengjun *et al*.  propose a reference pulse attack, which can exploit the phase estimation error associated with the reference pulses to attack the self-reference CVQKD protocol^[@CR39]^. Besides, Pereira *et al*.  consider an attack on a coherent-state protocol; Eve not only taps the main communication channel but also hacks AliceâĂŹs device^[@CR40]^. Nevertheless, there are some defects in theoretical analysis and it is hard to achieve.  Inspired by side channel attack, we formalize the attack strategy for discrete-modulated and Gaussian-modulated self-reference CVQKD, respectively.  The attack works as follows: Eve increases her amount of beam splitter attack on the quantum signal, which inevitably increasing the excess noise.  Before the beam splitter attack, she utilizes the intercept-resend attack and the Bayesian algorithm to decrease the phase estimation error noise.  Therefore, Eve can bias the excess noise due to the beam splitter attack and the intercept-resend attack, and Alice and Bob believe their excess noise estimation is below the null key threshold and they can still share a secret key.  To intercept-resend attack, that is, Eve can monitor and intercept the reference pulses emitted by Alice.  Subsequently, she measures each reference pulse and then estimates the phase drift using the Bayesian algorithm.  After phase estimation and compensation operation, she re-prepares and resubmits another reference pulses, which is sent to Bob.  What's more, we propose to utilize Bayesian algorithm to estimate the reference pulses.  The algorithm not only can obtain a confidence interval, but also has robustness to noise.  Therefore, the algorithm can increase the accuracy of phase estimation for Eve.  This series of operations can cause a security vulnerabilities through the manipulation of the reference pulses. 

Practical Security Analysis {#Sec2}
===========================

In this section, we start by describing the protocol of the self-reference CVQKD.  Subsequently, we analyze how Eve can intercept the reference pulses and estimate the phase drift for the discrete-modulated and Gaussian-modulated self-reference CVQKD, respectively.  The self-reference CVQKD protocol, as shown in Fig.  [1](#Fig1){ref-type="fig"}, consists of two parts, one is the coherent states preparation and propagation, and the other part is the coherent states detection and processing.  At the transmitter, Alice prepares the Gaussian-modulated coherent states (or the discrete-modulated states) and then transmits to Bob.  The arbitrary phase drift of the states will be inevitably induced through the quantum channel.  Therefore, the phase reference pulses are necessary to transmit along with the signal pulses.  As depicted in Fig.  [1](#Fig1){ref-type="fig"}, the reference pulses and signal pulses are sent by Alice alternatively and periodically.  At the receiver, Bob can utilize the relatively strong reference pulses to estimate the phase^[@CR35]^. In theory, quantum phase noise $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta \varphi $$\end{document}$ between the two users can be written as^[@CR41]^$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta \varphi \approx \frac{2\pi }{s}\Delta vL,$$\end{document}$$ where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$L$$\end{document}$ represents the length of the fiber, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta v$$\end{document}$ is the difference frequency between the user's lasers, and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$s$$\end{document}$ denotes the speed of light in the fiber.  Although several protocols are proposed to the phase compensation, the strong reference pulses are still indispensable in the self-reference CVQKD.  However, propagating the relatively strong reference pulses may result in security vulnerabilities. Figure 1The self-reference CVQKD protocol.  Alice sequentially sends reference pulses and signal pulses.  At the receiver, Bob uses its own LO pulses to perform coherent detection.  Here, LO represents the local oscillator. 

In what follows, we analyze the practical security of reference pulses for CVQKD with discrete modulation.  In this scenario, Eve has the ability to monitor and intercept the reference pulses from Alice to Bob.  Basically, Eve measures each reference pulse and estimates the phase drift emitted by Alice.  After the phase compensation, she re-prepares and resubmits reference pulses, which are sent to Bob.  Next, we introduce how Eve employs Bayesian algorithm to estimate the phase drift of the intercepted reference pulses.  Without loss of generality, we analyze the four-state self-reference CVQKD protocol^[@CR42]--[@CR44]^. The four-state can be denoted as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\left|\,{\alpha }_{k}\right\rangle =\left|\,\alpha {e}^{i(2k+1)\pi /4}\right\rangle $$\end{document}$ with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$k\in \{0,1,2,3\}$$\end{document}$, and the modulation variance is $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$V=1+2{\alpha }^{2}$$\end{document}$. When Eve intercepts reference pulses through the noisy channel, as shown in Fig.  [2](#Fig2){ref-type="fig"}, the photon number resolving detector (PNRD) performs the measurement operation.  Specifically, the measurement outcomes are denoted as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$ {\mathcal E} \in \{\left|\,{\alpha }_{0}\right\rangle ,\left|\,{\alpha }_{1}\right\rangle ,\left|\,{\alpha }_{2}\right\rangle ,\left|\,{\alpha }_{3}\right\rangle \}$$\end{document}$, and the total number of detected photons are described as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr E}={\sum }_{i=0}^{3}{n}_{i}$$\end{document}$, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{i}$$\end{document}$ symbolizes the detected photon of state $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\left|\,{\alpha }_{i}\right\rangle $$\end{document}$. Then, we provide the critical process of Bayesian estimation.  Above all, in order to estimate the correct eigenphase, an initial prior probability distribution $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\varphi )$$\end{document}$ is provided to express the confidence interval that the current hypotheses is the correct eigenphase.  Subsequently, the mean $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\mu $$\end{document}$ and its standard derivation $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\sigma $$\end{document}$ are updated on the basis of the measurement results of PNRD.  What's more, the posterior probability distribution can be calculated as^[@CR45],[@CR46]^$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\varphi |  {\mathcal E} )=\frac{{\mathscr P}( {\mathcal E} | \varphi ){\mathscr P}(\varphi )}{\int {\mathscr P}( {\mathcal E} | \varphi ){\mathscr P}(\varphi ){\rm{d}}\varphi }.$$\end{document}$$ Specifically, some particles drawn from the $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\varphi )$$\end{document}$ mismatch the likelihood function, which will be discarded later.  The likelihood function is defined as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\left|\,{\alpha }_{0}\right\rangle | \varphi )=\frac{1}{4}(1+{e}^{-{\Delta }^{2}}\cos (\varphi ))$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\left|\,{\alpha }_{1}\right\rangle | \varphi )=\frac{1}{4}(1+{e}^{-{\Delta }^{2}}\sin (\varphi ))$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\left|\,{\alpha }_{2}\right\rangle | \varphi )=\frac{1}{4}(1-{e}^{-{\Delta }^{2}}\cos (\varphi ))$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\left|\,{\alpha }_{3}\right\rangle | \varphi )=\frac{1}{4}(1-{e}^{-{\Delta }^{2}}\sin (\varphi ))$$\end{document}$. Without loss of generality, the qubit undergoes a phase diffusion process whose amplitude is characterized by the parameter $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta $$\end{document}$. After obtaining the posterior distribution in Eq.  [2](#Equ2){ref-type=""}, we set the posterior probability distribution to equal the prior probability distribution.  This updating program can be deemed as the iterative processing for each of the emulation. Figure 2The practical security analysis of reference pulses for the CVQKD protocol with discrete modulation.  CW laser, continuous wave laser; BS, beam splitter; PD, photodetector; VOA, variable optical attenuator; PBS, polarizing beam splitter; Att.,  attenuator; PNRD, photon number resolving detector; DL, delay line; PC, polarization controller; AM-PM, amplitude and phase modulation. 

Subsequently, we provide the mathematical definition of probability density function (PDF) to illustrate the relation between the phase shift and the detected photons $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr E}$$\end{document}$. The PDF is defined as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\mathscr P}}_{B}(\varphi ;{\mathscr E})=\frac{{\sum }_{i=0}^{3}{\mathscr P}{(\left|{\alpha }_{i}\right\rangle | \varphi )}^{{n}_{i}}}{ {\mathcal M} }$$\end{document}$, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$ {\mathcal M} $$\end{document}$ is the normalization factor satisfies with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\int }_{0}^{2\pi }{{\mathscr P}}_{B}(\varphi ;{\mathscr E}){\rm{d}}\varphi =1$$\end{document}$. The simulation results of phase drift are depicted in Fig.  [3](#Fig3){ref-type="fig"}.  The two subgraphs illustrate that, the phase drift tends to zero if we increase the number of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{0}$$\end{document}$ (where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{1}$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{2}$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{3}$$\end{document}$ are constant).  Here, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{i}$$\end{document}$ is defined in the previous paragraph.  Consequently, increasing the detected photons for intercepted reference pulses can improve the accuracy of phase estimation, thus reducing the possibility of phase shift.  Next, we describe the main implementation steps of the Bayesian algorithm.  In the initial interation of the algorithm, a prior distribution $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr E}({\mu }_{0},{\sigma }_{0})$$\end{document}$ is to express the confidence interval.  Then, the dataset is utilized to update the $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\mu $$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\sigma $$\end{document}$ of the posterior probability distribution in accordance with Bayes' theorem.  The parameter estimation for the inferred $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\sigma }^{2}$$\end{document}$ of the posterior probability density is simulated in Fig.  [4a](#Fig4){ref-type="fig"}, and the shaded region stands for the proportion correct ratio of the predicted trials.  In other words, increasing the signal intensity level can improve the proportion correct of concentration.  As shown in Fig.  [4b](#Fig4){ref-type="fig"}, we utilize the different initial $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\sigma }^{2}$$\end{document}$ to simulate and test that the performance is insensitive to the initial $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\sigma }^{2}$$\end{document}$. In other words, the Bayesian algorithm has the high robustness.  Furthermore, the main steps of the algorithm^[@CR45],[@CR47],[@CR48]^ are described in the Appendix. Figure 3Probability density function (PDF) versus the phase drift. Figure 4(**a**) The prediction model.  A set of data points are performed in the simulation to estimate the phase variance by Bayesian phase estimation algorithm. (** b**) The parameter procedure with the different $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\sigma }^{2}$$\end{document}$.

By comparison to the discrete-modulated CVQKD protocol, the Gaussian-modulated CVQKD protocol is more complicated.  We adopt the Mach-Zehnder (MZ) interferometer to estimate the phase drifts^[@CR49]--[@CR53]^. The Mach-Zehnder interferometer, as shown in Fig.  [5](#Fig5){ref-type="fig"}, has two inputs labelled $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$1$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$2$$\end{document}$, one input is the intercepted reference pulses, and the other is the coherent light source.  The two inputs are combined in two beamsplitters ($\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$B{S}_{1}$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$B{S}_{2}$$\end{document}$) and two internal arms.  On the one of the branches for output, a beamsplitter ($\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$B{S}_{3}$$\end{document}$) has two outputs labelled as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$3$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$4$$\end{document}$. On the other branch, a beamsplitter ($\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$B{S}_{3}$$\end{document}$) has two outputs labelled as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$5$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$6$$\end{document}$. According to the mentioned above, photodetectors are applied to outputs and respond to intensities $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${I}_{k}$$\end{document}$. Therefore, we integrate over some observations $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$T$$\end{document}$, and define the parameter $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${W}_{k}={\int }_{T}{I}_{k}\,{\rm{d}}t$$\end{document}$ with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$k\in \left\{3,4,5,6\right\}$$\end{document}$. Particularly, the parameter $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${W}_{k}$$\end{document}$ can be substituted by the integer $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{k}$$\end{document}$, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${n}_{k}$$\end{document}$ represents the photodetection result in the time interval $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$T$$\end{document}$. Based on the NFM theory (Noh, Fougères and Mandel)^[@CR51]^, the unambiguous value of phase $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\varphi $$\end{document}$ is estimated as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\cos \varphi =\frac{{n}_{3}-{n}_{4}}{{\left[{({n}_{3}-{n}_{4})}^{2}+{({n}_{5}-{n}_{6})}^{2}\right]}^{1/2}}\,,\,\sin \varphi =\frac{{n}_{5}-{n}_{6}}{{\left[{({n}_{3}-{n}_{4})}^{2}+{({n}_{5}-{n}_{6})}^{2}\right]}^{1/2}}.$$\end{document}$$ When the photon number $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{{\rm{in}}}$$\end{document}$ at input $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$1$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$2$$\end{document}$ is determined, the outputs $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$3\, \sim \,6$$\end{document}$ have the mean values $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{3}={\bar{n}}_{{\rm{in}}}(1+V\cos \varphi )$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{4}={\bar{n}}_{{\rm{in}}}(1-V\cos \varphi )$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{5}={\bar{n}}_{{\rm{in}}}(1+V\sin \varphi )$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{6}={\bar{n}}_{{\rm{in}}}(1-V\sin \varphi )$$\end{document}$, where the maximum likelihood estimate can be given by $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\widehat{V}=\sqrt{(\frac{{n}_{3}-{n}_{4}}{{n}_{3}+{n}_{4}})+{(\frac{{n}_{5}-{n}_{6}}{{n}_{5}+{n}_{6}})}^{2}}.$$\end{document}$$ Consequently, based on the Poissonian distribution of photoncount and mean value $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{{\rm{in}}}$$\end{document}$, the likelihood of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\varphi $$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{{\rm{in}}}$$\end{document}$ is $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}({\bf{n}}| \varphi ,{\bar{n}}_{{\rm{in}}})\propto {\left({\bar{n}}_{{\rm{in}}}\right)}^{\sum {n}_{k}}{{\rm{e}}}^{-2{\bar{n}}_{{\rm{in}}}}{(1+V\cos \varphi )}^{{n}_{3}}{(1-V\cos \varphi )}^{{n}_{4}}{(1+V\sin \varphi )}^{{n}_{5}}{(1-V\sin \varphi )}^{{n}_{6}},$$\end{document}$$ with the notation $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bf{n}}=\left[{n}_{3},{n}_{4},{n}_{5},{n}_{6}\right]$$\end{document}$. Assuming that $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{{\rm{in}}}$$\end{document}$ is independent of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\varphi $$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$V$$\end{document}$, we have $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}({\bf{n}}| \varphi )=\int {\mathscr P}({\bf{n}}| \varphi ,{\bar{n}}_{{\rm{in}}}){\mathscr P}({\bar{n}}_{{\rm{in}}}){\rm{d}}{\bar{n}}_{{\rm{in}}}\propto {(1+V\cos \varphi )}^{{n}_{3}}{(1-V\cos \varphi )}^{{n}_{4}}{(1+V\sin \varphi )}^{{n}_{5}}{(1-V\sin \varphi )}^{{n}_{6}}.$$\end{document}$$ Consequently, the posterior probability distribution takes the following form $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\mathscr P}(\varphi | {\bf{n}})=\frac{{\mathscr P}({\bf{n}}| \varphi ){\mathscr P}(\varphi )}{\int {\mathscr P}({\bf{n}}| \varphi ){\mathscr P}(\varphi ){\rm{d}}\varphi },$$\end{document}$$ which is in accordance with the Eq.  [2](#Equ2){ref-type=""} of four-state self-reference CVQKD protocol. Figure 5The practical security analysis of reference pulses for the CVQKD protocol with Gaussian modulation.  CW laser, continuous wave laser; BS, beam splitter; PD, photodetector; VOA, variable optical attenuator; PBS, polarizing beam splitter; Att.,  attenuator; PNRD, photon number resolving detector; DL, delay line; PC, polarization controller; AM, amplitude modulation; PM, phase modulation. 

Performance Analysis {#Sec3}
====================

First of all, we define transmission probability and transition probability to analyze the performance of the reference pulses for the discrete modulation protocol.  In the four-state self-reference CVQKD protocol, there are four kinds of the intercepted encoding phase, namely the $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\varphi }_{i}=\frac{(2k+1)\pi }{4}$$\end{document}$, with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$k\in \left\{0,1,2,3\right\}$$\end{document}$. According to the likelihood function, if the transmission states are in consistent with the measurement outcome $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$ {\mathcal E} $$\end{document}$, the equation can be simplified as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{array}{rcl}{\mathscr P}(\left|\,{\alpha }_{0}\right\rangle | {\varphi }_{0}) & = & \frac{1}{4}(1+{e}^{-{\Delta }^{2}}\cos (\pi /4))\\  & = & \frac{1}{4}(1+\frac{\sqrt{2}}{2}{e}^{-{\Delta }^{2}}),\\ {\mathscr P}(\left|\,{\alpha }_{1}\right\rangle | {\varphi }_{1}) & = & \frac{1}{4}(1+{e}^{-{\Delta }^{2}}\sin (3\pi /4))\\  & = & \frac{1}{4}(1+\frac{\sqrt{2}}{2}{e}^{-{\Delta }^{2}}),\\ {\mathscr P}(\left|\,{\alpha }_{2}\right\rangle | {\varphi }_{2}) & = & \frac{1}{4}(1-{e}^{-{\Delta }^{2}}\cos (5\pi /4))\\  & = & \frac{1}{4}(1+\frac{\sqrt{2}}{2}{e}^{-{\Delta }^{2}}),\\ {\mathscr P}(\left|\,{\alpha }_{3}\right\rangle | {\varphi }_{3}) & = & \frac{1}{4}(1-{e}^{-{\Delta }^{2}}\sin (7\pi /4))\\  & = & \frac{1}{4}(1+\frac{\sqrt{2}}{2}{e}^{-{\Delta }^{2}}).\end{array}$$\end{document}$$ Therefore, the transmission probability can be defined as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\mathscr P}}_{ii}={\mathscr P}(\left|\,{\alpha }_{i}\right\rangle | {\varphi }_{i})$$\end{document}$ with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$i\in \left\{0,1,2,3\right\}$$\end{document}$, which satisfies the constraint $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\sum }_{j=0}^{3}{\mathscr P}(\left|\,{\alpha }_{i}\right\rangle | {\varphi }_{j})=1$$\end{document}$. Moreover, the transition probability can be expressed as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\mathscr P}}_{ij}=1-{{\mathscr P}}_{ii}$$\end{document}$ with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$i\ne j$$\end{document}$. Subsequently, the QBER for Eve can be calculated as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$QBER={\sum }_{n}{{\mathscr Q}}_{n}{ {\mathcal R} }_{n}$$\end{document}$, with the notation $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\mathscr Q}}_{n}=\left\{\begin{array}{l}{\sum }_{k=(n+1)/2}^{n}{{\rm{C}}}_{n}^{k}{{\mathscr P}}_{ij}^{k}{(1-{{\mathscr P}}_{ij})}^{n-k}n\,{\rm{is}}\,{\rm{odd}},\\ {\sum }_{k=(n+2)/2}^{n}{{\rm{C}}}_{n}^{k}{{\mathscr P}}_{ij}^{k}{(1-{{\mathscr P}}_{ij})}^{n-k}+\frac{1}{2}{{\rm{C}}}_{n}^{n/2}{{\mathscr P}}_{ij}^{n/2}{(1-{{\mathscr P}}_{ij})}^{n/2}\,\,\,\,\,n\,{\rm{is}}\,{\rm{even}},\end{array}\right.$$\end{document}$$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${ {\mathcal R} }_{n}=\frac{{e}^{-{N}_{c}}\cdot {N}_{c}^{n}}{n!},{C}_{n}^{k}=\frac{n!}{k!(n-k)!},n!=1\times 2\times 3\times \cdots (n-1)\times n$$\end{document}$. Here, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$n$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${N}_{c}$$\end{document}$ symbolize the transmitted photons (at the Alice's side) and detected photons (at the Eve's side) per pulse, respectively.  Figure [6a](#Fig6){ref-type="fig"} depicts the QBER for Eve with the discrete modulation protocol.  Considering the existence of noise in the channel, two parameters are restricted with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$n > {N}_{c}$$\end{document}$. According to the result, we can see that, increasing the number of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$n$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${N}_{c}$$\end{document}$ will improve the QBER of the intercept-resend attack for Eve. Figure 6(**a**) The QBER of the intercept-resend attack with the discrete modulation protocol. (** b**) Difference in minimum mean squared error for the two phase estimation schemes, namely the NFM estimator protocol^[@CR51],[@CR53],[@CR54]^, and Bayesian estimator protocol, respectively.  Here, the phase shift is set as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\pi /3$$\end{document}$.

In the following, we analyze the performance of the Bayesian estimator for the Gaussian-modulated self-reference CVQKD protocol.  The Bayesian cost can be defined by the relation $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\bar{ {\mathcal B} }({\bf{n}})={\int }_{{\varphi }^{^{\prime} }-\pi }^{{\varphi }^{^{\prime} }+\pi }{({\varphi }^{^{\prime} }-\varphi )}^{2}{\mathscr P}(\varphi | {\bf{n}})\,{\rm{d}}\varphi .$$\end{document}$$ Particularly, if a suitable initial phase value $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\varphi }^{^{\prime} }$$\end{document}$ is given, the minimum mean squared error (MMSE) estimator of $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\varphi }^{^{\prime} }$$\end{document}$ has the form $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\rm{MMSE}}={\int }_{{\varphi }^{^{\prime} }-\pi }^{{\varphi }^{^{\prime} }+\pi }\varphi {\mathscr P}(\varphi | {\bf{n}})\,{\rm{d}}\varphi ,$$\end{document}$$ where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\varphi }^{^{\prime} }$$\end{document}$ can be initialized with the maximum likelihood (ML) estimate, and it can be defined as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\rm{e}}}^{i{\varphi }^{^{\prime} }}=\frac{1}{\widehat{V}}\left[\frac{{n}_{3}-{n}_{4}}{{n}_{3}+{n}_{4}}+i\frac{{n}_{5}-{n}_{6}}{{n}_{5}+{n}_{6}}\right].$$\end{document}$$Figure [6b](#Fig6){ref-type="fig"} simulates the performance of the different phase estimation schemes, in particular, the input intensity $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\bar{n}}_{{\rm{in}}}$$\end{document}$ is simulated for the fixed phase shift $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\frac{\pi }{3}$$\end{document}$. Specifically, the blue line denotes the NFM estimator^[@CR51],[@CR53],[@CR54]^. Consequently, the Bayesian estimator outperforms NFM estimator. 

Although the intercept-resend attack can compromise the practical security of QKD, the two remote participants can discover eavesdropping by the following method.  At the receiver, Bob randomly chooses the same number of quantum pulses and reference pulses as training signals^[@CR55]^. By utilizing the training signals, we can estimate the phase compensation error on reference signals and quantum signals, respectively.  If the phase compensation error on signal pulses is different from that on reference pulses, we can conclude that Eve's attack is attached in the quantum channel. 

Conclusion {#Sec4}
==========

In this paper, we analyze a security vulnerability of strong reference pulses in the realistic self-reference CVQKD system.  In this scenario, before the beam splitter attack, Eve intercepts the reference pulses emitted by Alice, and utilizing the Bayesian algorithm to estimate phase drifts of reference pulses.  After phase estimation and compensation, she resubmits another reference pulses to Bob.  The algorithm not only can obtain a well-motivated confidence interval, but also has robustness to noise.  Thus, due to the intercept-resend attack and the beam splitter attack, Eve can bias the excess noise.  Consequently, it shows that the practical security of the proposed attack can be compromised by transmitting the reference pulses in the continuous-variable quantum key distribution protocol. 

Appendix {#Sec5}
========

In the following, we take the four-state self-reference CVQKD protocol as an example, to derive the expression of the secret key rate under the intercept-resend attack.  Assuming that the phase noise of quantum channel is zero-mean with variance $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{{\rm{ch}}}$$\end{document}$, while the phase noise reduced by Eve's Bayesian algorithm is zero-mean with variance $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{{\rm{Bayes}}}$$\end{document}$, the deviation of the actual phase compensation error can be given by $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{s}={V}_{{\rm{ch}}}-{V}_{{\rm{Bayes}}}$$\end{document}$. According to the imperfect phase compensation, the actual transmittance can be defined as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${T}_{\kappa }=\kappa T$$\end{document}$, where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\kappa $$\end{document}$ represents the phase estimation accuracy with $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\kappa ={\left(1-\frac{1}{2}{V}_{s}\right)}^{2}$$\end{document}$, and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$T$$\end{document}$ is the transmission efficiency.  Besides, the actual excess noise can be expressed as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\epsilon }_{\kappa }=\left[\epsilon +(1-\kappa )(V-1)\right]/\kappa $$\end{document}$. Therefore, the total noise referred to the channel input can be expressed as $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\chi }_{{\rm{tot}}}^{\kappa }={\chi }_{{\rm{line}}}^{\kappa }+{\chi }_{\hom }/{T}_{\kappa }$$\end{document}$, with the notation $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\chi }_{{\rm{line}}}=1/{T}_{\kappa }+{\epsilon }_{\kappa }-1$$\end{document}$.

When Alice and Bob use reverse reconciliation, the secret key rate can be defined as $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$S=\beta I(A:B)-\chi (B:E),$$\end{document}$$ where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\beta $$\end{document}$ is the reconciliation efficiency, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$I(A:B)$$\end{document}$ is the mutual information between Alice and Bob, and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\chi (B:E)$$\end{document}$ is the mutual information between Bob and Eve.  Specifically, the mutual information $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$I(A:B)$$\end{document}$ is given by^[@CR55]^$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$I(A:B)=\frac{1}{2}{{\rm{\log }}}_{2}\frac{V+{\chi }_{{\rm{tot}}}^{\kappa }}{1+{\chi }_{{\rm{tot}}}^{\kappa }}.$$\end{document}$$ The Holevo bound of the information between Eve and Bob is given by $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\chi (B:E)=\mathop{\sum }\limits_{i=1}^{2}G\left(\frac{{\lambda }_{i}-1}{2}\right)-\mathop{\sum }\limits_{i=3}^{5}G\left(\frac{{\lambda }_{i}-1}{2}\right),$$\end{document}$$ where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$G(x)=(x+1){{\rm{\log }}}_{2}(x+1)-x{{\rm{\log }}}_{2}x$$\end{document}$. The symplectic eigenvalues $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\lambda }_{1,2}$$\end{document}$ are given by $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\lambda }_{1,2}=\sqrt{\frac{1}{2}(A\pm \sqrt{{A}^{2}-4B})},$$\end{document}$$ where $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{array}{ll}A & ={V}^{2}+{T}_{\kappa }^{2}(V+{{\chi }_{{\rm{line}}}^{\kappa }}^{2}-2{T}_{\kappa }{Z}_{4}^{2}),\\ B & ={({T}_{\kappa }{V}^{2}+{T}_{\kappa }V{\chi }_{{\rm{line}}}^{\kappa }-{T}_{\kappa }{Z}_{4}^{2})}^{2}.\end{array}$$\end{document}$$ The symplectic eigenvalues $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\lambda }_{3,4}$$\end{document}$ are given by $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\lambda }_{3,4}=\sqrt{\frac{1}{2}(C\pm \sqrt{{C}^{2}-4D})},\,{\lambda }_{5}=1,$$\end{document}$$ with the notation $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{array}{ll}C & =\frac{A{\chi }_{\hom }+V\sqrt{B}+{T}_{\kappa }(V+{\chi }_{{\rm{line}}}^{\kappa })}{{T}_{\kappa }(V+{\chi }_{{\rm{tot}}}^{\kappa })},\\ D & =\sqrt{B}\frac{V+\sqrt{B}{\chi }_{\hom }}{{T}_{\kappa }(V+{\chi }_{{\rm{tot}}}^{\kappa })}.\end{array}$$\end{document}$$

Subsequently, we conduct numerical simulation using the realistic parameters.  The parameters are summarized below: $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\alpha =0.35$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${v}_{{\rm{el}}}=0.001$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\epsilon =0.01$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\eta =0.6$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\beta =0.95$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{{\rm{ch}}}=0.01({{\rm{rad}}}^{2})$$\end{document}$. Here, the phase noise reduced by Eve's Bayesian algorithm submits to the normal distribution with variance $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$0.001$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$0.004$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$0.007$$\end{document}$ ($\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\rm{rad}}}^{2}$$\end{document}$) respectively.  In particular, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{{\rm{Bayes}}}=0$$\end{document}$ represents the original CVQKD protocol without the intercept-resend.  Fig.  [7](#Fig7){ref-type="fig"} is the simulation result in the asymptotic scenario.  According to the simulation result, we can conclude that, the estimated key rate based on the intercept-resend and Bayesian algorithm is higher than the true security key rate.  Therefore, the attack is effective in the self-reference CVQKD protocol.  In our manuscript, the proposed algorithm is described as follows. Figure 7The theoretical and practical secret key rate of the four-state self-reference CVQKD under the intercept-resend attack.  The phase noise reduced by Eve's Bayesian algorithm submits to the normal distribution with variance $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$0.001$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$0.004$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$0.007$$\end{document}$ ($\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${{\rm{rad}}}^{2}$$\end{document}$) respectively.  In particular, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{{\rm{Bayes}}}=0$$\end{document}$ represents the original CVQKD protocol without the intercept-resend.  Other parameters are summarized below: $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\alpha =0.35$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${v}_{{\rm{el}}}=0.001$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\epsilon =0.01$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\eta =0.6$$\end{document}$, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\beta =0.95$$\end{document}$ and $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${V}_{{\rm{ch}}}=0.01({{\rm{rad}}}^{2})$$\end{document}$.

![ Bayesian phase estimation](41598_2019_54249_Figa_HTML){#Figa}

![ Updating function](41598_2019_54249_Figb_HTML){#Figb}

**Publisher's note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. 

This work is supported by the National Nature Science Foundation of China (Grant Nos.  61801522, 61872390), and National Nature Science Foundation of Hunan Province, China (Grant No.  2019JJ40352). 

D.H. defined the scientific goals and conceived the project.  W.Z. carried out the whole protocol.  R.-H.S. developed the phase estimation algorithm.  W.Z., R.-H.S. and D.H. wrote the manuscript. 

The authors declare that they have no competing interests.