Encryption chip error-detecting and automatically reset method in a kind of encrypted card
Technical field
The present invention relates on the encrypted card to the control method of encryption chip encryption chip error-detecting and automatically reset method in particularly a kind of encrypted card.
Background technology
In the encrypted card application, encryption chip is the core devices of encrypted card, and all encryption and decryption operations all need to finish by encryption chip.But encryption chip can mistake occur owing to the reason of internal logic or applications, and this mistake can cause the mistake of encrypted result, thereby makes upper layer application mistake occur, makes data expendable fatal result occur when serious.
The way of encrypted card is to implement monitoring by upper layer software (applications) at present, and the end time is detected encrypted card at interval, if pinpoint the problems, by software transmission chip replacement or reset command encryption chip is resetted.Perhaps some encrypted card does not carry out error-detecting, if run into the encryption chip mistake, can only again server be restarted.It is elongated at interval that the previous case make to be encrypted the detection time of makeing mistakes, the centre have some packets by the carrying out of mistake encryption and decryption.Under the latter event, the service of encryption and decryption stops because of server outage, and practical application has been caused adverse effect.
Summary of the invention
At above or a plurality of problems, the present invention proposes encryption chip error-detecting and automatically reset method in a kind of encrypted card, solve encrypted card defective in use, the present invention adopts increases encryption chip Monitoring and Controlling chip on encrypted card, can monitor the running status of encrypted card in real time, in time make the encryption chip reset instruction.
Encryption chip error-detecting and automatically reset method comprise the Monitoring and Controlling chip in a kind of encrypted card, and step is as follows:
A, upper application software send to encryption and decryption order or data in the encryption chip by the Monitoring and Controlling chip;
B, Monitoring and Controlling chip add chip monitoring order to the encryption and decryption command header automatically;
After C, monitoring order entered encryption chip, encryption chip returned its internal state information;
D, Monitoring and Controlling chip are judged the encryption chip internal state information, if be not inconsistent with desired value, then the Monitoring and Controlling chip sends reset command, and encryption chip is resetted; If conform to, then proceed the operation of encryption and decryption with desired value.
In E, the encryption and decryption process, Monitoring and Controlling chip monitoring encryption chip data time of return if the data time of return exceeds preset value, thinks that then encrypted card makes mistakes, and the Monitoring and Controlling chip sends the reset command encryption chip that resets.
A kind of optimal technical scheme of the present invention is: described Monitoring and Controlling chip can be FPGA or CPLD chip, can realize monitoring and reset operation to encryption chip by the configuration internal logic.
Another optimal technical scheme of the present invention is: described Monitoring and Controlling chip can carry out communication by general purpose interface bus and main frame or host interface chip.
The present invention efficiently solves the situation of makeing mistakes in the encrypted card encryption and decryption process, has improved the work efficiency of encrypted card.
Description of drawings
Fig. 1 is the synoptic diagram that is connected with encryption chip according to Monitoring and Controlling chip on the encrypted card of the present invention.
Fig. 2 is according to the direct-connected synoptic diagram of Monitoring and Controlling chip and main frame on the encrypted card of the present invention.
Fig. 3 is the synoptic diagram that is connected with the host interface chip according to Monitoring and Controlling chip on the encrypted card of the present invention.
Specific embodiments
The present invention has added a Monitoring and Controlling chip on encrypted card, be connected between host interface and the encryption chip.Main frame sends the order and the data of encryption and decryption by the Monitoring and Controlling chip.Main frame does not need encryption chip is sent independent monitoring or reset command, the Monitoring and Controlling chip can be added the monitoring order automatically in the encryption and decryption order of main frame and data, monitor the result of return command simultaneously, if the discovery encryption chip occurs wrong or do not make at the appointed time and replying, promptly send reset command.
Fig. 1 is according to the Monitoring and Controlling chip of encrypted card of the present invention and the connection diagram of encryption chip.As shown in Figure 1, encrypted card according to the present invention comprises that encryption chip circuit 102 also comprises a Monitoring and Controlling chip 104, is used for encryption chip is monitored and resetted.
Fig. 2 is according to the direct-connected synoptic diagram of Monitoring and Controlling chip and main frame on the encrypted card of the present invention.As shown in Figure 2, also comprise host interface 103 according to encrypted card of the present invention.Monitoring and Controlling chip in the encrypted card can be connected with host interface 103 by the versabus mode, as: PCIe, USB.
Fig. 3 is the synoptic diagram that is connected with the host interface chip according to Monitoring and Controlling chip on the encrypted card of the present invention.As shown in Figure 3, also comprise host interface chip 105 according to encrypted card of the present invention.Monitoring and Controlling chip in the encrypted card is connected with host interface chip 105 by general or non-versabus mode, as: GPIO.