## 2 Related Work  
In recent decades, considerable integrity protection methods based on hardware monitoring have been proposed to ensure the security of embedded systems when executing programs. In general, according to the different protection objects, these methods can be divided into two groups: for data integrity (DI) and for control flow integrity (CFI). DI protection methods based on hardware monitoring usually use an integrity check algorithm, such as a hash function, to map the protected data block into a fixed-size binary number, called a digest [13]. The hardware-based security monitor calculates the real-time digest and compares it with the offline digest. If the two digests are inconsistent, it is considered that the data block has been tampered with by attackers, and its DI has been destroyed [11]. [PERSON] et al. proposed a method to protect the integrity of dynamic data by using split sequence numbers [14]. Its tree structure was used to protect dynamic data from replay attacks, but multiple accesses to the tree nodes cause a large time slot delay. In [15], an architectural support for protecting the DI of an application was proposed, which could protect application data from physical attacks. A hardware-assisted detection method was proposed to protect DI [16]. By enhancing the memory hierarchy, a security tag was assigned to each data to indicate the DI. In [17], a cost-effective DI tag-generation design was proposed. This method provided flexibility for various security levels, but the generated data tag had a certain correlation with the data itself, resulting in a higher rate of tag conflicts. In [18], an improved method for generating DI digests for embedded processor memory was proposed. Through bit flipping and nonlinear Galois Field Multiplication (GFM) operations, the input data added randomness to protect the design from integrity attacks of any selected value. Researchers proposed a hardware-based DI verification mechanism for embedded systems [19]. They attached an extended memory to the on-chip data cache to store integrity tags. However, this method increased the amount of chip area. Moreover, this hardware structure needed to modify the cache in the CPU core, which was not conducive to the transplantation of embedded systems. The existing DI protection methods can effectively detect the behavior of tampering with the program data, but cannot detect the behavior of hijacking the control flow in time. Since CRAs can tamper with the control flow without injecting malicious code, the traditional DI protection methods, such as Write xor eXcute (W\(\oplus\)X), Address Space Layout Randomization (ASLR), and stack canaries, have failed [20; 21]. Attackers hijack the control flow of embedded systems mainly by modifying the return address in the stack, such as return-oriented programming (ROP) attacks [22], or directly tampering with the jump address, such as jump-oriented programming (JOP) attacks [23]. In order to resist these attacks, scholars have proposed many related solutions, such as the buffer-based shadow call stack [24; 25], and the hardware-assisted flow integrity extension method [26]. The label-based CFI protection method was to monitor the control flow integrity of the program execution by checking the label implanted in the start code of each BB in advance [27; 28; 29; 30]. These methods added additional code to the Instruction Set Architecture (ISA), not only needed to modify the hardware circuit in use, but also needed to modify the entire compilation link tool. [PERSON] et al. proposed a new hardware-assisted CFI protection method which used physical unclonable functions (PUF) to encrypt the return address of the function and the target address of the jump instruction to protect the CFI of embedded systems [31]. These protection methods mainly monitor a single parameter (data or control flow), and cannot protect both the DI and the CFI of embedded systems. Therefore, [PERSON] et al. not only monitored the DI label, but also assigned a CFI label to each BB [32].