SM2 Key Negotiation Parameter W Calculation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The complexity and time-consuming nature of calculating the parameter W in the SM2 key exchange protocol, particularly due to the need to solve for the logarithm value of the elliptic curve parameter n and perform rounding operations, significantly reduce the implementation efficiency and increase complexity in key negotiation procedures.
Innovation Solution
Calculating the minimum positive integer value X such that n ≤ 2^x, and using this value to determine the parameter W, thereby simplifying the key negotiation process and reducing computational overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the parameter W is calculated by solving the logarithm value of the elliptic curve parameter n and performing rounding operations, then the key negotiation follows the SM2 protocol specification, but the computational complexity increases and implementation efficiency decreases
Solution Approach 1:
The patent changes the calculation parameter from the mathematical logarithm function to a simple bit-length operation. Instead of computing log2(n) and rounding, the invention directly uses the bit length of n (denoted as 'n_bits') to calculate W = (n_bits - 1) / 2. This parameter substitution maintains protocol compliance while dramatically reducing computational complexity from O(log n) to O(1).
Solution Approach 2:
The patent replaces the complex mathematical computation mechanism (logarithm calculation and rounding operations) with a simpler information processing mechanism (bit length determination and integer division). This substitution eliminates the need for iterative mathematical algorithms and replaces them with a direct bitwise operation that is inherently more efficient in computational systems.
2Measurement precision
If the parameter W is calculated using the logarithm function and rounding operations, then the calculation follows the mathematical definition, but the implementation complexity increases
Solution Approach 1:
The invention changes the computational parameter from a continuous mathematical function (logarithm) to a discrete computational property (bit length). The formula W = (n_bits - 1) / 2 where n_bits is the bit length of n, replaces the complex log2(n) rounded up operation. This parameter transformation maintains the essential mathematical relationship while eliminating implementation complexity.
3Reliability
If the existing key negotiation procedure is implemented with the standard logarithm-based W calculation, then the protocol security is maintained, but the time consumption increases
Solution Approach 1:
The patent performs a preliminary simplification of the W calculation by pre-determining it based solely on the bit length of n, which is a fixed parameter of the elliptic curve. This preliminary calculation eliminates the need for complex logarithmic computations during the actual key negotiation process, thereby reducing time consumption without affecting security.
Data Source
Figure 1A~1B
Figure 2
Figure 3
AI summary
The invention relates to the technical field of information, and disclosed in the present invention are a key negotiation method and apparatus according to the SM2 key exchange protocol. The method is implemented as follows: two negotiation parties both calculate a parameter W according to the minimum positive integer value in the permissible values of X which enable an inequality n ≤ 2x to hold, and perform key negotiation with the opposite negotiation party according to the parameter W. Compared with a method for calculating the parameter W through calculating log2 (n) logarithmic value firstly and then rounding up the logarithmic value, the method disclosed by the invention has the advantages that the calculated amount is effectively reduced, and the implementation complexity of an algorithm is reduced, thereby greatly improving the implementation efficiency of the key negotiation process based on the SM2 key exchange protocol, and then optimizing the engineering implementation of the SM2 key exchange protocol.