Scalar multiplication operation system and method based on Montgomery

By optimizing the scalar multiplication process using a Montgomery-based scalar multiplication system, parallel computation was achieved, solving the problem of high complexity in scalar multiplication and improving the computational efficiency of the elliptic cryptography algorithm.

CN121887397APending Publication Date: 2026-04-17INST OF ACOUSTICS CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF ACOUSTICS CHINESE ACAD OF SCI
Filing Date
2024-10-15
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing elliptic curve cryptography-based encryption, decryption, signature, and key exchange functions, scalar multiplication computations are computationally complex and time-consuming, becoming a bottleneck for performance optimization.

Method used

A scalar multiplication system based on Montgomery is adopted, including a scalar multiplication controller module, a point addition calculation module, a point multiplication calculation module, a projected coordinate transformation module, and a y-coordinate calculation module. The scalar multiplication process is optimized by performing parallel multiplication and modular reduction operations.

Benefits of technology

It significantly improves the efficiency of scalar multiplication, reduces the waste of computing resources, is applicable to fixed-point and random-point scalar multiplication, and improves the performance of elliptic cryptography algorithms in signing, verifying signatures, encryption and decryption, and key negotiation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121887397A_ABST
    Figure CN121887397A_ABST
Patent Text Reader

Abstract

The invention provides a scalar multiplication operation system and method based on Montgomery, and relates to the field of cryptographic algorithm implementation. According to the technical scheme, a Montgomery scalar multiplication algorithm is adopted to execute point addition and point multiplication operation in parallel, in the operation process, participation of y coordinates is not needed, only one-time y coordinate operation needs to be carried out after the point addition and point multiplication operation is finished, data independence in the point addition and point multiplication operation process is analyzed, the proposed scheduling process is adopted, and the scheduling efficiency is improved. The parallelism of multiplication and modular reduction operation can be remarkably improved, and the calculation efficiency of the algorithm is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of elliptic curve cryptography, specifically relating to a scalar multiplication system and method based on Montgomery. Background Technology

[0002] Elliptic Curve Cryptography (ECC) is a public-key encryption technique based on the mathematical structure of elliptic curves, widely used in modern information security. The core of ECC lies in using point operations on elliptic curves to achieve encryption, decryption, signing, and key exchange. Compared to traditional public-key encryption algorithms such as RSA, ECC requires shorter key lengths and is more computationally efficient while providing the same level of security, making it particularly suitable for resource-constrained environments. SM2 is a national standard public-key encryption algorithm based on ECC, released by the State Cryptography Administration of China. Its design references internationally mature ECC algorithms and is suitable for applications such as digital signatures, key exchange, and public-key encryption.

[0003] In ECC, scalar multiplication is one of the most important and time-consuming operations, involving multiplying a point on an elliptic curve by a scalar. Due to the high computational complexity of scalar multiplication, efficiently implementing this operation is key to optimizing ECC performance. Summary of the Invention

[0004] The purpose of this application is to overcome the shortcomings of existing ECC-based encryption, decryption, signature and key exchange functions, which have high computational complexity and long processing time due to scalar multiplication.

[0005] To achieve the above objectives, this application proposes a scalar multiplication system based on Montgomery for cryptographic applications based on elliptic cryptography. The system includes:

[0006] The scalar multiplication controller module is used to input a random number k and a point p on the elliptic curve, and control other modules to complete the Montgomery scalar multiplication operation to obtain kP, where P is the projective coordinate of p.

[0007] The point addition calculation module is used to calculate P+Q on input points P and Q; the initial value of point Q is 0; only the X and Z coordinates are needed during the calculation.

[0008] The point multiplication calculation module is used to calculate P = 2P for an input point P; only the X and Z coordinates are needed during the calculation process.

[0009] The projection coordinate transformation module is used to transform the X coordinates of the final result points P and Q from the projective coordinate system to the affine coordinate system in the point addition and doubling calculation.

[0010] The y-coordinate calculation module is used for scalar multiplication of the desired y-coordinate, performing the scalar multiplication operation and outputting kP; and

[0011] The calculation module includes two sets of multiplier units, a modular reduction and subtraction unit, and a modular addition and subtraction unit, which are used to complete the modular multiplication and modular addition and subtraction operations in point addition and doubling point operations.

[0012] As an improvement to the above system, the implementation process of the scalar multiplication controller module includes:

[0013] After obtaining the random number k and the affine coordinates (x1, y1) of a point p on the elliptic curve, the point p is converted into projective coordinates P(X1, Y1, 1). First, the point addition and doubling calculation modules are called in parallel to perform point addition and doubling operations to obtain P(X1, Z1) and Q(X2, Z2) in projective coordinates. Then, the projection coordinate transformation module is called to perform coordinate transformation, converting the projective coordinates to affine coordinates to obtain the x-coordinate. Finally, the y-coordinate calculation module is called to obtain the desired y-coordinate according to the y-coordinate calculation formula.

[0014] As an improvement to the above system, the implementation process of the point addition calculation module includes:

[0015] Shift the random number k logically left by one bit. If the highest bit is 1, calculate Q = P + Q using dot addition. If the highest bit is 0, calculate P = P + Q using dot addition. After the calculation, shift k logically left by one bit again. Repeat the above steps until the random number k has been completely shifted logically left.

[0016] The calculation formula is:

[0017]

[0018] Where X(P+Q) represents the X-coordinate of the projective coordinate system after point addition; Z(P+Q) represents the Z-coordinate of the projective coordinate system after point addition; a and b represent the elliptic curve parameters; x P Let x be the x-coordinate of point p in the initial affine coordinate system.

[0019] As an improvement to the above system, the calculation process of the point addition calculation module includes:

[0020] Step 1: Perform a multiplication operation on Z1 and Z2, and put the result into the multiplication register;

[0021] Step 2: Perform a multiplication operation on X1 and X2, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1;

[0022] Step 3: Perform a multiplication operation on X1 and Z2, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 2; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo addition register 1.

[0023] Step 4: Perform a multiplication operation on X2 and Z1, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 2; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 2.

[0024] Step 5: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 3; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 1;

[0025] Step 6: Perform a modulo addition operation on the result stored in Modulo-minus register 2 and the result stored in Modulo-minus register 3, and put the result into Modulo-addition / subtraction register 2;

[0026] Step 7: Perform a multiplication operation on the result stored in Modulo-subtraction register 1 and the result stored in Modulo-addition register 2, and put the result into the multiplication register;

[0027] Step 8: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 3, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 1; perform a modulo subtraction operation on the result stored in Modulo Reduction / Subtraction Register 2 and the result stored in Modulo Reduction / Subtraction Register 3, and put the result into Modulo Addition / Subtraction Register 2.

[0028] Step 9: Perform a multiplication operation on the result stored in Modulo addition / subtraction register 2 and the result stored in Modulo addition / subtraction register 2, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo reduction / subtraction register 2;

[0029] Step 10: Perform a multiplication operation on 4b and the result stored in Modulo-reduction register 1, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 3;

[0030] Step 11: Set x p Perform a multiplication operation on the result stored in the modulo reduction register 3, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1;

[0031] Step 12: Perform a modulo reduction operation on the result stored in the multiplication register to obtain Z; perform a modulo reduction operation on the result stored in the second modulo reduction register and the result stored in the first modulo reduction register to obtain X.

[0032] As an improvement to the above system, the implementation process of the multiplier calculation module includes:

[0033] Shift the random number k logically left by one bit. If the highest bit is 1, calculate P = 2P using dot addition. If the highest bit is 0, calculate Q = 2Q using dot addition. After the calculation, shift k logically left by one bit again. Repeat the above steps until the random number k has been completely shifted logically left.

[0034] The calculation formula is:

[0035]

[0036] Where X(2P) represents the X coordinate of the projective coordinate system after doubling the points; Z(2P) represents the Z coordinate of the projective coordinate system after doubling the points; and a and b represent the elliptic curve parameters.

[0037] As an improvement to the above system, the calculation process of the multiplier calculation module includes:

[0038] Step 1: Perform a multiplication operation on Z1 and Z2, and put the result into the multiplication register;

[0039] Step 2: Perform a multiplication operation on X1 and X1, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1;

[0040] Step 3: Perform a multiplication operation on b and the result stored in Modulo-reduction register 1, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 2; perform a modulo-add operation on the result stored in Modulo-reduction register 1 and the result stored in Modulo-reduction register 1, and put the result into Modulo-addition / subtraction register 1.

[0041] Step 4: Perform a multiplication operation on X1 and Z1, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 2; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 2.

[0042] Step 5: Perform a multiplication operation on the result stored in Modulo-subtraction register 1 and the result stored in Modulo-subtraction register 3, and put the result into the multiplication register; perform a modulo-subtraction operation on the result stored in the multiplication register, and put the result into Modulo-subtraction register 3; perform a modulo-addition operation on the result stored in Modulo-addition register 1 and the result stored in Modulo-addition register 2, and put the result into Modulo-addition register 1.

[0043] Step 6: Perform a multiplication operation on the result stored in Modulo-reduction register 1 and the result stored in Modulo-reduction register 3, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 1;

[0044] Step 7: Perform a multiplication operation on the result stored in Modulo-reduction register 2 and the result stored in Modulo-reduction register 3, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 2;

[0045] Step 8: Perform a multiplication operation on the result stored in p-3 and the modulo reduction register 2, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 3;

[0046] Step 9: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 3, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 1; perform a modulo addition operation on the result stored in Modulo Reduction / Subtraction Register 1 and the result stored in Modulo Reduction / Subtraction Register 3, and put the result into Modulo Addition / Subtraction Register 1.

[0047] Step 10: Perform a multiplication operation on 8b and the result stored in Modulo Addition / Subtraction Register 2, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 2; perform a modulo addition operation on the result stored in Modulo Reduction / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 1, and put the result into Modulo Addition / Subtraction Register 1.

[0048] Step 11: Perform a multiplication operation on the result stored in the modulo addition / subtraction register 1, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into the modulo reduction / subtraction register 3;

[0049] Step 12: Perform a modulo reduction operation on the result stored in the multiplication register to obtain Z; perform a modulo reduction operation on the result stored in the second modulo reduction register and the result stored in the third modulo reduction register to obtain X.

[0050] As an improvement to the above system, the implementation steps of the projection coordinate transformation module are as follows: the result of adding and doubling the points is used to calculate the modular inverse T1 = Z1 using the extended Euclidean algorithm.-1 mod p and T2 = Z2 -1 Mod p, then calculate x1 = X1T1 mod p and x2 = X2T2 mod p to get x1 and x2; where x2 is the scalar multiplied by the x-coordinate to be found.

[0051] As an improvement to the above system, the implementation steps of the y-coordinate calculation module are as follows: First, calculate 2y using the extended Euclidean algorithm. p -1 The coordinate transformation results x1 and x2 from the projection coordinate transformation module are calculated based on the y coordinate, and finally the scalar multiplied by the desired y coordinate is obtained.

[0052] The calculation formula is:

[0053] Y(P)=2y p -1 (2b+(a+x p x1)(x p +x1)-x2(x p -x1) 2 )

[0054] Where Y(P) represents the Y-coordinate of the final projective coordinate system; a and b represent the elliptic curve parameters; y P Let x be the y-coordinate of point p in the initial affine coordinate system; P Let x be the x-coordinate of point p in the initial affine coordinate system.

[0055] As an improvement to the above system, the calculation process of the y-coordinate calculation module is as follows:

[0056] Step 1: Set x1 and x p Perform a multiplication operation and place the result into the multiplication register; then compare x1 with x... p Perform a modular subtraction operation and place the result into the modular addition / subtraction register 1.

[0057] Step 2: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 1, and place the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and place the result into Modulo Reduction / Subtraction Register 1; x1 and x p Perform a modular addition operation and place the result into the modular addition / subtraction register 1.

[0058] Step 3: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; perform a modulo addition operation on 'a' and the result stored in the modulo reduction register 1, and put the result into the modulo addition register 2;

[0059] Step 4: Perform a multiplication operation on x2 and the result stored in the modulo reduction register, and put the result into the multiplication register;

[0060] Step 5: Perform a multiplication operation on the result stored in Modulo addition / subtraction register 1 and the result stored in Modulo addition / subtraction register 2, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo reduction / subtraction register 1;

[0061] Step 6: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; perform a modulo addition operation on 2b and the result stored in the modulo reduction register 1, and put the result into the modulo addition register 1;

[0062] Step 7: Perform a modulo addition operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Decrease / Subtraction Register 1, and put the result into Modulo Addition / Subtraction Register 1;

[0063] Step 8: Store the result and sum in the modulo-addition / subtraction register. Perform a multiplication operation and place the result into the multiplication register;

[0064] Step 9: Perform a modulo reduction operation on the result stored in the multiplication register. The result is the scalar multiplied by the desired y-coordinate.

[0065] This application also provides a scalar multiplication method based on Montgomery, implemented based on the above system, the method comprising:

[0066] The scalar multiplication controller module obtains the random number k and the affine coordinates (x1, y1) of a point p on the elliptic curve. After converting point p into projective coordinates P(X1, Y1, 1), it first calls the point addition calculation module and the point multiplication calculation module to perform point addition and point multiplication operations in parallel to obtain P(X1, Z1) and Q(X2, Z2) in projective coordinates. Then, it calls the projection coordinate transformation module to perform coordinate transformation, converting the projective coordinates to affine coordinates to obtain the x-coordinate required by the scalar multiplication. Finally, it calls the y-coordinate calculation module to obtain the y-coordinate required by the scalar multiplication according to the y-coordinate calculation formula.

[0067] Compared with existing technologies, the advantages of this application are:

[0068] 1. By analyzing the data independence in the point addition and doubling operations, the proposed scheduling process can maximize the parallel computation of multiplication and modulo reduction.

[0069] 2. No pre-computation or pre-coding is required, reducing waste of computing and storage resources.

[0070] 3. It is applicable to both fixed-point and random-point scalar multiplication, which can significantly improve the efficiency of scalar multiplication operations, thereby improving the performance of elliptic cryptography algorithms in signature verification, encryption / decryption, and key negotiation operations. Attached Figure Description

[0071] Figure 1 The diagram shows a flowchart of the scalar multiplication method based on Montgomery. Detailed Implementation

[0072] The technical solution of this application will be described in detail below with reference to the accompanying drawings.

[0073] This application proposes a scalar multiplication system and method based on Montgomery, aiming to further improve the performance of ECC and SM2 algorithms in practical applications. By optimizing the operation scheduling of Montgomery scalar multiplication, the number of computation steps can be effectively reduced, the operation speed can be improved, and the energy consumption can be reduced. This optimization method can significantly improve the overall efficiency and security of encryption systems in practical applications and is suitable for various high-performance and resource-constrained cryptographic application scenarios. When calculating point addition and doubling, the Montgomery scalar multiplication algorithm does not require the participation of the y-coordinate, and only the y-coordinate needs to be calculated once at the end; at the same time, point addition and doubling operations can be performed in parallel. By analyzing the data independence in the point addition and doubling operation process, the proposed scheduling process can maximize the parallel computation of multiplication and modular reduction, thereby improving the computational efficiency of scalar multiplication.

[0074] Example 1

[0075] A scalar multiplication system based on Montgomery includes a scalar multiplication controller module, a point addition calculation module, a point multiplication calculation module, a projected coordinate transformation module, a y-coordinate calculation module, and a calculation module.

[0076] 1. Scalar multiplication controller module, which controls the Montgomery scalar multiplication algorithm, specifically controls the calculation of point addition and doubling, projection coordinate transformation and y-coordinate calculation.

[0077] The scalar multiplication controller module obtains the corresponding modulus length random number k and the affine coordinates (x1, y1) of point p on the elliptic curve, transforms point p into projective coordinates P(X1, Y1, 1), and uses the Montgomery scalar multiplication algorithm. The process is shown in Table 1.

[0078] Table 1 Montgomery's scalar multiplication algorithm

[0079]

[0080] The point addition and doubling operations are performed in parallel to obtain P(X1,Z1) and Q(X2,Z2). Through projection coordinate transformation, P and Q are transformed from projective coordinates to affine coordinates, where x2 is a scalar multiplication of the desired x-coordinate. Finally, the y-coordinate is calculated using p(x1,z1) and q(x2,z2).

[0081] 2. Point addition calculation module: For input points P and Q, calculate Q = P + Q. Only the X and Z coordinates are needed during the calculation process.

[0082] For input points P and Q, calculate Q = P + Q (with the initial value of Q being 0). The calculation only requires the X and Z coordinates; use the point addition formula, where y... P The initial coordinates of point p are:

[0083]

[0084] The point-to-point addition module rationally arranges the point-to-point addition process, separating multiplication operations from modular reduction and subtraction operations, enabling maximum parallel computation of multiplication and modular reduction operations. The elliptic curve parameters a and b need to satisfy (4a... 3 +27b 2 mod p ≠ 0, recommended parameters are as follows:

[0085] p=FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF

[0086] a=FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFE

[0087] b=28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93

[0088] 3. The point multiplication calculation module calculates P = 2P for the input point P. Only the X and Z coordinates are needed during the calculation process.

[0089] Formula for calculating multiple points:

[0090]

[0091] The doubling calculation module rationally arranges the doubling calculation process, separating multiplication operations from modular reduction operations, and can effectively perform multiplication and modular reduction calculations in parallel.

[0092] 4. Projection coordinate transformation module: After the calculation of the sum of points and the multiple of points is completed, the final result X coordinate is transformed from the projective coordinate system to the affine coordinate system to obtain the scalar multiplication of the required x coordinate.

[0093] After the point addition and doubling calculations are completed, the X coordinates of the final result points P and Q are transformed from the projective coordinate system to the affine coordinate system, i.e., x1 = X1 / Z1 mod p and x2 = X2 / Z2 mod p.

[0094] 5. The y-coordinate calculation module performs the y-coordinate calculation only once at the end, obtains the scalar multiplication of the desired y-coordinate, completes the scalar multiplication operation, and outputs kP.

[0095] After completing the point addition and doubling operations, the y-coordinate is calculated. The formula for calculating the y-coordinate is: y = ... P The initial coordinates of point p are:

[0096] Y(P)=2y p -1(2b+(a+x p x1)(x p +x1)-x2(x p -x1) 2 )

[0097] Where, x P Let x be the x-coordinate of point p in the initial affine coordinate system.

[0098] Before calculating the y-coordinate, the 2y-coordinate is first calculated using the extended Euclidean algorithm. -1 The y-coordinate calculation module has a reasonable arrangement of the y-coordinate calculation process, which separates the multiplication operation from the modular reduction operation, and can effectively perform multiplication and modular reduction calculations in parallel.

[0099] 6. The calculation module consists of two sets of multiplier units, a modular reduction and subtraction unit, and a modular addition and subtraction unit, which are responsible for completing the modular multiplication and modular addition and subtraction operations in the calculation.

[0100] Modular multiplication and modular addition / subtraction operations in point addition are calculated by the first group of multiplier units (such as Karatsuba multiplier, Toom-Cook multiplier, etc.), modular reduction / subtraction units, and modular addition / subtraction units. Modular multiplication and modular addition / subtraction operations in double point addition are calculated by the second group of multiplier units (such as Karatsuba multiplier, Toom-Cook multiplier, etc.), modular reduction / subtraction units, and modular addition / subtraction units.

[0101] Example 2

[0102] This application also provides a scalar multiplication method based on Montgomery, implemented based on the aforementioned Montgomery-based scalar multiplication system. The specific process of this method is as follows: The scalar multiplication controller obtains an n-bit (e.g., 256-bit) random number k and the affine coordinates (x1, y1) of a point p on the elliptic curve. After converting point p into projective coordinates (X1, Y1, 1), point addition and doubling operations are performed in parallel. After completing the point addition and doubling operations, P(X1, Z1) and Q(X2, Z2) in projective coordinates are obtained. The scalar multiplication controller module then enters the modular inverse operation, first calculating the modular inverse T1 = Z1. -1 mod p and T2 = Z2 -1 Mod p, then calculate x1 = X1T1 mod p and x2 = X2T2 mod p to get x1 and x2, where x2 is the x-coordinate to be found. Finally, calculate the y-coordinate to be found by p(x1,z1) and q(x2,z2).

[0103] The implementation steps of the scalar multiplication controller module are as follows: obtain the n-bit random number k and the affine coordinates (x1, y1) of the point p on the elliptic curve, transform the point p into projective coordinates P(X1, Y1, 1), start parallel calculation of point addition and doubling operations to obtain P(X1, Z1) and Q(X2, Z2) in projective coordinates, then perform coordinate transformation to transform the projective coordinates into affine coordinates to obtain the x-coordinate, and finally obtain the desired y-coordinate according to the y-coordinate calculation formula.

[0104] The implementation steps of the point-to-point addition calculation module are as follows: Shift the random number k logically left by one bit. If the highest bit is 1, calculate Q = P + Q through point-to-point addition. If the highest bit is 0, calculate P = P + Q through point-to-point addition. After the calculation is completed, shift k logically left by one bit again. Repeat the above steps until all n-bit random numbers k have been logically shifted left. The point-to-point addition calculation module reasonably arranges the point-to-point addition calculation process, separating multiplication operations from modular reduction and subtraction operations, and enabling parallel calculation of multiplication and modular reduction and subtraction operations to the greatest extent.

[0105] Table 2 shows the point addition calculation process:

[0106] Table 2. Calculation process for point addition

[0107]

[0108]

[0109] The calculation process for input points P(X1,Z1) and Q(X2,Z2) is as follows:

[0110] Step 1: Perform a multiplication operation on Z1 and Z2, and put the result into the multiplication register.

[0111] Step 2: Perform a multiplication operation on X1 and X2, and place the result into the multiplication register. Perform a modulo reduction operation on the result stored in the multiplication register, and place the result into the modulo reduction register 1.

[0112] Step 3: Perform a multiplication operation on X1 and Z2, and place the result in the multiplication register. Perform a modulo reduction operation on the result stored in the multiplication register, and place the result in the modulo reduction register 2. Perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo addition / subtraction register 1.

[0113] Step 4: Perform a multiplication operation on X2 and Z1, and place the result in the multiplication register. Perform a modulo reduction operation on the result stored in the multiplication register, and place the result in the modulo reduction register 2. Perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and place the result in the modulo addition / subtraction register 2.

[0114] Step 5: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 3. Perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 1.

[0115] Step 6: Perform a modulo addition operation on the result stored in Modulo-minus register 2 and the result stored in Modulo-minus register 3, and put the result into Modulo-addition / subtraction register 2.

[0116] Step 7: Perform a multiplication operation on the result stored in Modulo-subtraction register 1 and the result stored in Modulo-addition register 2, and put the result into the multiplication register.

[0117] Step 8: Multiply the results stored in Modulo Addition / Subtraction Register 1 and Modulo Addition / Subtraction Register 2, and place the result in the Multiplication Register. Perform Modulo Subtraction / Reduction on the result stored in the Multiplication Register, and place the result in Modulo Subtraction / Reduction Register 1. Perform Modulo Subtraction / Reduction on the results stored in Modulo Subtraction / Reduction Register 2 and Modulo Subtraction / Reduction Register 3, and place the result in Modulo Addition / Subtraction Register 2.

[0118] Step 9: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 2 and the result stored in Modulo Addition / Subtraction Register 2. Place the result into the multiplication register. Perform a modulo reduction / subtraction operation on the result stored in the multiplication register. Place the result into Modulo Reduction / Subtraction Register 2.

[0119] Step 10: Perform a multiplication operation on 4b and the result stored in Modulo-reduction register one, and place the result into the multiplication register. Perform a modulo-reduction operation on the result stored in the multiplication register, and place the result into Modulo-reduction register three.

[0120] Step 11: Set x p Multiplication is performed on the result stored in the modulo-reduction register, where xp Let p be the initial x-coordinate of point p. The result of the operation is placed in the multiplication register. The result stored in the multiplication register is then subjected to modulo reduction and subtraction, and the result is placed in the modulo reduction register 1.

[0121] Step 12: Perform a modulo reduction operation on the result stored in the multiplication register to obtain Z. Perform a modulo subtraction operation on the result stored in the second modulo reduction register and the result stored in the first modulo reduction register to obtain X.

[0122] The implementation steps of the doubling calculation module are as follows: Shift the random number k logically left by one bit. If the highest bit is 1, calculate P = 2P through dot addition. If the highest bit is 0, calculate Q = 2Q through dot addition. After the calculation, shift k logically left by one bit again. Repeat the above steps until all n-bit random numbers k have been logically shifted left. The doubling calculation module reasonably arranges the doubling calculation process, separating multiplication operations from modular subtraction operations, and enabling parallel calculation of multiplication and modular subtraction to the greatest extent.

[0123] Table 3 shows the calculation process for the multiplier:

[0124] Table 3: Calculation Process of Multiplier Point

[0125]

[0126] The calculation process for the input P(X1,Z1) multiplier is as follows:

[0127] Step 1: Perform a multiplication operation on Z1 and Z2, and put the result into the multiplication register.

[0128] Step 2: Perform a multiplication operation on X1 and X1, and put the result into the multiplication register. Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1.

[0129] Step 3: Multiply b and the result stored in Modulo-minus register 1, and place the result in the multiplication register. Perform modulo-minus on the result stored in the multiplication register, and place the result in Modulo-minus register 2. Perform modulo-add on the result stored in Modulo-minus register 1 and the result stored in Modulo-addition / subtraction register 1, and place the result in Modulo-addition / subtraction register 1.

[0130] Step 4: Perform a multiplication operation on X1 and Z1, and place the result in the multiplication register. Perform a modulo reduction operation on the result stored in the multiplication register, and place the result in the modulo reduction register 2. Perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and place the result in the modulo addition / subtraction register 2.

[0131] Step 5: Perform a multiplication operation on the results stored in Modulo-minus register 1 and Modulo-minus register 3, and place the result into the multiplication register. Perform a modulo-minus operation on the result stored in the multiplication register, and place the result into Modulo-minus register 3. Perform a modulo-addition operation on the results stored in Modulo-addition register 1 and Modulo-addition register 2, and place the result into Modulo-addition register 1.

[0132] Step 6: Perform a multiplication operation on the results stored in Modulo-reduction register 1 and Modulo-reduction register 3, and place the result into the multiplication register. Perform a modulo-reduction operation on the results stored in the multiplication register, and place the result into Modulo-reduction register 1.

[0133] Step 7: Perform a multiplication operation on the results stored in Modulo-reduction register 2 and Modulo-reduction register 3, and place the result into the multiplication register. Perform a modulo-reduction operation on the results stored in the multiplication register, and place the result into Modulo-reduction register 2.

[0134] Step 8: Perform a multiplication operation on the result stored in p-3 and the modulo reduction register 2, and place the result into the multiplication register. Perform a modulo reduction operation on the result stored in the multiplication register, and place the result into the modulo reduction register 3.

[0135] Step 9: Multiply the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 3, and place the result in the Multiplication Register. Perform Modulo Subtraction / Reduction on the result stored in the Multiplication Register, and place the result in Modulo Subtraction / Reduction Register 1. Perform Modulo Addition on the result stored in Modulo Subtraction / Reduction Register 1 and the result stored in Modulo Subtraction / Reduction Register 3, and place the result in Modulo Addition / Subtraction Register 1.

[0136] Step 10: Multiply the result stored in 8b and the result stored in Modulo Addition / Subtraction Register 2, and place the result in the multiplication register. Perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and place the result in Modulo Reduction / Subtraction Register 2. Perform a modulo addition operation on the result stored in Modulo Reduction / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 1, and place the result in Modulo Addition / Subtraction Register 1.

[0137] Step 11: Perform a multiplication operation on the result stored in register 4 and modulo addition / subtraction register 1, and place the result into the multiplication register. Perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and place the result into register 3.

[0138] Step 12: Perform a modulo subtraction operation on the result stored in the multiplication register to obtain Z. Perform a modulo subtraction operation on the result stored in the second modulo subtraction register and the result stored in the third modulo subtraction register to obtain X.

[0139] The implementation steps of the projected coordinate transformation module are as follows: First, calculate the modular inverse T1 = Z1 using the extended Euclidean algorithm after summing and doubling the points. -1mod p and T2 = Z2 -1 Mod p, then calculate x1 = X1T1 mod p and x2 = X2T2 mod p to get x1 and x2.

[0140] The implementation steps of the y-coordinate calculation module are as follows: Before calculating the y-coordinate, first calculate 2y using the extended Euclidean algorithm. -1 The coordinate transformation results x1 and x2 are calculated based on the y coordinate, and finally the desired y coordinate is obtained.

[0141] Table 4 shows the y-coordinate calculation process:

[0142] Table 4 shows the calculation process for the y-coordinate.

[0143]

[0144] For inputs p(x1,z1) and q(x2,z2), the y-coordinate calculation process is as follows:

[0145] Step 1: Set x1 and x p Perform a multiplication operation and place the result into the multiplication register. Then, multiply x1 and x... p Perform a modulo-subtraction operation and place the result into the modulo-addition / subtraction register 1.

[0146] Step 2: Multiply the results stored in Modulo Addition / Subtraction Register 1 and the results stored in Modulo Addition / Subtraction Register 1, and place the result into the Multiplication Register. Then perform Modulo Diminishing / Subtracting on the result stored in the Multiplication Register, and place the result into Modulo Diminishing / Subtracting Register 1. x1 and x p Perform a modulo addition operation and put the result into the modulo addition / subtraction register 1.

[0147] Step 3: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1. Perform a modulo addition operation on 'a' and the result stored in the modulo reduction register 1, and put the result into the modulo addition register 2.

[0148] Step 4: Perform a multiplication operation on x2 and the result stored in the modulo reduction register, and put the result into the multiplication register.

[0149] Step 5: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 2, and place the result into the multiplication register. Perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and place the result into Modulo Reduction / Subtraction Register 1.

[0150] Step 6: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1. Perform a modulo addition operation on 2b and the result stored in the modulo reduction register 1, and put the result into the modulo addition register 1.

[0151] Step 7: Perform a modulo addition operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Decrease / Subtraction Register 1, and put the result into Modulo Addition / Subtraction Register 1.

[0152] Step 8: Store the result and sum in the modulo-addition / subtraction register. Perform multiplication, where y p Let be the initial y-coordinate of point p, and store the result in the multiplication register. Where y... p Let p be the initial x-coordinate.

[0153] Step 9: Perform a modulo reduction operation on the result stored in the multiplication register. The result is the desired y-coordinate.

[0154] This application may also provide a computer device, including: at least one processor, memory, at least one network interface, and a user interface. The various components in this device are coupled together via a bus system. It is understood that the bus system is used to implement communication between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus.

[0155] The user interface can include a display, keyboard, or clicking device. Examples include a mouse, trackball, touchpad, or touchscreen.

[0156] It is understood that the memory in the embodiments disclosed in this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memories described herein are intended to include, but are not limited to, these and any other suitable types of memory.

[0157] In some implementations, the memory stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof: operating systems and applications.

[0158] The operating system includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application programs include various applications, such as media players and browsers, used to implement various application functions. Programs implementing the methods of the embodiments of this disclosure can be included in the application programs.

[0159] In the above embodiments, the processor can also invoke programs or instructions stored in memory, specifically programs or instructions stored in an application program, for the following purposes:

[0160] Follow the steps described above.

[0161] The above methods can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the disclosed methods, steps, and logic block diagrams. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the disclosed methods can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0162] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof.

[0163] For software implementation, the technology of this application can be implemented by executing the functional modules (e.g., procedures, functions, etc.) of this application. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or externally.

[0164] This application may also provide a non-volatile storage medium for storing a computer program. When the computer program is executed by a processor, it can implement the steps in the above method embodiments.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of this application do not depart from the spirit and scope of the technical solutions of this application, and should all be covered within the scope of the claims of this application.

Claims

1. A scalar multiplication system based on Montgomery, used in cryptographic applications based on elliptic cryptography, characterized in that, The system includes: The scalar multiplication controller module is used to input a random number k and a point p on the elliptic curve, and control other modules to complete the Montgomery scalar multiplication operation to obtain kP, where P is the projective coordinate of p. The point addition calculation module is used to calculate P+Q on input points P and Q; the initial value of point Q is 0; only the X and Z coordinates are needed during the calculation. The point multiplication calculation module is used to calculate P = 2P for an input point P; only the X and Z coordinates are needed during the calculation process. The projection coordinate transformation module is used to transform the X coordinates of the final result points P and Q from the projective coordinate system to the affine coordinate system in the point addition and doubling calculation. The y-coordinate calculation module is used for scalar multiplication of the desired y-coordinate, performing the scalar multiplication operation and outputting kP; and The calculation module includes two sets of multiplier units, a modular reduction and subtraction unit, and a modular addition and subtraction unit, which are used to complete the modular multiplication and modular addition and subtraction operations in point addition and doubling point operations.

2. The scalar multiplication system based on Montgomery according to claim 1, characterized in that, The implementation process of the scalar multiplication controller module includes: After obtaining the random number k and the affine coordinates (x1, y1) of a point p on the elliptic curve, the point p is converted into projective coordinates P(X1, Y1, 1). First, the point addition and doubling calculation modules are called in parallel to perform point addition and doubling operations to obtain P(X1, Z1) and Q(X2, Z2) in projective coordinates. Then, the projection coordinate transformation module is called to perform coordinate transformation, converting the projective coordinates to affine coordinates to obtain the x-coordinate. Finally, the y-coordinate calculation module is called to obtain the desired y-coordinate according to the y-coordinate calculation formula.

3. The scalar multiplication system based on Montgomery according to claim 2, characterized in that, The implementation process of the point addition calculation module includes: Shift the random number k logically left by one bit. If the highest bit is 1, calculate Q = P + Q using dot addition. If the highest bit is 0, calculate P = P + Q using dot addition. After the calculation, shift k logically left by one bit again. Repeat the above steps until the random number k has been completely shifted logically left. The calculation formula is: Where X(P+Q) represents the X-coordinate of the projective coordinate system after point addition; Z(P+Q) represents the Z-coordinate of the projective coordinate system after point addition; a and b represent the elliptic curve parameters; x P Let x be the x-coordinate of point p in the initial affine coordinate system.

4. The scalar multiplication system based on Montgomery according to claim 3, characterized in that, The calculation process of the point addition calculation module includes: Step 1: Perform a multiplication operation on Z1 and Z2, and put the result into the multiplication register; Step 2: Perform a multiplication operation on X1 and X2, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; Step 3: Perform a multiplication operation on X1 and Z2, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 2; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo addition register 1. Step 4: Perform a multiplication operation on X2 and Z1, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 2; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 2. Step 5: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 3; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 1; Step 6: Perform a modulo addition operation on the result stored in Modulo-minus register 2 and the result stored in Modulo-minus register 3, and put the result into Modulo-addition / subtraction register 2; Step 7: Perform a multiplication operation on the result stored in Modulo-subtraction register 1 and the result stored in Modulo-addition register 2, and put the result into the multiplication register; Step 8: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 3, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 1; perform a modulo subtraction operation on the result stored in Modulo Reduction / Subtraction Register 2 and the result stored in Modulo Reduction / Subtraction Register 3, and put the result into Modulo Addition / Subtraction Register 2. Step 9: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 2 and the result stored in Modulo Addition / Subtraction Register 2, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 2; Step 10: Perform a multiplication operation on 4b and the result stored in Modulo-reduction register 1, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 3; Step 11: Set x p Perform a multiplication operation on the result stored in the modulo reduction register 3, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; Step 12: Perform a modulo reduction operation on the result stored in the multiplication register to obtain Z; perform a modulo reduction operation on the result stored in the second modulo reduction register and the result stored in the first modulo reduction register to obtain X.

5. The scalar multiplication system based on Montgomery according to claim 2, characterized in that, The implementation process of the multiplier calculation module includes: Shift the random number k logically left by one bit. If the highest bit is 1, calculate P = 2P using dot addition. If the highest bit is 0, calculate Q = 2Q using dot addition. After the calculation, shift k logically left by one bit again. Repeat the above steps until the random number k has been completely shifted logically left. The calculation formula is: Where X(2P) represents the X coordinate of the projective coordinate system after doubling the points; Z(2P) represents the Z coordinate of the projective coordinate system after doubling the points; and a and b represent the elliptic curve parameters.

6. The scalar multiplication system based on Montgomery according to claim 5, characterized in that, The calculation process of the multiplier calculation module includes: Step 1: Perform a multiplication operation on Z1 and Z2, and put the result into the multiplication register; Step 2: Perform a multiplication operation on X1 and X1, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; Step 3: Perform a multiplication operation on b and the result stored in Modulo-reduction register 1, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 2; perform a modulo-add operation on the result stored in Modulo-reduction register 1 and the result stored in Modulo-reduction register 1, and put the result into Modulo-addition / subtraction register 1. Step 4: Perform a multiplication operation on X1 and Z1, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 2; perform a modulo addition operation on the result stored in the modulo reduction register 1 and the result stored in the modulo reduction register 2, and put the result into the modulo addition / subtraction register 2. Step 5: Perform a multiplication operation on the result stored in Modulo-subtraction register 1 and the result stored in Modulo-subtraction register 3, and put the result into the multiplication register; perform a modulo-subtraction operation on the result stored in the multiplication register, and put the result into Modulo-subtraction register 3; perform a modulo-addition operation on the result stored in Modulo-addition register 1 and the result stored in Modulo-addition register 2, and put the result into Modulo-addition register 1. Step 6: Perform a multiplication operation on the result stored in Modulo-reduction register 1 and the result stored in Modulo-reduction register 3, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 1; Step 7: Perform a multiplication operation on the result stored in Modulo-reduction register 2 and the result stored in Modulo-reduction register 3, and put the result into the multiplication register; perform a modulo-reduction operation on the result stored in the multiplication register, and put the result into Modulo-reduction register 2; Step 8: Perform a multiplication operation on the result stored in p-3 and the modulo reduction register 2, and put the result into the multiplication register; perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 3; Step 9: Perform a multiplication operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 3, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 1; perform a modulo addition operation on the result stored in Modulo Reduction / Subtraction Register 1 and the result stored in Modulo Reduction / Subtraction Register 3, and put the result into Modulo Addition / Subtraction Register 1. Step 10: Perform a multiplication operation on 8b and the result stored in Modulo Addition / Subtraction Register 2, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo Reduction / Subtraction Register 2; perform a modulo addition operation on the result stored in Modulo Reduction / Subtraction Register 1 and the result stored in Modulo Addition / Subtraction Register 1, and put the result into Modulo Addition / Subtraction Register 1. Step 11: Perform a multiplication operation on the result stored in the modulo addition / subtraction register 1, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into the modulo reduction / subtraction register 3; Step 12: Perform a modulo reduction operation on the result stored in the multiplication register to obtain Z; perform a modulo reduction operation on the result stored in the second modulo reduction register and the result stored in the third modulo reduction register to obtain X.

7. The scalar multiplication system based on Montgomery according to claim 2, characterized in that, The implementation steps of the projection coordinate transformation module are as follows: the result of adding and doubling the points is used to calculate the modular inverse T1 = Z1 using the extended Euclidean algorithm. -1 mod p and T2 = Z2 -1 Mod p, then calculate x1 = X1T1 mod p and x2 = X2T2 mod p to get x1 and x2; where x2 is the scalar multiplied by the x-coordinate to be found.

8. The scalar multiplication system based on Montgomery according to claim 2, characterized in that, The implementation steps of the y-coordinate calculation module are as follows: First, calculate 2y using the extended Euclidean algorithm. p -1 The coordinate transformation results x1 and x2 from the projection coordinate transformation module are calculated based on the y coordinate, and finally the scalar multiplied by the desired y coordinate is obtained. The calculation formula is: Y(P)=2y p -1 (2b+(a+x p x1)(x p +x1)-x2(x p -x1) 2 ) Where Y(P) represents the Y-coordinate of the final projective coordinate system; a and b represent the elliptic curve parameters; y P Let x be the y-coordinate of point p in the initial affine coordinate system; P Let x be the x-coordinate of point p in the initial affine coordinate system.

9. The scalar multiplication system based on Montgomery according to claim 8, characterized in that, The calculation process of the y-coordinate calculation module is as follows: Step 1: Set x1 and x p Perform a multiplication operation and place the result into the multiplication register; then compare x1 with x... p Perform a modular subtraction operation and place the result into the modular addition / subtraction register 1. Step 2: Perform a multiplication operation on the result stored in the first modulo addition / subtraction register and the result in the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register and the result in the first modulo reduction / subtraction register; x1 and x p Perform a modular addition operation and place the result into the modular addition / subtraction register 1. Step 3: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; perform a modulo addition operation on 'a' and the result stored in the modulo reduction register 1, and put the result into the modulo addition register 2; Step 4: Perform a multiplication operation on x2 and the result stored in the modulo reduction register, and put the result into the multiplication register; Step 5: Perform a multiplication operation on the result stored in Modulo addition / subtraction register 1 and the result stored in Modulo addition / subtraction register 2, and put the result into the multiplication register; perform a modulo reduction / subtraction operation on the result stored in the multiplication register, and put the result into Modulo reduction / subtraction register 1; Step 6: Perform a modulo reduction operation on the result stored in the multiplication register, and put the result into the modulo reduction register 1; perform a modulo addition operation on 2b and the result stored in the modulo reduction register 1, and put the result into the modulo addition register 1; Step 7: Perform a modulo addition operation on the result stored in Modulo Addition / Subtraction Register 1 and the result stored in Modulo Decrease / Subtraction Register 1, and put the result into Modulo Addition / Subtraction Register 1; Step 8: Store the result and sum in the modulo-addition / subtraction register. Perform a multiplication operation and place the result into the multiplication register; Step 9: Perform a modulo reduction operation on the result stored in the multiplication register. The result is the scalar multiplied by the desired y-coordinate.

10. A scalar multiplication method based on Montgomery, implemented using the system described in any one of claims 1-9, the method comprising: The scalar multiplication controller module obtains the random number k and the affine coordinates (x1, y1) of a point p on the elliptic curve. After converting point p into projective coordinates P(X1, Y1, 1), it first calls the point addition calculation module and the point multiplication calculation module to perform point addition and point multiplication operations in parallel to obtain P(X1, Z1) and Q(K2, Z2) in projective coordinates. Then, it calls the projection coordinate transformation module to perform coordinate transformation, converting the projective coordinates to affine coordinates to obtain the x-coordinate required by the scalar multiplication. Finally, it calls the y-coordinate calculation module to obtain the y-coordinate required by the scalar multiplication according to the y-coordinate calculation formula.