The invention belongs to the technical field of
embedded system information security, and discloses an embedded program integrity multi-
granularity verification system and method based on hardware on
chip. According to the method, the program integrity
verification granularity is set to be an instruction level, a
basic block level, a function level and a mixing level in a hardware and
software mode, user operation is facilitated, and user selection is enriched; meanwhile, the storage and retrieval efficiency of the reference tag is improved based on a
hash table algorithm and a stack structure; in addition, on the basis of the characteristics of a
sponge structure
hash function, a hash value is calculated by adopting multiple channels, so that the difficulty of destroying codes by external attacks is increased, and the time
delay of hash calculation is effectively reduced; in addition, a dual
verification mechanism based on a sampling value and a random number is adopted, the space occupied by reference tag storage can be reduced, errors can be found as early as possible, the inherent
hysteresis of program integrity verification is relieved, and the method is suitable for safety protection and program integrity verification of an
embedded system.