ECDH key negotiation device and method suitable for security chip

By designing a pure RTL hardening solution suitable for ECDH key negotiation on a secure chip, the problem of low key negotiation efficiency in the prior art is solved, and efficient key negotiation without relying on the CPU is achieved.

CN119728103AActive Publication Date: 2025-03-28GUANGZHOU XINYUNYUAN MICROELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411853656.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-28
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The existing ECDH key negotiation technology is inefficient and requires the cooperation of the CPU, which cannot effectively improve the efficiency of key negotiation.

Method used

An ECDH key negotiation device suitable for security chips is designed, and a pure RTL hardening design scheme is adopted, including a key negotiation top-level module, a random number generator, a register configuration module, a private and public key generation module, an ECDH control module and a point-multiple top-level module, which realizes ECDH key negotiation without relying on the CPU.

Benefits of technology

Through the pure RTL hardening design scheme, the efficiency of ECDH key negotiation is greatly improved, the use of CPU is avoided, and the problem of low key negotiation efficiency in the prior art is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728103A_ABST
    Figure CN119728103A_ABST
Patent Text Reader

Abstract

The invention relates to information security, in particular to an ECDH key negotiation device and method suitable for a security chip, a random number generator which is externally connected with an AMBA bus and can generate a random number according to specific configuration and store the generated random number in an embedded FIFO; the register configuration module is externally connected with an AMBA bus, and the configuration of the register and the enabling / disabling of the interrupt register are completed through the AMBA bus; the private key and public key generation module reads the random number from the random number generator after ECDH key negotiation is started, performs private key detection on the read random number, and takes the random number passing the private key detection as a private key of the party; after the private key of the local party is generated, point multiplication operation on a finite field is carried out on the private key of the local party and the shared base point by calling a point multiplication top layer module so as to generate a public key of the local party; according to the technical scheme provided by the invention, the defects that CPU (Central Processing Unit) cooperation is needed and the ECDH key negotiation efficiency is relatively low in the prior art can be overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to information security, and in particular to an ECDH key negotiation device and method suitable for a security chip. Background Art

[0002] The ECDH (Elliptic Curve Diffie-Hellman) algorithm uses the difficulty of solving the discrete logarithm problem on the elliptic curve in a finite field to construct a key exchange, so that the generated shared key is difficult to crack. Due to the complexity of the ECDH algorithm, the traditional ECDH algorithm is often built based on the CPU core. Its advantage is that it is flexible and convenient to build, but its disadvantages are:

[0003] 1) Limited by the CPU processing speed, the efficiency of completing a key negotiation using the ECDH algorithm is low (often requiring millions of clock cycles);

[0004] 2) Using the ECDH algorithm to build key exchange requires CPU-based cooperation. Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In view of the above-mentioned shortcomings of the prior art, the present invention provides an ECDH key negotiation device and method suitable for a security chip, which can effectively overcome the defects of the prior art that the CPU cooperation is required and the ECDH key negotiation efficiency is low.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0009] An ECDH key agreement device suitable for a security chip, comprising a key agreement top-level module, the key agreement top-level module comprising an ECDH top-level module and a random number generator, the ECDH top-level module comprising a register configuration module, a private key and public key generation module, an ECDH control module and a point multiplication top-level module;

[0010] The random number generator is connected to the AMBA bus and can generate random numbers according to specific configurations and store the generated random numbers in the embedded FIFO;

[0011] Register configuration module, externally connected to the AMBA bus, completes register configuration and enables / disables interrupt registers through the AMBA bus;

[0012] The private key and public key generation module, after the ECDH key negotiation is started, reads the random number from the random number generator, performs a private key test on the read random number, and uses the random number that passes the private key test as the party's private key; after the party's private key is generated, the point multiplication top-level module is called to perform a point multiplication operation on the finite field on the party's private key and the shared base point to generate the party's public key;

[0013] After receiving the other party's public key through the AMBA bus, the ECDH control module performs an assurance test on the other party's public key, and after the assurance test is successful, it calls the point multiplication top-level module to perform a point multiplication operation on the other party's public key and its own private key over a finite field to generate a shared key; after the shared key is generated, a key negotiation result is generated based on the shared key.

[0014] Preferably, after the ECDH key negotiation is started, the private key and public key generation module reads a random number from a random number generator, performs a private key detection on the read random number, and uses the random number that passes the private key detection as the private key of the party, including:

[0015] If the private key detection fails, continue to read random numbers from the random number generator and perform private key detection on the read random numbers until the private key detection succeeds.

[0016] Preferably, the ECDH control module includes a counterpart public key detection module and a KDF key derivation module;

[0017] The other party's public key detection module performs an assurance check on the other party's public key after receiving it through the AMBA bus. If the assurance check succeeds, the dot multiplication top-level module is called to perform a dot multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key. If the assurance check fails, the register configuration module configures the interrupt register INTERRUPT_REG[2] to 1. When the CPU polls the interrupt register INTERRUPT_REG[2] = 1, it notifies the other party to send the public key again.

[0018] After generating the shared key, the KDF key derivation module uses the key derivation function KDF to generate a key negotiation result based on the shared key, and stores the key negotiation result in the register ECDH_RESULT_REG[511:0].

[0019] Preferably, the specific working process of the ECDH key agreement device includes:

[0020] S0, power on, clock signal works;

[0021] S1, reset signal completes asynchronous reset and synchronous release;

[0022] S2, start the random number generator through the AMBA bus to generate random numbers for subsequent use;

[0023] S3. Configure register KDF_OTHERINFO_REG[191:0] through the register configuration module, wherein register KDF_OTHERINFO_REG[191:0] stores communication node information of both parties that need to perform ECDH key negotiation;

[0024] S4. Configure the register CONFIGED_REG[1] to 1 through the register configuration module to start the ECDH top-level module;

[0025] S5. The private key and public key generation module generates the party's private key and the party's public key. After the party's public key is generated, the interrupt register INTERRUPT_REG[1] is automatically set to 1'1b. The party's public key is stored in the register Q_SELF_X_REG[255:0] and the register Q_SELF_Y_REG[255:0]. When the CPU polls the interrupt register INTERRUPT_REG[1] = 1'1b, it reads the party's public key and sends it to the other party.

[0026] S6. After receiving the other party's public key through the AMBA bus, the other party's public key is stored in registers Q_OTHRER_X_REG[255:0] and Q_OTHER_Y_REG[255:0] through the register configuration module, and register CONFIGED_REG[0] is configured to 1, indicating that the other party's public key has been received and written;

[0027] S7, perform assurance check on the other party's public key. If the assurance check succeeds, enter S8; if the assurance check fails, configure the interrupt register INTERRUPT_REG[2] to 1 through the register configuration module. When the CPU polls the interrupt register INTERRUPT_REG[2]=1, it notifies the other party to send the public key again. Before notifying the other party to send the public key again, configure the register CONFIGED_REG[0] to 1'b0 through the register configuration module, and clear the interrupt register INTERRUPT_REG[2] to zero.

[0028] S8, the other party's public key detection module generates a shared key, and the KDF key derivation module generates a key negotiation result;

[0029] S9. When the CPU polls the interrupt register INTERRUPT_REG[0]=1'b1, it indicates that the ECDH key negotiation is completed, and the key negotiation result generated by the KDF key derivation module is stored in the register ECDH_RESULT_REG[511:0]. The key negotiation result can be flexibly truncated by the user as a symmetric key or initialization vector IV and sent to the symmetric algorithm;

[0030] S10. Before the next ECDH key negotiation, clear all interrupt registers in the above steps by configuring the clear interrupt register CLR_INTERRUPT_REG through the register configuration module, and configure the register CONFIGED_REG[2:0] to 3'b0 to complete the reset process.

[0031] An ECDH key negotiation method applicable to a security chip comprises the following steps:

[0032] S1. Both parties in ECDH key negotiation share P-256 elliptic curve parameters, where the P-256 elliptic curve parameters include a shared base point G.

[0033] S2. Both parties in ECDH key negotiation read random numbers from the random number generator, perform private key detection on the random numbers, and use the random numbers that pass the private key detection as their own private keys.

[0034] S3. Both parties in ECDH key negotiation perform point multiplication operations on their own private keys and the shared base point G over a finite field by calling the point multiplication top-level module to generate their own public keys.

[0035] S4. Both parties in ECDH key negotiation send their public keys to each other.

[0036] S5. After receiving the other party's public key, both parties in ECDH key negotiation perform an assurance test on the other party's public key. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key, and the key negotiation result is generated based on the shared key. If the assurance test fails, the process returns to S2, and the party that fails the assurance test regenerates its public key and sends it to the other party.

[0037] Preferably, the two parties in the ECDH key negotiation in S1 share P-256 elliptic curve parameters, including:

[0038] The U end and the V end share P-256 elliptic curve parameters, wherein the P-256 elliptic curve parameters include a shared base point G.

[0039] Preferably, the two parties in the ECDH key negotiation in S2 read a random number from a random number generator, perform a private key detection on the read random number, and use the random number that passes the private key detection as their own private key, including:

[0040] The U side reads the random number from the random number generator, performs a private key check on the random number, and uses the random number that passes the private key check as the U side's private key u;

[0041] At the same time, the V side reads a random number from the random number generator, performs a private key check on the random number read, and uses the random number that passes the private key check as the V side's private key v.

[0042] Preferably, the two parties in the ECDH key negotiation in S3 perform a point multiplication operation on their own private key and the shared base point G over a finite field by calling the point multiplication top-level module to generate their own public key, including:

[0043] The U side calls the point multiplication top-level module to perform a point multiplication operation on the U side's private key u and the shared base point G on a finite field to generate the U side's public key uG;

[0044] At the same time, the V side calls the point multiplication top-level module to perform a point multiplication operation on the V party's private key v and the shared base point G over a finite field to generate the V party's public key vG.

[0045] Preferably, in S4, both parties of the ECDH key negotiation send their public keys to each other, including:

[0046] The U end sends the public key uG to the V end;

[0047] At the same time, V sends V's public key vG to U.

[0048] Preferably, after receiving the other party's public key, both parties in the ECDH key negotiation in S5 perform an assurance test on the other party's public key. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key, and a key negotiation result is generated based on the shared key; if the assurance test fails, the process returns to S2, and the party that fails the assurance test regenerates its public key and sends it to the other party, including:

[0049] After receiving the public key vG of Party V sent by Party V, the U end performs an assurance test on the public key vG of Party V. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the public key vG of Party V and the private key u of Party U on a finite field to generate a shared key uvG, and the key derivation function KDF is used to generate the key negotiation result ecdh_out_u according to the shared key uvG; if the assurance test fails, it returns to S2, and the V end regenerates the public key vG of Party V and sends it to the U end;

[0050] At the same time, after receiving the U public key uG sent by the U end, the V end performs an assurance check on the U public key uG. If the assurance check is successful, the point multiplication top-level module is called to perform a point multiplication operation on the U public key uG and the V private key v over a finite field to generate a shared key vuG, and the key derivation function KDF is used to generate the key negotiation result ecdh_out_v based on the shared key vuG; if the assurance check fails, it returns to S2, and the U end regenerates the U public key uG and sends it to the V end.

[0051] (III) Beneficial effects

[0052] Compared with the prior art, the ECDH key negotiation device and method suitable for a security chip provided by the present invention adopts a pure RTL hardening design scheme and does not rely on the calculation assistance of the CPU, thereby avoiding the use of the CPU and greatly improving the efficiency of the ECDH key negotiation. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0054] Figure 1 It is a system schematic diagram of the ECDH key agreement device in the present invention;

[0055] Figure 2 It is a flow chart of the ECDH key negotiation method in the present invention;

[0056] Figure 3 It is a schematic diagram of the working process of the ECDH key agreement device in the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] An ECDH key agreement device suitable for a security chip, such as Figure 1 As shown, it includes a key negotiation top-level module, the key negotiation top-level module includes an ECDH top-level module and a random number generator, and the ECDH top-level module includes a register configuration module, a private key and public key generation module, an ECDH control module, and a point multiplication top-level module;

[0059] The random number generator is connected to the AMBA bus and can generate random numbers according to specific configurations and store the generated random numbers in the embedded FIFO;

[0060] Register configuration module, externally connected to the AMBA bus, completes register configuration and enables / disables interrupt registers through the AMBA bus;

[0061] The private key and public key generation module, after the ECDH key negotiation is started, reads the random number from the random number generator, performs a private key test on the read random number, and uses the random number that passes the private key test as the party's private key; after the party's private key is generated, the point multiplication top-level module is called to perform a point multiplication operation on the finite field on the party's private key and the shared base point to generate the party's public key;

[0062] After receiving the other party's public key through the AMBA bus, the ECDH control module performs an assurance test on the other party's public key, and after the assurance test is successful, it calls the point multiplication top-level module to perform a point multiplication operation on the other party's public key and its own private key over a finite field to generate a shared key; after the shared key is generated, a key negotiation result is generated based on the shared key.

[0063] ① The register configuration module is connected to the AMBA bus, and the register configuration and interrupt register enable / disable are completed through the AMBA bus. According to the AMBA bus interface (32-bit width), the registers involved in the technical solution of this application are as follows:

[0064] Table 1 Register Q_SELF_X_REG Function Description

[0065]

[0066] Table 2 Register Q_SELF_Y_REG Function Description

[0067]

[0068]

[0069] Table 3 Register Q_OTHER_X_REG Function Description

[0070]

[0071] Table 4 Register Q_OTHER_Y_REG Function Description

[0072]

[0073] Table 5 Register KDF_OTHERINFO_REG Function Description

[0074]

[0075] Table 6 Register ECDH_RESULT_REG Function Description

[0076]

[0077]

[0078] Table 7 Interrupt register INTERRUPT_REG function description

[0079]

[0080] Table 8 Clear interrupt register CLR_INTERRUPT_REG function description

[0081]

[0082] Table 9 Register CONFIGED_REG Function Description

[0083]

[0084]

[0085] ② After the ECDH key negotiation is started, the private key and public key generation module reads the random number from the random number generator, performs a private key test on the read random number, and uses the random number that passes the private key test as the private key of the party, including:

[0086] If the private key detection fails, continue to read random numbers from the random number generator and perform private key detection on the read random numbers until the private key detection succeeds.

[0087] ③ECDH control module includes the other party's public key detection module and KDF key derivation module;

[0088] The other party's public key detection module performs an assurance check on the other party's public key after receiving it through the AMBA bus. If the assurance check succeeds, the other party's public key and the private key are multiplied on a finite field by calling the point multiplication top-level module to generate a shared key. If the assurance check fails (a transmission error may have occurred, or a public key transmission error may have occurred due to an attack), the interrupt register INTERRUPT_REG[2] is configured to 1 through the register configuration module. When the CPU polls the interrupt register INTERRUPT_REG[2] = 1, it notifies the other party to send the public key again.

[0089] After generating the shared key, the KDF key derivation module uses the key derivation function KDF to generate a key negotiation result based on the shared key, and stores the key negotiation result in the register ECDH_RESULT_REG[511:0].

[0090] In the technical solution of this application, the specific working process of the ECDH key agreement device is as follows: Figure 3 As shown, specifically including:

[0091] S0, power on, clock signal works;

[0092] S1, reset signal completes asynchronous reset and synchronous release;

[0093] S2, start the random number generator through the AMBA bus to generate random numbers for subsequent use;

[0094] S3. Configure register KDF_OTHERINFO_REG[191:0] through the register configuration module, wherein register KDF_OTHERINFO_REG[191:0] stores communication node information of both parties that need to perform ECDH key negotiation;

[0095] S4. Configure the register CONFIGED_REG[1] to 1 through the register configuration module to start the ECDH top-level module;

[0096] S5. The private key and public key generation module generates the party's private key and the party's public key. After the party's public key is generated, the interrupt register INTERRUPT_REG[1] is automatically set to 1'1b. The party's public key is stored in the register Q_SELF_X_REG[255:0] and the register Q_SELF_Y_REG[255:0]. When the CPU polls the interrupt register INTERRUPT_REG[1] = 1'1b, it reads the party's public key and sends it to the other party.

[0097] S6. After receiving the other party's public key through the AMBA bus, the other party's public key is stored in registers Q_OTHRER_X_REG[255:0] and Q_OTHER_Y_REG[255:0] through the register configuration module, and register CONFIGED_REG[0] is configured to 1, indicating that the other party's public key has been received and written;

[0098] S7, perform assurance check on the other party's public key. If the assurance check succeeds, enter S8; if the assurance check fails, configure the interrupt register INTERRUPT_REG[2] to 1 through the register configuration module. When the CPU polls the interrupt register INTERRUPT_REG[2]=1, it notifies the other party to send the public key again. Before notifying the other party to send the public key again, configure the register CONFIGED_REG[0] to 1'b0 through the register configuration module, and clear the interrupt register INTERRUPT_REG[2] to zero.

[0099] S8, the other party's public key detection module generates a shared key, and the KDF key derivation module generates a key negotiation result;

[0100] S9. When the CPU polls the interrupt register INTERRUPT_REG[0]=1'b1, it indicates that the ECDH key negotiation is completed, and the key negotiation result generated by the KDF key derivation module is stored in the register ECDH_RESULT_REG[511:0]. The key negotiation result can be flexibly truncated by the user as a symmetric key or initialization vector IV and sent to the symmetric algorithm;

[0101] S10. Before the next ECDH key negotiation, clear all interrupt registers in the above steps by configuring the clear interrupt register CLR_INTERRUPT_REG through the register configuration module, and configure the register CONFIGED_REG[2:0] to 3'b0 to complete the reset process.

[0102] In the technical solution of this application, on the basis of the ECDH key negotiation device applicable to the security chip disclosed above, an ECDH key negotiation method applicable to the security chip is also disclosed, which meets the key negotiation NIST standard stipulated by the International Cryptography Association, such as Figure 2 As shown, the following steps are included:

[0103] S1. Both parties in ECDH key negotiation share P-256 elliptic curve parameters (P-256 elliptic curve recommended by the International Cryptography Association), where the P-256 elliptic curve parameters include a shared base point G;

[0104] S2. Both parties in ECDH key negotiation read random numbers from the random number generator, perform private key detection on the random numbers, and use the random numbers that pass the private key detection as their own private keys.

[0105] S3. Both parties in ECDH key negotiation perform point multiplication operations on their own private keys and the shared base point G over a finite field by calling the point multiplication top-level module to generate their own public keys.

[0106] S4. Both parties in ECDH key negotiation send their public keys to each other.

[0107] S5. After receiving the other party's public key, both parties in ECDH key negotiation perform an assurance test on the other party's public key. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key, and the key negotiation result is generated based on the shared key. If the assurance test fails, the process returns to S2, and the party that fails the assurance test regenerates its public key and sends it to the other party.

[0108] In S1, both parties in ECDH key negotiation share the P-256 elliptic curve parameters, including:

[0109] The U end and the V end share P-256 elliptic curve parameters, wherein the P-256 elliptic curve parameters include a shared base point G.

[0110] In S2, both parties in the ECDH key negotiation read random numbers from the random number generator, perform private key detection on the random numbers read, and use the random numbers that pass the private key detection as their own private keys, including:

[0111] The U side reads the random number from the random number generator, performs a private key check on the random number, and uses the random number that passes the private key check as the U side's private key u;

[0112] At the same time, the V side reads a random number from the random number generator, performs a private key check on the random number read, and uses the random number that passes the private key check as the V side's private key v.

[0113] In S3, both parties in ECDH key negotiation perform point multiplication operations on their own private keys and the shared base point G over a finite field by calling the point multiplication top-level module to generate their own public keys, including:

[0114] The U side calls the point multiplication top-level module to perform a point multiplication operation on the U side's private key u and the shared base point G on a finite field to generate the U side's public key uG;

[0115] At the same time, the V side calls the point multiplication top-level module to perform a point multiplication operation on the V party's private key v and the shared base point G over a finite field to generate the V party's public key vG.

[0116] In S4, both parties in ECDH key negotiation send their public keys to each other, including:

[0117] The U end sends the public key uG to the V end;

[0118] At the same time, V sends V's public key vG to U.

[0119] In S5, after receiving the other party's public key, both parties in the ECDH key negotiation perform an assurance test on the other party's public key. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the other party's public key and the party's private key on a finite field to generate a shared key, and the key negotiation result is generated based on the shared key; if the assurance test fails, the process returns to S2, and the party that fails the assurance test regenerates its public key and sends it to the other party, including:

[0120] After receiving the public key vG of Party V sent by Party V, the U end performs an assurance test on the public key vG of Party V. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the public key vG of Party V and the private key u of Party U on a finite field to generate a shared key uvG, and the key derivation function KDF is used to generate the key negotiation result ecdh_out_u according to the shared key uvG; if the assurance test fails, it returns to S2, and the V end regenerates the public key vG of Party V and sends it to the U end;

[0121] At the same time, after receiving the U public key uG sent by the U end, the V end performs an assurance check on the U public key uG. If the assurance check is successful, the point multiplication top-level module is called to perform a point multiplication operation on the U public key uG and the V private key v over a finite field to generate a shared key vuG, and the key derivation function KDF is used to generate the key negotiation result ecdh_out_v based on the shared key vuG; if the assurance check fails, it returns to S2, and the U end regenerates the U public key uG and sends it to the V end.

[0122] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An ECDH key agreement device suitable for a security chip, characterized in that: It includes a key negotiation top-level module, the key negotiation top-level module includes an ECDH top-level module and a random number generator, the ECDH top-level module includes a register configuration module, a private key and public key generation module, an ECDH control module and a point multiplication top-level module; The random number generator is connected to the AMBA bus and can generate random numbers according to specific configurations and store the generated random numbers in the embedded FIFO; Register configuration module, externally connected to the AMBA bus, completes register configuration and enables / disables interrupt registers through the AMBA bus; The private key and public key generation module, after the ECDH key negotiation is started, reads the random number from the random number generator, performs a private key test on the read random number, and uses the random number that passes the private key test as the party's private key; after the party's private key is generated, the point multiplication top-level module is called to perform a point multiplication operation on the finite field on the party's private key and the shared base point to generate the party's public key; After receiving the other party's public key through the AMBA bus, the ECDH control module performs an assurance test on the other party's public key, and after the assurance test is successful, it calls the point multiplication top-level module to perform a point multiplication operation on the other party's public key and its own private key over a finite field to generate a shared key; after the shared key is generated, a key negotiation result is generated based on the shared key.

2. The ECDH key agreement device applicable to a security chip according to claim 1, characterized in that: After the ECDH key negotiation is started, the private key and public key generation module reads a random number from the random number generator, performs a private key detection on the read random number, and uses the random number that passes the private key detection as the private key of the party, including: If the private key detection fails, continue to read random numbers from the random number generator and perform private key detection on the read random numbers until the private key detection succeeds.

3. The ECDH key agreement device applicable to a security chip according to claim 1, characterized in that: The ECDH control module includes a counterpart public key detection module and a KDF key derivation module; The other party's public key detection module performs an assurance check on the other party's public key after receiving it through the AMBA bus. If the assurance check succeeds, the dot multiplication top-level module is called to perform a dot multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key. If the assurance check fails, the register configuration module configures the interrupt register INTERRUPT_REG[2] to 1. When the CPU polls the interrupt register INTERRUPT_REG[2] = 1, it notifies the other party to send the public key again. After generating the shared key, the KDF key derivation module uses the key derivation function KDF to generate a key negotiation result based on the shared key, and stores the key negotiation result in the register ECDH_RESULT_REG[511:0].

4. The ECDH key agreement device applicable to a security chip according to claim 1, characterized in that: The specific working process of the ECDH key agreement device includes: S0, power on, clock signal works; S1, reset signal completes asynchronous reset and synchronous release; S2, start the random number generator through the AMBA bus to generate random numbers for subsequent use; S3. Configure register KDF_OTHERINFO_REG[191:0] through a register configuration module, wherein register KDF_OTHERINFO_REG[191:0] stores communication node information of both parties that need to perform ECDH key negotiation; S4. Configure the register CONFIGED_REG[1] to 1 through the register configuration module to start the ECDH top-level module; S5. The private key and public key generation module generates the party's private key and the party's public key. After the party's public key is generated, the interrupt register INTERRUPT_REG[1] is automatically set to 1'1b. The party's public key is stored in the register Q_SELF_X_REG[255:0] and the register Q_SELF_Y_REG[255:0]. When the CPU polls the interrupt register INTERRUPT_REG[1] = 1'1b, it reads the party's public key and sends it to the other party. S6. After receiving the other party's public key through the AMBA bus, the other party's public key is stored in registers Q_OTHRER_X_REG[255:0] and Q_OTHER_Y_REG[255:0] through the register configuration module, and register CONFIGED_REG[0] is configured to 1, indicating that the other party's public key has been received and written; S7, perform assurance check on the other party's public key. If the assurance check succeeds, enter S8; if the assurance check fails, configure the interrupt register INTERRUPT_REG[2] to 1 through the register configuration module. When the CPU polls the interrupt register INTERRUPT_REG[2]=1, it notifies the other party to send the public key again. Before notifying the other party to send the public key again, configure the register CONFIGED_REG[0] to 1'b0 through the register configuration module, and clear the interrupt register INTERRUPT_REG[2] to zero. S8, the other party's public key detection module generates a shared key, and the KDF key derivation module generates a key negotiation result; S9. When the CPU polls the interrupt register INTERRUPT_REG[0]=1'b1, it indicates that the ECDH key negotiation is completed, and the key negotiation result generated by the KDF key derivation module is stored in the register ECDH_RESULT_REG[511:0]. The key negotiation result can be flexibly truncated by the user as a symmetric key or initialization vector IV and sent to the symmetric algorithm; S10. Before the next ECDH key negotiation, clear all interrupt registers in the above steps by configuring the clear interrupt register CLR_INTERRUPT_REG through the register configuration module, and configure the register CONFIGED_REG[2:0] to 3'b0 to complete the reset process.

5. An ECDH key agreement method applicable to a security chip, applied to the ECDH key agreement device applicable to a security chip according to claim 1, characterized in that: The following steps are involved: S1. Both parties in ECDH key negotiation share P-256 elliptic curve parameters, where the P-256 elliptic curve parameters include a shared base point G. S2. Both parties in ECDH key negotiation read random numbers from the random number generator, perform private key detection on the random numbers, and use the random numbers that pass the private key detection as their own private keys. S3. Both parties in ECDH key negotiation perform point multiplication operations on their own private keys and the shared base point G over a finite field by calling the point multiplication top-level module to generate their own public keys. S4. Both parties in ECDH key negotiation send their public keys to each other. S5. After receiving the other party's public key, both parties in ECDH key negotiation perform an assurance test on the other party's public key. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key, and the key negotiation result is generated based on the shared key. If the assurance test fails, the process returns to S2, and the party that fails the assurance test regenerates its public key and sends it to the other party.

6. The ECDH key negotiation method applicable to a security chip according to claim 5, characterized in that: In S1, both parties in ECDH key negotiation share the P-256 elliptic curve parameters, including: The U end and the V end share P-256 elliptic curve parameters, wherein the P-256 elliptic curve parameters include a shared base point G.

7. The ECDH key negotiation method applicable to a security chip according to claim 6, characterized in that: In S2, both parties in the ECDH key negotiation read random numbers from the random number generator, perform private key detection on the random numbers read, and use the random numbers that pass the private key detection as their own private keys, including: The U side reads the random number from the random number generator, performs a private key check on the random number, and uses the random number that passes the private key check as the U side's private key u; At the same time, the V side reads a random number from the random number generator, performs a private key check on the random number read, and uses the random number that passes the private key check as the V side's private key v.

8. The ECDH key negotiation method applicable to a security chip according to claim 7, characterized in that: In S3, both parties in ECDH key negotiation perform point multiplication operations on their own private keys and the shared base point G over a finite field by calling the point multiplication top-level module to generate their own public keys, including: The U side calls the point multiplication top-level module to perform a point multiplication operation on the U side's private key u and the shared base point G on a finite field to generate the U side's public key uG; At the same time, the V side calls the point multiplication top-level module to perform a point multiplication operation on the V party's private key v and the shared base point G over a finite field to generate the V party's public key vG.

9. The ECDH key negotiation method applicable to a security chip according to claim 8, characterized in that: In S4, both parties in ECDH key negotiation send their public keys to each other, including: The U end sends the public key uG to the V end; At the same time, V sends V's public key vG to U.

10. The ECDH key negotiation method applicable to a security chip according to claim 9, characterized in that: In S5, after receiving the other party's public key, both parties in the ECDH key negotiation perform an assurance test on the other party's public key. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the other party's public key and the party's private key over a finite field to generate a shared key, and the key negotiation result is generated based on the shared key. If the assurance test fails, the process returns to S2, and the party that failed the assurance test regenerates its public key and sends it to the other party, including: After receiving the public key vG of Party V sent by Party V, the U end performs an assurance test on the public key vG of Party V. If the assurance test succeeds, the point multiplication top-level module is called to perform a point multiplication operation on the public key vG of Party V and the private key u of Party U on a finite field to generate a shared key uvG, and the key derivation function KDF is used to generate the key negotiation result ecdh_out_u according to the shared key uvG; if the assurance test fails, it returns to S2, and the V end regenerates the public key vG of Party V and sends it to the U end; At the same time, after receiving the U public key uG sent by the U end, the V end performs an assurance check on the U public key uG. If the assurance check is successful, the point multiplication top-level module is called to perform a point multiplication operation on the U public key uG and the V private key v over a finite field to generate a shared key vuG, and the key derivation function KDF is used to generate the key negotiation result ecdh_out_v based on the shared key vuG; if the assurance check fails, it returns to S2, and the U end regenerates the U public key uG and sends it to the V end.

Citation Information

Patent Citations

  • Encrypted communication method and system based on Internet of Things terminal

    CN113784342A

  • Processing method and device for multi-party security computing

    CN115765985A

  • Two-party collaborative key exchange method, device and system and medium

    CN116192374A

  • Electronic voting system and method thereof

    KR1020190125223A