Method for cryptographic chip, cryptographic chip, cryptographic card and storage medium
By introducing the PCI-E module and driver module into the cryptographic chip, the cryptographic algorithm is dynamically reconstructed, which solves the problems of low performance and poor flexibility of existing domestic cryptographic products, and achieves improved flexibility and security to adapt to diverse application needs.
Patent Information
- Application Number
- CN202210389491.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-04-13
AI Technical Summary
Existing domestic encryption products use fixed encryption algorithms, resulting in low performance and poor flexibility, making it difficult to cope with the diverse application needs in different application scenarios.
By introducing the PCI-E module, driver module and computing core module into the cryptographic chip, the driver module is used to interact with the upper-layer software to dynamically reconstruct the initial cryptographic algorithm, load the reconstruction algorithm, and the computing core module performs operations based on the reconstruction algorithm. Supports multiple algorithms such as SM2, SM3, SM4, ECC, RSA and AES to realize real-time replacement of algorithms.
It improves the flexibility of the cryptographic chip, can adapt to the needs of different application scenarios, simplifies the design circuit, and improves security through temperature sensor monitoring.
Smart Images

Figure CN114760057B
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the technical field of cryptographic chips, and more specifically, to a method for a cryptographic chip, a cryptographic chip, a cryptographic card, and a computer-readable storage medium. Background Art
[0002] As the country attaches great importance to the development of domestic cryptographic technology and the government agencies, financial industry and large and medium-sized state-owned enterprises have continuously strengthened their demand for domestic cryptographic algorithms, the application of domestic encryption algorithm products has grown rapidly. At the same time, with the development of Internet technology, the application scenarios of high-speed cryptographic chips have gradually become more generalized. However, existing domestic cryptographic products usually use dedicated chips, that is, fixed cryptographic algorithms, which makes the existing cryptographic products have low performance and poor flexibility, making it difficult to cope with the diversified application needs in different application scenarios. Summary of the invention
[0003] In order to at least partially solve the technical problems mentioned in the background technology, the solution of the present disclosure provides a solution for a cryptographic chip. Using the solution of the present disclosure, the corresponding algorithm can be replaced in real time according to business needs, which greatly improves the flexibility of chip application. To this end, the present disclosure provides solutions in the following aspects.
[0004] In a first aspect, the present disclosure provides a method for a cryptographic chip, wherein the cryptographic chip includes a PCI-E module, a driver module, and a calculation core module connected to the PCI-E module and the driver module, and the method includes: using the PCI-E interface of the PCI-E module to receive operation data transmitted by upper-layer software; using the driver module to interact with the upper-layer software to reconstruct an initial cryptographic algorithm to obtain a reconstruction algorithm and load the reconstruction algorithm; using the calculation core module to obtain the operation data from the PCI-E module via a PCI-E bus; and calculating the operation data according to the reconstruction algorithm.
[0005] In one embodiment, the use of the driver module to interact with the upper-layer software to reconstruct the initial cryptographic algorithm to obtain the reconstructed algorithm includes: according to the business requirements of the upper-layer software, using the driver module to submit the encoding of the corresponding cryptographic algorithm to the upper-layer software; and reconstructing the initial cryptographic algorithm based on the parsing result of the upper-layer software on the encoding of the corresponding cryptographic algorithm to obtain the reconstructed algorithm.
[0006] In another embodiment, reconstructing the initial cryptographic algorithm based on the parsing result to obtain the reconstructed algorithm includes: judging whether it is a symmetric algorithm based on the parsing result; and reconstructing the initial cryptographic algorithm based on the judgment result to obtain the reconstructed algorithm.
[0007] In another embodiment, reconstructing the initial cryptographic algorithm based on the judgment result includes: in response to the judgment result being a symmetric algorithm, calling a symmetric algorithm search matrix to search for an algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm; or in response to the judgment result being an asymmetric algorithm, calling an asymmetric algorithm search matrix to search for an algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm.
[0008] In yet another embodiment, the reconstruction algorithm includes at least one of the SM2 algorithm, the SM3 algorithm, the SM4 algorithm, the ECC algorithm, the RSA algorithm, the AES algorithm and the ZUC algorithm.
[0009] In a second aspect, the present disclosure also provides a cryptographic chip, comprising: a PCI-E module, a driver module, and a computing module connected to the PCI-E module and the driver module; and a processing module, which is used to enable the PCI-E module, the driver module and the computing module to cooperate to execute the aforementioned multiple embodiments.
[0010] In one embodiment, the cryptographic chip further includes a controller, wherein the controller is connected to the PCI-E module via a PCI-E bus and is configured to receive operation instructions transmitted by upper-layer software via a PCI-E interface of the PCI-E module.
[0011] In a third aspect, the present disclosure further provides a cryptographic card, comprising: the cryptographic chip described in the aforementioned second aspect; and a management module configured to manage the cryptographic chip.
[0012] In one embodiment, the cryptographic card further comprises a temperature sensor connected to the cryptographic chip and configured to monitor the temperature of the cryptographic chip.
[0013] In a fourth aspect, the present disclosure further provides a computer-readable storage medium on which computer-readable instructions for a cryptographic chip are stored. When the computer-readable instructions are executed by one or more processors, the embodiments described in the first aspect are implemented.
[0014] Through the scheme disclosed in the present invention, the initial cryptographic algorithm is reconstructed by using the driver module to interact with the upper-level software, and then the calculation core module is used to calculate the calculation data based on the obtained reconstruction algorithm, so that the corresponding algorithm can be replaced in real time, making the cryptographic chip more flexible and applicable to different application requirements in different application scenarios. Furthermore, the embodiment of the present invention simplifies the design circuit compared to the traditional cryptographic chip by integrating the PCI-E module, the calculation core module and the controller on one chip. In addition, the embodiment of the present invention also monitors the temperature of the cryptographic chip by setting a temperature sensor to improve the security of the use of the cryptographic chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0016] Figure 1 is an exemplary flow chart showing a method for a cryptographic chip according to an embodiment of the present disclosure;
[0017] Figure 2 is an exemplary flowchart showing the reconstruction of the initial cryptographic algorithm based on the interaction between the driver module and the upper layer software according to an embodiment of the present disclosure;
[0018] Figure 3a-Figure 3b is an exemplary schematic diagram showing a symmetric algorithm search matrix and an asymmetric algorithm search matrix according to an embodiment of the present disclosure;
[0019] Figure 4 is an exemplary structural block diagram showing a cryptographic chip according to an embodiment of the present disclosure; and
[0020] Figure 5 FIG. 4 is a block diagram showing an exemplary structure of a password card according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. It should be understood that the embodiments described in this specification are only some embodiments provided by the present disclosure to facilitate a clear understanding of the solutions and to comply with legal requirements, and are not all embodiments that can implement the present disclosure. Based on the embodiments disclosed in this specification, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0022] Figure 11 is an exemplary flowchart of a method 100 for a cryptographic chip according to an embodiment of the present disclosure. In one embodiment, the cryptographic chip may include a PCI-E module, a driver module, and a computing core module connected to the PCI-E module and the driver module. The method 100 for a cryptographic chip according to an embodiment of the present disclosure can be implemented through the cooperation between the aforementioned PCI-E module, the driver module, and the computing core module.
[0023] like Figure 1 As shown in, at step S102, the PCI-E interface of the PCI-E module is used to receive the operation data transmitted by the upper software. The operation of the operation data can be implemented by the calculation core module. Then, at step S104, the driver module is used to interact with the upper software to reconstruct the initial cryptographic algorithm to obtain the reconstruction algorithm and load the reconstruction algorithm. It can be understood that the upper software may include user-oriented logic layer software, that is, various application software. In the application scenario, when the cryptographic chip is powered on, the upper software will initialize the cryptographic algorithm library to obtain the aforementioned initial cryptographic algorithm, and then use the driver module to interact with the upper software to reconstruct the initial cryptographic algorithm to obtain the reconstruction algorithm. In one embodiment, first, according to the business needs of the upper software, the driver module can be used to submit the encoding of the corresponding cryptographic algorithm to the upper software, and then the initial cryptographic algorithm can be reconstructed based on the analysis result of the upper software on the encoding of the corresponding cryptographic algorithm to obtain the reconstruction algorithm.
[0024] Furthermore, first determine whether it is a symmetric algorithm based on the analysis result, and then reconstruct the initial cryptographic algorithm based on the determination result to obtain a reconstruction algorithm. Specifically, in response to the determination result being a symmetric algorithm, call the symmetric algorithm search matrix to search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm to obtain a reconstruction algorithm. In response to the determination result being an asymmetric algorithm, call the asymmetric algorithm search matrix to search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm to obtain a reconstruction algorithm. The obtained reconstruction algorithm can be loaded by the driver module into the calculation core module. In some embodiments, the aforementioned reconstruction algorithm can include at least one of the SM2 algorithm, SM3 algorithm, SM4 algorithm, ECC algorithm, RSA algorithm, AES algorithm and ZUC algorithm. This will be discussed later in conjunction with Figure 2 The aforementioned reconstruction algorithm is described in detail.
[0025] The figure further shows that at step S104, the calculation core module is used to obtain operation data from the PCI-E module via the PCI-E bus. That is, the PCI-E module and the calculation core module are connected via the PCI-E bus. Based on the obtained operation data, at step S106, the operation data is calculated according to the reconstruction algorithm to realize the business requirements based on the corresponding cryptographic algorithm.
[0026] Combined with the above description, it can be seen that the embodiment of the present disclosure implements the cryptographic algorithm of the dynamically reconfigurable cryptographic chip through the interaction between the driving module and the upper layer module, and then calculates the operation data based on the reconstruction algorithm through the calculation core module. Based on this, the corresponding cryptographic algorithm can be called according to different business needs, making the cryptographic chip more flexible and able to cope with diverse application needs in different application scenarios.
[0027] Figure 2 is an exemplary flowchart showing the reconstruction of the initial cryptographic algorithm based on the interaction between the driver module and the upper layer software according to an embodiment of the present disclosure. It should be understood that Figure 2 is the above Figure 1 A specific embodiment of step S104 of method 100, therefore, the above Figure 1 The description of method 100 in Figure 2 .
[0028] like Figure 2 As shown in, at step S202, the cryptographic chip is powered on, and the cryptographic algorithm library is initialized via the upper-layer software. Thus, the initial cryptographic algorithm can be obtained. Then, at step S204, according to the business requirements, the encoding of the corresponding cryptographic algorithm required by the business requirements is submitted to the upper-layer software via the driver module. After the upper-layer software receives the encoding of the corresponding cryptographic algorithm, at step S206, the encoding of the corresponding cryptographic algorithm is parsed via the upper-layer software, and the parsing result is obtained. Further, at step S208, it is determined whether the aforementioned parsing result is a symmetric algorithm to obtain a judgment result, which may include a symmetric algorithm and an asymmetric algorithm.
[0029] When the judgment result is a symmetric algorithm, at step S210, the symmetric algorithm search matrix is called to search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm. Then, at step S212, the reconstruction algorithm is loaded into the cryptographic chip via the driver module. For example, in an exemplary scenario, it is assumed that the upper-level software includes business A and business B, where the cryptographic algorithm required for business A is the SM4 ECB operation mode, and the cryptographic algorithm required for business B is the AES CBC operation mode. In this scenario, the encoding of the SM4 ECB operation mode and the encoding of the AES CBC operation mode are submitted to the upper-level software for parsing via the driver module, and if the parsing result is judged to be a symmetric algorithm, the symmetric algorithm search matrix (for example) is called. Figure 3a As shown) search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm. For example, when searching for Figure 3aWhen [1 1 0 0 10] is shown in , the initial cryptographic algorithm is reconstructed to obtain the reconstructed algorithm SM4 ECB. That is, according to the business requirements of A, the algorithm rules of the initial cryptographic algorithm are transformed into the algorithm rules of SM4 ECB, and the algorithm rules of SM4 ECB are loaded into the cryptographic chip.
[0030] Similar to the above-mentioned A business, the symmetric algorithm is called to search the matrix (for example Figure 3a When searching for Figure 3a When [1 0 1 0 0 1] is shown in , the initial cryptographic algorithm is reconstructed to obtain the reconstructed algorithm AES CBC. That is, according to the business requirements of B, the algorithm rules of the initial cryptographic algorithm are transformed into the algorithm rules of AES CBC and loaded into the cryptographic chip, and then the calculation data is calculated based on the reconstructed algorithm through the calculation core module.
[0031] When the result of the judgment is an asymmetric algorithm, at step S214, the asymmetric algorithm search matrix is called to search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm. In another exemplary scenario, it is assumed that the upper-layer software includes C business and D business, where the cryptographic algorithm required by C business is the SM2 signature operation mode, and the cryptographic algorithm required by D business is the RSA public key operation mode. In this scenario, the encoding of the SM2 signature operation mode and the encoding of the RSA public key operation mode are submitted to the upper-layer software for parsing via the driver module, and if the parsing result is judged to be an asymmetric algorithm, the asymmetric algorithm search matrix (for example) is called. Figure 3b As shown) search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm. For example, when searching for Figure 3b When [1 0 1 0 1 0 0 0] is shown in , the initial cryptographic algorithm is reconstructed to obtain the reconstructed algorithm SM2. That is, according to the business requirements of C, the algorithm rules of the initial cryptographic algorithm are transformed into the algorithm rules of the SM2 signature, and the algorithm rules of the SM2 signature are loaded into the cryptographic chip.
[0032] Similar to the above C business, the asymmetric algorithm is called to search the matrix (for example Figure 3b When searching for Figure 3bWhen [1 1 0 0 0 0 1 0] is shown in , the initial cryptographic algorithm is reconstructed to obtain the reconstructed algorithm RSA. That is, according to the business requirements of D, the algorithm rules of the initial cryptographic algorithm are transformed into the algorithm rules of the RSA public key and loaded into the cryptographic chip, and then the operation data is calculated based on the reconstruction algorithm via the calculation core module. Therefore, the corresponding algorithm can be replaced in real time according to business requirements, and the flexibility of the cryptographic chip can be improved so as to adapt to different application scenarios. In some embodiments, for scenarios where the parsing results are other algorithms (neither symmetric algorithms nor asymmetric algorithms), the corresponding algorithm search matrix can also be used for search, and the present disclosure is not limited here.
[0033] It can be understood that the algorithm of the dedicated computing chip is solidified inside the chip, and when it is static (not powered on), the corresponding algorithm rules also exist in the chip. However, since the security of the algorithm depends on the binary factor formed by "algorithm + key", the solidification of the algorithm will lead to a decrease in the difficulty of cracking (i.e.). That is, its two-dimensional structure is broken, leaving only a one-dimensional key, which makes the dedicated computing chip have great security risks. Based on the foregoing description, it can be seen that when the cryptographic chip of the embodiment of the present disclosure is powered off or not powered on, its algorithm rules do not exist, but by dynamically reconstructing the algorithm in real time when the cryptographic chip is powered on and loading the algorithm rules of the reconstructed algorithm, the two-dimensional structure of "algorithm + key" can be guaranteed, thereby improving the security of the cryptographic chip.
[0034] As mentioned above, the cryptographic chip of the present disclosure may include a PCI-E module, a driver module, and a computing core module. In one implementation scenario, the cryptographic chip may also include a processing module so that the PCI-E module, the driver module, and the computing core module cooperate to perform, for example, the above Figure 1 The method 100 is described below. Figure 4 Let's describe the cryptographic chip in detail.
[0035] Figure 4 FIG. 4 is a block diagram showing an exemplary structure of a cryptographic chip 400 according to an embodiment of the present disclosure. Figure 4 As shown in , the cryptographic chip 400 may include a PCI-E module 401 and a calculation core module 402. As known to those skilled in the art, PCI-E is a high-speed serial computer expansion bus standard, which belongs to high-speed serial point-to-point dual-channel high-bandwidth transmission. In the disclosed embodiment, the PCI-E module 401 can receive and transmit the operation data of the upper-layer software through the PCI-E interface. Furthermore, the aforementioned PCI-E module 401 is connected to the calculation core module 402 via the PCI-E bus, so that the operation data of the upper-layer software is transmitted to the calculation core module 402 via the PCI-E bus, and then the calculation core module 402 calculates the operation data based on the above-mentioned reconstruction algorithm (or the algorithm rules of the reconstruction algorithm).
[0036] In one embodiment, the interior of the above-mentioned calculation core module 402 may be composed of operation units, and the operation units may include but are not limited to basic arithmetic operation units and logic operation units. Among them, the aforementioned basic arithmetic operation unit may include arithmetic operations such as point addition, point multiplication, dot dot, modular multiplication, modular addition, modular subtraction, and the aforementioned logic operation unit may include logical operations such as AND, OR, and NOT. In the implementation scenario, the calculation core module 402 implements the operation of operation data based on the algorithm rules of the reconstruction algorithm through the aforementioned basic arithmetic operation unit and / or logic operation unit, and the result of its calculation (or operation) can also be transmitted to the PCI-E module via the PCI-E bus, and then transmitted to the upper layer software. As mentioned above, the reconstruction algorithm may include at least one of the SM2 algorithm, SM3 algorithm, SM4 algorithm, ECC algorithm, RSA algorithm, AES algorithm and ZUC algorithm. In some embodiments, the aforementioned calculation core module 402 may also include, for example, a random number unit to generate a true random number.
[0037] The figure further shows that the above-mentioned cryptographic chip 400 may also include a driver module 403 and a processing module 404. In one embodiment, the driver module 403 may interact with the upper-level software to reconstruct the initial cryptographic algorithm to obtain a reconstruction algorithm and load the reconstruction algorithm. For example, according to the business needs of the upper-level software, the encoding of the corresponding cryptographic algorithm may be submitted to the upper-level software, and the upper-level software may parse the parsed result and judge it. When it is judged to be a symmetric algorithm, the symmetric algorithm search matrix may be called to search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm. When it is judged to be an asymmetric algorithm, the asymmetric algorithm search matrix may be called to search for the algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm to obtain a reconstruction algorithm. For details, please refer to the above Figure 2 The described contents will not be repeated in this disclosure.
[0038] In one embodiment, the processing module 404 can make the PCI-E module 401, the computing module 402 and the driving module 403 cooperate with each other to achieve, for example, Figure 1 The method for a cryptographic chip described in . That is, the PCI-E module 401 receives and transmits the operation data of the upper-layer software to the calculation core module 402, so that the driver module 403 and the upper-layer software interact to perform dynamic algorithm reconstruction and load the reconstruction algorithm into the calculation core module 402. Further, the calculation core module 402 performs operations based on the reconstruction algorithm, and transmits the operation results to the PCI-E module, and finally returns to the upper-layer software. In some embodiments, the processing module 404 may, for example, include a micro-control unit.
[0039] In addition, the cryptographic chip 400 of the present disclosure may further include a controller 405. The controller 405 may be connected to a PCI-E module via a PCI-E bus to receive a computing instruction transmitted by upper-layer software via a PCI-E interface of the PCI-E module. In an implementation scenario, the controller 405 may be an embedded controller, and may be, for example, a CORTEX-M3.
[0040] Combined with the above description, it can be seen that the cryptographic chip of the embodiment of the present disclosure can be realized through the cooperation between the PCI-E module, the calculation core module and the driver module. Figure 1 The method described. Among them, the embodiment of the present disclosure transmits data via the PCI-E bus, which greatly improves the communication rate of the data link, thereby improving the performance of the cryptographic chip.
[0041] Furthermore, the present disclosure also provides a password card, which may include the password chip and management module of the present disclosure. Figure 5 Let's describe the password card in detail.
[0042] Figure 5 FIG. 5 is a block diagram showing an exemplary structure of a password card 500 according to an embodiment of the present disclosure. Figure 5 As shown in , the password card 500 may include a password chip 400 and a management module 501. As known above, the password chip 400 may include a PCI-E module 401, a computing core module 402, a driver module 403, a processing module 404 and a controller 405. Among them, the PCI-E module 401 can be connected to the computing core module 402 and the controller 405 via a PCI-E bus, respectively, to transmit the operation data and operation instructions of the upper layer software to the computing core module 402 and the controller 405, respectively. The aforementioned processing module 404 can make the PCI-E module 401, the computing core module 402, and the driver module 403 cooperate with each other to achieve the following. Figure 1 For details, please refer to the above Figure 1 The described contents will not be repeated in this disclosure.
[0043] In one embodiment, the management module 501 may be, for example, a USB management chip. In the implementation scenario, the controller 405 may communicate with the management module 501 via the SPI bus to implement the forwarding function. Specifically, the management module 501 is connected to the UKey device via a USB interface, and is used to transparently transmit the operation instruction data received in the embedded controller (e.g., CORTEX-M3) 405 to the UKey device, and return the processing result of the UKey device to the embedded controller CORTEX-M3, thereby realizing the key storage, authority management, device management and other management functions of the cryptographic chip.
[0044] As further shown in the figure, the password card 500 may also include a temperature sensor 502, which communicates with the controller 405 in the password card 500 through, for example, an I2C bus, so as to monitor the temperature of the password chip 400 in real time, so as to improve the security of the use of the password chip. In addition, in some embodiments, the password card 500 may also include a power module 503 for providing power. In some implementation scenarios, the password card 500 may also include a FLASH module (not shown in the figure) connected to the controller 405.
[0045] In combination with the above description, it can be seen that the embodiment of the present disclosure provides a PCI-E-based password card, which integrates PCI-E, a computing core module and a controller on a single chip and is connected via a PCI-E bus. Compared with password cards that require a PLX bridge chip or an FPGA chip (such as a DSP-based password card, a customized ASIC-based password card and an FPGA-based password card), the design of the password card is greatly simplified and the performance of the chip is improved. Furthermore, the password card of the embodiment of the present disclosure is also provided with a temperature sensor to monitor the temperature of the password chip in real time, thereby improving the security of the use of the password chip.
[0046] According to the above description in combination with the accompanying drawings, those skilled in the art can also understand that the embodiments of the present disclosure can also be implemented by a software program. Therefore, the present disclosure also provides a computer program product. The computer program product can be used to implement the embodiments of the present disclosure in combination with the accompanying drawings. Figure 1-Figure 2 The described method for a cryptographic chip.
[0047] It should be noted that although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0048] It should be understood that when the terms "first", "second", "third" and "fourth" etc. are used in the claims, the specification and the drawings of the present disclosure, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.
[0049] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.
[0050] Although the embodiments of the present disclosure are as described above, the contents are only examples used to facilitate understanding of the present disclosure and are not intended to limit the scope and application scenarios of the present disclosure. Any technician in the technical field described in the present disclosure may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in the present disclosure, but the scope of patent protection of the present disclosure shall still be based on the scope defined in the attached claims.
Claims
1. A method for a cryptographic chip, wherein the cryptographic chip comprises a PCI-E module, a driver module, and a calculation module connected to the PCI-E module and the driver module, the method comprising: Using the PCI-E interface of the PCI-E module to receive the operation data transmitted by the upper layer software; Reconstruct the initial cryptographic algorithm by using the driver module to interact with the upper-layer software to obtain a reconstruction algorithm and load the reconstruction algorithm; Using the computing core module to obtain the computing data from the PCI-E module via the PCI-E bus; as well as Calculating the operation data according to the reconstruction algorithm; The use of the driver module to interact with the upper layer software to reconstruct the initial cryptographic algorithm to obtain the reconstructed algorithm includes: According to the business requirements of the upper-layer software, using the driver module to submit the code of the corresponding cryptographic algorithm to the upper-layer software; and Reconstructing the initial cryptographic algorithm based on the result of the upper-layer software parsing the encoding of the corresponding cryptographic algorithm to obtain the reconstructed algorithm; The initial cryptographic algorithm is reconstructed based on the result of the upper-layer software parsing the encoding of the corresponding cryptographic algorithm to obtain the reconstructed algorithm, which includes: Determining whether it is a symmetric algorithm according to the analysis result; and The initial cryptographic algorithm is reconstructed based on the judgment result to obtain the reconstructed algorithm.
2. The method according to claim 1, wherein reconstructing the initial cryptographic algorithm based on the judgment result comprises: In response to the judgment result being a symmetric algorithm, calling a symmetric algorithm search matrix to search for an algorithm corresponding to the encoding of the corresponding cryptographic algorithm to reconstruct the initial cryptographic algorithm; or In response to the determination result being an asymmetric algorithm, an asymmetric algorithm search matrix is called to search for an algorithm corresponding to the encoding of the corresponding cryptographic algorithm, so as to reconstruct the initial cryptographic algorithm.
3. The method according to claim 1, wherein the reconstruction algorithm comprises at least one of SM2 algorithm, SM3 algorithm, SM4 algorithm, ECC algorithm, RSA algorithm, AES algorithm and ZUC algorithm.
4. A cryptographic chip, comprising: A PCI-E module, a driver module, and a computing core module connected to the PCI-E module and the driver module; as well as A processing module, which is used to enable the PCI-E module, the driver module and the computing module to cooperate to execute the method according to any one of claims 1-3.
5. The cryptographic chip according to claim 4 further comprises a controller, wherein the controller is connected to the PCI-E module via a PCI-E bus and is configured to receive operation instructions transmitted by upper-layer software via a PCI-E interface of the PCI-E module.
6. A password card, comprising: The cryptographic chip according to claim 4 or 5; as well as A management module is configured to manage the cryptographic chip.
7. The cryptographic card according to claim 6, further comprising a temperature sensor connected to the cryptographic chip and configured to monitor the temperature of the cryptographic chip.
8. A computer-readable storage medium storing computer-readable instructions for a cryptographic chip, wherein the computer-readable instructions, when executed by one or more processors, implement the method according to any one of claims 1 to 3.
