Parallel point addition method for elliptic curves based on avx512ifma

By utilizing the AVX512IFMA instruction set to perform parallel point addition operations on multiple data elements within the same instruction cycle, the problem of insufficient speed and parallel computing efficiency in elliptic curve point addition calculations in existing technologies is solved, resulting in a significant performance improvement.

CN119155037BActive Publication Date: 2025-12-09WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410953512.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2025-12-09
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

The lack of existing technologies for optimizing elliptic curve point addition computation using the AVX512IFMA instruction set results in insufficient speed and parallel computing efficiency for point addition operations in modern cryptography.

Method used

Employing a single instruction multiple data instruction set based on AVX512IFMA, this method achieves 8×1-way parallel point addition operations by processing multiple data elements within the same instruction cycle. It also optimizes elliptic curve point addition calculations by utilizing different large number operation rules and point addition formulas for the target number field.

Benefits of technology

Significant performance optimizations were achieved for elliptic curve point addition operations, improving computation speed and parallel computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155037B_ABST
    Figure CN119155037B_ABST
Patent Text Reader

Abstract

The application discloses an elliptic curve parallel point addition method based on AVX512IFMA and belongs to the technical field of computers. The method comprises the following steps: determining each coordinate in the coordinates of a plurality of pairs of point data participating in parallel point addition; determining a target number field corresponding to the plurality of pairs of point data, the target number field being a finite field of an elliptic curve or a quadratic extension field of the finite field; determining a large number operation rule corresponding to the target number field; determining a target point addition formula of the plurality of pairs of point data based on the relationship between the Z coordinate value Z1 of the point addition data in each pair of point data in the plurality of pairs of point data and the Z coordinate value Z2 of the point to be added; converting the coordinate values of the plurality of pairs of point data into target data corresponding to a data structure of AVX512IFMA; and processing the target data based on the target point addition formula and the large number operation rule to obtain a point addition result of the plurality of pairs of point data. The method realizes 8*1 parallel acceleration of elliptic curve point addition and can greatly improve performance optimization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of computers, and particularly relates to a parallel point addition method of an elliptic curve based on AVX512IFMA. BACKGROUND

[0002] In modern cryptography, Elliptic Curve Cryptography (ECC) has been widely used in various information security fields such as digital signature, blockchain, SSL / TLS protocol, etc. due to its high security and low computational complexity. Elliptic Curve Point Addition and Point Multiplication are the basic operations of ECC, and their efficiency directly affects the performance of the entire cryptographic system. Therefore, how to optimize the speed of these basic operations, especially the point addition operation, has become a hot research issue.

[0003] Traditional ECC point addition implementation methods usually rely on large integer operations. Since points on an elliptic curve are represented as pairs of large integers, these operations involve a large number of modulo addition, modulo subtraction, and modulo multiplication operations. Although the computing power of modern processors has improved significantly, there is still a performance bottleneck when facing large-scale elliptic curve point operations. In addition, the utilization of traditional methods in parallel computing is low, and they cannot fully utilize the advantages of modern multi-core processors.

[0004] AVX512IFMA (AVX-512 Integer Fused Multiply-Add) is a single instruction multiple data (SIMD, Single Instruction Multiple Data) instruction set introduced by Intel, which is part of the AVX-512 instruction set. It provides efficient vectorized integer operation capabilities, especially supporting fused multiply-add operations, which means performing multiplication and addition operations simultaneously. This operation can significantly reduce the number of instructions and improve the speed of operation. In addition, AVX512IFMA supports 512-bit vector registers, allowing each instruction to handle more data, further improving the efficiency of parallel computing.

[0005] Nowadays, many cryptographic implementations have begun to use SIMD to accelerate operations, such as using it to improve the computational efficiency and response speed in encryption, digital signature, and TLS protocol. The BLS12-381 curve is a high-security elliptic curve widely used in cryptography, especially in zero-knowledge proof systems and public-key cryptography. However, there is still a lack of optimization scheme for AVX512IFMA instruction set for this curve.

[0006] Therefore, there is no problem of using AVX512IFMA instruction set to optimize point addition calculation in elliptic curve in the related art, and there is no scheme of using parallel data processing advantage of AVX512IFMA instruction set to realize calculation acceleration of elliptic curve point addition. SUMMARY

[0007] The present application aims to at least solve one of the technical problems in the related art. To this end, the present application provides a parallel point addition method of elliptic curve based on AVX512IFMA, which utilizes the feature that the single instruction multiple data instruction set of AVX512IFMA can simultaneously process multiple data elements of the same type in the same instruction cycle, realizes 8x1 parallel acceleration for the elliptic curve point addition part, and can obtain a substantial performance optimization improvement.

[0008] In a first aspect, the present application provides a parallel point addition method of elliptic curve based on AVX512IFMA, which comprises:

[0009] determining each coordinate in the coordinates of the multiple pairs of point data participating in parallel point addition, each pair of point data including two types of point data, i.e., point addition data and point being added data;

[0010] determining a target number field corresponding to the multiple pairs of point data, the target number field being a finite field of the elliptic curve or a quadratic extension field of the finite field;

[0011] determining a large number operation rule corresponding to the target number field;

[0012] determining a target point addition formula of the multiple pairs of point data based on the relationship between the Z coordinate value Z1 of the point addition data and the Z coordinate value Z2 of the point being added data in each pair of point data in the multiple pairs of point data;

[0013] converting the coordinate values of the multiple pairs of point data into target data corresponding to the data structure of AVX512IFMA;

[0014] processing the target data based on the target point addition formula and the large number operation rule to obtain the point addition result of the multiple pairs of point data.

[0015] According to the parallel point addition method of elliptic curve based on AVX512IFMA, the feature that the single instruction multiple data instruction set can simultaneously process multiple data elements of the same type in the same instruction cycle is utilized to realize 8x1 finite field operation at the bottom layer and 8x1 point addition operation at the upper layer of the elliptic curve, and since the large number operation rule at the bottom layer is determined based on the target number field and the point addition formula is different due to the change of the coordinate relationship of the point data participating in point addition calculation, a plurality of types of point addition operation interfaces can be provided, and the single instruction multiple data instruction set of AVX512IFMA is used to realize 8x1 parallel acceleration for the elliptic curve point addition part, which can obtain a substantial performance optimization improvement.

[0016] According to one embodiment of this application, the relationship between the Z-coordinate value Z1 of the added point data and the Z-coordinate value Z2 of the added point data in each pair of point data includes three types, namely:

[0017] Z1=Z2=1, Z1≠Z2=1, and Z1≠Z2.

[0018] According to one embodiment of this application, converting the coordinate values ​​of multi-point data into target data corresponding to the AVX512IFMA data structure includes:

[0019] Each coordinate value in the coordinates of the multi-point data is converted into a coordinate value vector corresponding to the target operation basis of AVX512IFMA;

[0020] The target data is obtained by constructing a vector set from the multiple coordinate value vectors corresponding to each coordinate value of each type of point data.

[0021] According to one embodiment of this application, converting each coordinate value in the coordinates of multi-point data into a coordinate value vector corresponding to the target computational basis of AVX512IFMA includes:

[0022] Determine the data type corresponding to the multi-point data;

[0023] If the data type is a standard element corresponding to the finite field where the elliptic curve is located, then each coordinate value in the coordinates of the multi-point data is converted into a coordinate value vector corresponding to the target operation basis of AVX512IFMA based on the preset rules.

[0024] If the data type is a preset data type expressed on the Montgomery domain, then based on the Montgomery domain transformation rule corresponding to the target number domain, each coordinate value in the coordinates of the multi-point data is converted into a coordinate value vector corresponding to the target operation radix of AVX512IFMA.

[0025] According to one embodiment of this application, if the data type is a standard element corresponding to the finite field where the elliptic curve is located, then each coordinate value in the coordinates of the multi-point data is converted into a coordinate value vector corresponding to the target operation base of AVX512IFMA based on a preset rule, including:

[0026] For any coordinate value f in the coordinate values ​​of the multi-point data, where the data type of any coordinate value f is a standard element corresponding to the finite field containing the elliptic curve, the coordinate value vector F corresponding to the target operational basis of AVX512IFMA for any coordinate value f is determined by the following formula:

[0027] f = f0 + 2 52 f1+2104 f2+2 156 f3+2 208 f4+2 260 f5+2 312 f6+2 364 f7

[0028] F=[f0, f1, f2, f3, f4, f5, f6, f7]

[0029] Where, 0≤f i <2 52 And 0 ≤ i < 8, where i is an integer, and the radix of the target operation is 2. 52 .

[0030] According to one embodiment of this application, a vector set is formed by constructing multiple coordinate value vectors corresponding to each coordinate value of each type of point data, including:

[0031] The vector set V is determined by the following formula:

[0032]

[0033] Among them, the multiple coordinate value vectors corresponding to any coordinate of any point data are F a F b F c F d F e F f F g and F h Each column of the vector set V corresponds to a coordinate value vector, and the i-th row of the vector set V corresponds to a register vector v. i =[f i a f i b f i c f i d f i e f i f f i g f i h ], 0≤i<8, where i is an integer.

[0034] Secondly, this application provides a parallel point addition device for elliptic curves based on AVX512IFMA, the device comprising:

[0035] The first determining module is configured to determine each coordinate in coordinates of a plurality of pairs of point data participating in parallel point addition, each pair of point data including two types of point data, i.e., point data to be added and point data to be added to;

[0036] The second determining module is configured to determine a target number field corresponding to the plurality of pairs of point data, the target number field being a finite field of an elliptic curve or a quadratic extension field of the finite field;

[0037] The third determining module is configured to determine a large number operation rule corresponding to the target number field;

[0038] The fourth determining module is configured to determine a target point addition formula of the plurality of pairs of point data based on a relationship between a Z coordinate value Z1 of the point data to be added and a Z coordinate value Z2 of the point data to be added in each pair of point data in the plurality of pairs of point data;

[0039] The data arrangement module is configured to convert coordinate values of the plurality of pairs of point data into target data corresponding to a data structure of AVX512IFMA;

[0040] The data processing module is configured to process the target data based on the target point addition formula and the large number operation rule to obtain a point addition result of the plurality of pairs of point data.

[0041] According to the parallel point addition device of the elliptic curve based on AVX512IFMA, the bottom 8x1 path finite field operation and the upper 8x1 path point addition operation of the elliptic curve are simultaneously implemented by using the characteristic that a single instruction multiple data instruction set can simultaneously process a plurality of data elements of the same type in a same instruction cycle. Meanwhile, since the bottom large number operation rule is determined based on the target number field, and the point addition formula is different from each other due to the change of the coordinate relationship of the point data participating in the point addition calculation, a plurality of types of point addition operation interfaces can be provided, and the 8x1 path parallel acceleration of the elliptic curve point addition part is implemented by using the AVX512IFMA instruction set, so that a substantial performance optimization improvement can be obtained.

[0042] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the parallel point addition method of the elliptic curve based on AVX512IFMA in the first aspect.

[0043] In a fourth aspect, the present application provides a non-transitory computer readable storage medium, having a computer program stored thereon, and the computer program is executable on a processor to implement the parallel point addition method of the elliptic curve based on AVX512IFMA in the first aspect.

[0044] In a fifth aspect, the present application provides a chip, the chip comprising a processor and a communication interface, the communication interface and the processor being coupled, the processor being configured to execute a program or an instruction to implement the parallel point addition method of the elliptic curve based on the AVX512IFMA according to the first aspect.

[0045] In a sixth aspect, the present application provides a computer program product, comprising a computer program, the computer program being configured to implement the parallel point addition method of the elliptic curve based on the AVX512IFMA according to the first aspect when executed by a processor.

[0046] Additional aspects and advantages of the present application will be made apparent from the following description of embodiments of the present application, which will be described in the following description of embodiments with reference to the following figures, wherein: BRIEF DESCRIPTION OF DRAWINGS

[0047] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the following description of embodiments, from the accompanying drawings, and from the appended claims.

[0048] Figure 1 is a flowchart of the parallel point addition method of the elliptic curve based on the AVX512IFMA provided by the embodiments of the present application;

[0049] Figure 2 is a structural diagram of the parallel point addition device of the elliptic curve based on the AVX512IFMA provided by the embodiments of the present application;

[0050] Figure 3 is a structural diagram of the parallel point addition calculation engine of the elliptic curve based on the AVX512IFMA provided by the embodiments of the present application;

[0051] Figure 4 is a hardware diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0053] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a particular order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in a "or" relationship.

[0054] The parallel point addition method for elliptic curves based on AVX512IFMA, the parallel point addition device for elliptic curves based on AVX512IFMA, the electronic device and the readable storage medium provided by the embodiments of the present application will be described in detail below in combination with the drawings, specific embodiments and application scenarios.

[0055] The parallel point addition method for elliptic curves based on AVX512IFMA can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.

[0056] The parallel point addition method for elliptic curves based on AVX512IFMA provided by the embodiments of the present application, the execution subject of the parallel point addition method for elliptic curves based on AVX512IFMA can be an electronic device or a functional module or functional entity in the electronic device capable of realizing the parallel point addition method for elliptic curves based on AVX512IFMA. The electronic device mentioned in the embodiments of the present application includes but is not limited to mobile phones, tablet computers, computers, cameras and wearable devices, etc. The parallel point addition method for elliptic curves based on AVX512IFMA provided by the embodiments of the present application will be described below taking the electronic device as an execution subject.

[0057] First, the definitions conforming to and corresponding to the present application are described as follows:

[0058] BLS12-381 elliptic curve finite field, wherein p is the modulus of the BLS12-381 elliptic curve.

[0059] BLS12-381 elliptic curve finite field Quadratic extension field.

[0060] R: BLS12-381 elliptic curve.

[0061] P i : coordinates of elliptic curve point i, represented as (X, Y, Z), P i∈E where 1≤i≤n, n is the order of the elliptic curve.

[0062] v i : a 512-bit vector.

[0063] V: a vector set consisting of 8 v i (0≤i<8), which can represent 8 large numbers.

[0064] A, R, C: three different vector sets.

[0065] Q: a vector set consisting of modulus.

[0066] Elliptic curve point group on E.

[0067] Elliptic curve point group on E.

[0068] PADD * : Elliptic curve point addition, when Z1=Z2=1, Z1 and Z2 are the Z coordinate values of two points participating in point addition respectively.

[0069] PADD: Elliptic curve point addition, when Z1≠Z2=1, Z1 and Z2 are the Z coordinates of two points.

[0070] PADD + : Elliptic curve point addition, when Z1≠Z2, Z1 and Z2 are the Z coordinates of two points.

[0071] As Figure 1 shown, the parallel point addition method of elliptic curve based on AVX512IFMA includes steps 110, 120, 130, 140, 150 and 160.

[0072] Step 110, determine each coordinate in the coordinates of multiple pairs of point data participating in parallel point addition, each pair of point data including two kinds of point data, point addition data and point being added data.

[0073] It should be noted that AVX512IFMA can perform parallel operations on multiple groups of data by using a set of instructions, and the AVX512IFMA instruction set is essentially similar to a vector processor, which can simultaneously perform the same operation on a group of data (also referred to as a "data vector"), thereby realizing parallelism in space. Since the AVX-512IFMA instruction set supports multiplication and addition operations on integers in each 64-bit channel of two registers, 8x1 data arrangement can be realized, that is, at most 8 pairs of the same type of point data can be processed simultaneously in the same instruction cycle, so that the number of pairs of point data on the elliptic curve participating in parallel point addition cannot exceed 8 each time. Since the AVX-512IFMA instruction set realizes 8x1 data arrangement, when the number of pairs of point data participating in parallel point addition does not reach 8, for example, only 5 pairs of point data participate in parallel point addition, then the remaining 3 channels of data can be processed by setting to 0. However, in order to realize efficient parallel point addition processing, 8 pairs of point data are arranged to participate in parallel point addition in each instruction cycle as much as possible. For example, the same type of point data P1, Q1, P2, Q2, P3, Q3, P4, Q4, P5, Q5, P6, Q6, P7, Q7, P8 and Q8 on the elliptic curve, if the point addition data P1 and the point to be added Q1 are to be added, the point addition data P2 and the point to be added Q2 are to be added, the point addition data P3 and the point to be added Q3 are to be added, the point addition data P4 and the point to be added Q4 are to be added, the point addition data P5 and the point to be added Q5 are to be added, the point addition data P6 and the point to be added Q6 are to be added, the point addition data P7 and the point to be added Q7 are to be added, and the point addition data P8 and the point to be added Q8 are to be added, then the above-mentioned 8 point addition calculations can be processed simultaneously in the same instruction cycle. For the two point data participating in the point addition calculation, they are divided into two types of point data, one is the point addition data, and the other is the point to be added data, which are used to distinguish the addend and the addend.

[0074] It should also be noted that the elliptic curve to which the embodiments of the present application are directed is a specific curve BLS12-381 curve, and therefore the coordinate values of the point data on the elliptic curve can be determined to be standard binary large integers represented by 381-bit bits in most cases. If the point data on the elliptic curve determined is from a special database, and the data in the special database is a data type expressed in the Montgomery domain, then at this time the point data on the elliptic curve participating in the point addition also needs to be converted in the Montgomery domain, which will be described in detail later.

[0075] Step 120, determining a target number field corresponding to a plurality of pairs of point data, the target number field being a finite field of an elliptic curve or a quadratic extension field of a finite field.

[0076] It should be noted that the point addition calculation of the point data on the BLS12-381 curve can be divided into two types of point data in the target number field, one is the point data in the elliptic curve point group on the finite field of the elliptic curve BLS12-381 The other is the point data in the elliptic curve point group on the quadratic extension field of the finite field of the elliptic curve BLS12-381 For different target number fields, the corresponding large number operation rules of the underlying number field operation layer are also different, that is, for large number operations on the finite field Including the large number operations of modulo addition, modulo subtraction, modulo multiplication, modulo multiplication and modulo square, there is a set of operation rules corresponding to AVX512IFMA; and for large number operations on the quadratic extension field Also includes large number operations such as modulo addition, modulo subtraction, modulo multiplication, modulo multiplication and modulo square, and is another set of operation rules extended on the basis of the rules of large number operations on the finite field

[0077] Step 130, determine the large number operation rule corresponding to the target number field.

[0078] It can be understood that since the target number field includes two types, which are the finite field of the elliptic curve BLS12-381 And the quadratic extension field of the finite field of the elliptic curve BLS12-381 For the two number fields, there are respective corresponding large number operation rules.

[0079] Step 140, based on the relationship between the Z coordinate value Z1 of the point data to be added in each pair of point data in the plurality of pairs of point data and the Z coordinate value Z2 of the point data to be added, determine the target point addition formula of the plurality of pairs of point data.

[0080] It should be noted that when the point addition calculation of the point data on the BLS12-381 curve is performed, the different relationships between the Z coordinate values of the point data to be added and the point data to be added will result in different point addition calculation formulas. For example, the coordinates of the point data to be added P are (X1, Y1, Z1), the coordinates of the point data to be added Q are (X2, Y2, Z2), and if Z1 = Z2 = 1, the calculation formula of the coordinates (X3, Y3, Z3) of the result point data R obtained by point addition calculation is as follows:

[0081] H = X2 - X1

[0082] HH = H 2

[0083] I = 4 * HH

[0084] ​​​​​J = H * I

[0085] r = 2 * (Y2 - Y1)

[0086] V = X1 * I

[0087] X3 = r 2 -J - 2 * V

[0088] Y3 = r * (V - X3) - 2 * Y1 * J

[0089] Z3 = 2 * H

[0090] If Z1≠ Z2 = 1, the coordinate (X3, Y3, Z3) of the result point data R calculated by point addition is as follows:

[0091] Z1Z1 = Z1 2

[0092] U2 = X2 * Z1Z1

[0093] S2 = Y2 * Z1 * Z1Z1

[0094] H = U2 - X1

[0095] HH = H 2

[0096] I = 4 * HH

[0097] J = H * I

[0098] r = 2 * (S2 - Y1)

[0099] V = X1 * I

[0100] X3 = r 2 -J - 2 * V

[0101] Y3 = r * (V - X3) - 2 * Y1 * J

[0102] Z3 = (Z1 + H) 2 -Z1Z1 - HH

[0103] If Z1≠ Z2, the coordinate (X3, Y3, Z3) of the result point data R calculated by point addition is as follows:

[0104] Z1Z1 = Z1 2

[0105] Z2Z2 = Z2 2

[0106] U1 = X1 * Z2Z2

[0107] U2 = X2 * Z1Z1

[0108] S1 = Y1 * Z2 * Z2 Z2

[0109] S2 = Y2 * Z1 * Z1 Z1

[0110] H = U2 - U1

[0111] I = (2 * H) 2

[0112] J = H * I

[0113] r = 2 * (S2 - S1)

[0114] V = U1 * I

[0115] X3 = r 2 - J - 2 * V

[0116] Y3 = r * (V - X3) - 2 * S1 * J

[0117] Z3 = ((Z1 + Z2) 2 - Z1 Z1 - Z2 Z2) * H

[0118] Therefore, the relationship between the Z coordinate values of the point data to be added and the point data to be added needs to be determined.

[0119] Step 150, converting the coordinate values of the multiple pairs of point data into target data corresponding to the data structure of AVX512IFMA.

[0120] It should be noted here that the conversion of the data structure of the coordinate values of the multiple pairs of point data needs to be performed according to the characteristics of AVX512IFMA, and since the AVX-512IFMA instruction set supports multiplication and addition operations on 52-bit unsigned integers in each 64-bit channel of two registers, it is natural to use 2 52 as the operation base. Each coordinate value in the coordinate values of the multiple pairs of point data is converted into a coordinate value vector with an operation base of 2 52 , and then a plurality of coordinate value vectors corresponding to each coordinate value of each kind of point data are formed into a vector set to obtain the target data.

[0121] Step 160, processing the target data based on the point addition formula and the large number operation rule to obtain the point addition result of the multiple pairs of point data.

[0122] Understandably, regardless of the target point addition formula, it needs to call the underlying large number operation rules to perform basic calculations. Therefore, after determining the target point addition formula and the target number domain to which the point data involved in the addition calculation belongs, a set of underlying large number operation rules is determined. Then, based on the target point addition formula, the corresponding set of underlying large number operation rules is called to process the multiple pairs of point data.

[0123] According to the parallel point addition method for elliptic curves based on AVX512IFMA provided in the embodiments of this application, by utilizing the feature of the single instruction multiple data set that can process multiple data elements of the same type simultaneously in the same instruction cycle, the underlying 8×1-way finite field operation and the upper-level 8×1-way point addition operation of the BLS121-381 curve are implemented. At the same time, since the underlying large number operation rules are determined based on the target number field, and the point addition formula is different as the coordinate relationship of the point data participating in the point addition calculation changes, various types of point addition operation interfaces can be provided. Using the AVX512IFMA instruction set to achieve 8×1-way parallel acceleration of the elliptic curve point addition part can achieve a significant performance optimization improvement.

[0124] In some embodiments, the relationship between the Z-coordinate value Z1 of the added point data and the Z-coordinate value Z2 of the added point data in each pair of point data includes three types, namely:

[0125] Z1=Z2=1, Z1≠Z2=1, and Z1≠Z2.

[0126] Specifically, point data on the BLS121-381 curve are typically represented using elliptic curve points in the Jacobian coordinate system. Therefore, the coordinates of point data on the BLS121-381 curve include three coordinate values: X, Y, and Z. The relationship between the Z coordinate values ​​of two points on the BLS121-381 curve involved in point addition determines the corresponding point addition formula. For example, if the coordinates of the point data P to be added are (X1, Y1, Z1), and the coordinates of the point data Q to be added are (X2, Y2, Z2), and Z1 = Z2 = 1, then the formula for calculating the coordinates (X3, Y3, Z3) of the resulting point data R is as follows:

[0127] H = X2 - X1

[0128] HH = H 2

[0129] I = 4 * HH

[0130] J = H * I

[0131] r = 2*(Y2 - Y1)

[0132] V = X1 * I

[0133] X3 = r 2 -J-2*V

[0134] Y3 = r*(V-X3)-2*Y1*J

[0135] Z3 = 2*H

[0136] If Z1≠Z2=1, the coordinate (X3, Y3, Z3) of the resultant point data R calculated by point addition is calculated by the following formula:

[0137] Z1Z1 = Z1 2

[0138] U2 = X2*Z1Z1

[0139] S2 = Y2*Z1*Z1Z1

[0140] H = U2-X1

[0141] HH = H 2

[0142] I = 4*HH

[0143] J = H*I

[0144] r = 2*(S2-Y1)

[0145] V = X1*I

[0146] X3 = r 2 -J-2*V

[0147] Y3 = r*(V-X3)-2*Y1*J

[0148] Z3 = (Z1+H) 2 -Z1Z1-HH

[0149] If Z1≠Z2, the coordinate (X3, Y3, Z3) of the resultant point data R calculated by point addition is calculated by the following formula:

[0150] Z1Z1 = Z1 2

[0151] Z2Z2 = Z2 2

[0152] U1 = X1*Z2Z2

[0153] U2 = X2*Z1Z1

[0154] S1 = Y1*Z2*Z2Z2

[0155] S2 = Y2*Z1*Z1Z1

[0156] H = U2 - U1

[0157] I = (2 * H) 2

[0158] J = H * I

[0159] r = 2*(S2 - S1)

[0160] V=U1*I

[0161] X3 = r 2 -J-2*V

[0162] Y3=r*(V-X3)2*S1*J

[0163] Z3 = ((Z1 + Z2)) 2 -Z1Z1-Z2Z2)*H

[0164] Therefore, it is necessary to determine the relationship between the Z coordinate values ​​of the data to be added and the data to be added.

[0165] It is understandable that the target number domain has two types of point data, namely the finite field of elliptic curve BLS12-381. Elliptic curve point group Point data in, and finite field of elliptic curve BLS12-381 Secondary extension

[0166] Elliptic curve point group The point data, plus the three different point addition formulas corresponding to the three different cases of the relationship between the Z coordinates of the two points involved in the point addition, can actually achieve 2×3=6 different point addition operations. That is, the calculation engine (i.e. device) corresponding to the parallel point addition method of elliptic curves based on AVX512IFMA provided in the embodiment of the present invention can include point addition of the three point addition formulas of the two groups of elliptic curves BLS12-381, that is, it provides 6 different point addition operation interfaces.

[0167] In some embodiments, step 150 may include:

[0168] Each coordinate value in the coordinates of the multi-point data is converted into a coordinate value vector corresponding to the target operation basis of AVX512IFMA;

[0169] The target data is obtained by constructing a vector set from the multiple coordinate value vectors corresponding to each coordinate value of each type of point data.

[0170] It should be noted that for each pair of point data, including the point data and the point data to be added, each point data is represented by three coordinate values X, Y and Z, each coordinate value is a large number, since the AVX-512 IFMA instruction set supports multiplication and addition operations on 52-bit unsigned integers in each 64-bit channel of two registers, first, each coordinate value is converted into a coordinate value vector with a base of 2 52 .

[0171] Then, the multiple coordinate value vectors corresponding to each coordinate value of each point data are rearranged to construct a vector set. Since there are two point data, the point data to be added and the point data to be added, each point data has three coordinate values X, Y and Z, so there are six vector sets in total. In order to facilitate the description of 8x1 parallel processing, the multiple pairs of point data participating in parallel point addition are set to 8 pairs of point data here and in the following. For example, the same type of point data P1, Q1, P2, Q2, P3, Q3, P4, Q4, P5, Q5, P6, Q6, P7, Q7, P8 and Q8 on the elliptic curve, if the point addition of the point data P1(X P1 , Y P1 , Z P1 ) and the point data to be added Q1(X Q1 , Y Q1 , Z Q1 ), the point addition of the point data P2(X P2 , Y P2 , Z P2 ) and the point data to be added Q2(X Q2 , Y Q2 , Z Q2 ), the point addition of the point data P3(X P3 , Y P3 , Z P3 ) and the point data to be added Q3(X Q3 , Y Q3 , Z Q3 ), the point addition of the point data P4(X P4 , Y P4 , Z P4 ) and the point data to be added Q4(X Q4 , Y Q4 , Z Q4 ), the point addition of the point data P5(X P5 , Y P5 , Z P5 ) and the point data to be added Q5(X Q5 , Y Q5 , Z Q5 ), the point addition of the point data P6(X P6 , Y P6 , Z P6 ) and the point data to be added Q6(XQ6 , Y Q6 , Z Q6 ) of the point addition, point addition data P7(X P7 , Y P7 , Z P7 ) and the point to be added Q7(X Q7 , Y Q7 , Z Q7 ) of the point addition, point addition data P8(X P8 , Y P8 , Z P8 ) and the point to be added Q8(X Q8 , Y Q8 , Z Q8 ) of the point addition, first, X P1 , Y P1 , Z P1 , X Q1 , Y Q1 , Z Q1 , X P2 , Y P2 , Z P2 , X Q2 , Y Q2 , Z Q2 , X P3 , Y P3 , Z P3 , X Q3 , Y Q3 , Z Q3 , X P4 , Y P4 , Z P4 , X Q4 , Y Q4 , Z Q4 , X P5 , Y P5 , Z P5 , X Q5 , Y Q5 , Z Q5 , X P6 , Y P6 , Z P6 , X Q6 , Y Q6 , Z Q6 , X P7 , Y P7 , Z P7 , X Q7 , Y Q7 , Z Q7 , X P8 , Y P8 , Z P8 , X Q8 , Y Q8 , Z Q8A total of 8x2x3=48 coordinate values are converted into coordinate value vectors with a base number of 2 52 , for example, the converted coordinate value vectors are VX P1 , VY P1 , VZ P1 , VX Q1 , VY Q1 , VZ Q1 , VX P2 , VY P2 , VZ P2 , VX Q2 , VY Q2 , VZ Q2 , VX P3 , VY P3 , VZ P3 , VX Q3 , VY Q3 , VZ Q3 , VX P4 , VY P4 , VZ P4 , VX Q4 , VY Q4 , VZ Q4 , VX P5 , VY P5 , VZ P5 , VX Q5 , VY Q5 , VZ Q5 , VX P6 , VY P6 , VZ P6 , VX Q6 , VY Q6 , VZ Q6 , VX P7 , VY P7 , VZ P7 , VX Q7 , VY Q7 , VZ Q7 , VX P8 , VY P8 , VZ P8 , VX Q8 , VY Q8 , VZ Q8; then each coordinate value of each point data corresponding to 8 coordinate value vectors are rearranged, to build a vector set, equivalent to the X coordinate value of the 8 coordinate value vectors in the point data to build a vector set, for the Y coordinate value of the 8 coordinate value vectors in the point data to build a vector set, for the Z coordinate value of the 8 coordinate value vectors in the point data to build a vector set, for the X coordinate value of the 8 coordinate value vectors in the point data to build a vector set, for the Y coordinate value of the 8 coordinate value vectors in the point data to build a vector set, for the Z coordinate value of the 8 coordinate value vectors in the point data to build a vector set, a total of 6 vector sets, then the above example, that is, to build 6 vector sets V1, V2, V3, V4, V5 and V6, wherein V1 = < VX P1 , VX P2 , VX P3 , VX P4 , VX P5 , VX P6 , VX P7 , VX P8 >, V2 = < VY P1 , VY P2 , VY P3 , VY P4 , VY P5 , VY P6 , VY P7 , VY P8 >, V3 = < VZ P1 , VZ P2 , VZ P3 , VZ P4 , VZ P5 , VZ P6 , VZ P7 , VZ P8 >, V4 = < VX Q1 , VX Q2 , VX Q3 , VX Q4 , VX Q5 , VX Q6 , VX Q7 , VX Q8 >, V5 = < VY Q1 , VY Q2 , VY Q3 , VY Q4 , VY Q5 , VY Q6 , VY Q7 , VY Q8 >, V6 = < VZ Q1 , VZ Q2 , VZ Q3 , VZ Q4 , VZQ5 , VZ Q6 , VZ Q7 , VZ Q8 >.

[0172] In some embodiments, converting each coordinate value in the coordinates of the multiple pairs of point data into a coordinate value vector corresponding to a target operation base of AVX512IFMA includes:

[0173] determining a data type corresponding to the multiple pairs of point data;

[0174] if the data type is a standard corresponding to an element on a finite field where the elliptic curve is located, converting each coordinate value in the coordinates of the multiple pairs of point data into a coordinate value vector corresponding to a target operation base of AVX512IFMA based on a preset rule;

[0175] if the data type is a preset data type expressed on a Montgomery field, converting each coordinate value in the coordinates of the multiple pairs of point data into a coordinate value vector corresponding to a target operation base of AVX512IFMA based on a Montgomery field conversion rule corresponding to the target number field.

[0176] It should be noted that since the point data obtained for participating in point addition can come from a database of different data structures, it is necessary to first determine the data type of the point data participating in point addition calculation. Generally, corresponding to the elliptic curve BLS12-381, the data type of the point data participating in point addition calculation is 381-bit binary number, so each coordinate value in the coordinates of the 8 pairs of point data can be directly converted into a coordinate value vector with an operation base of 2 52 based on a preset rule, but there are other cases, i.e., the point data participating in point addition calculation comes from a database of a specific Montgomery field, so for such other cases, each coordinate value in the coordinates of the 8 pairs of point data is converted into a coordinate value vector with an operation base of 2 52 based on a Montgomery field conversion rule corresponding to the target number field. For example, in most cases, the modern computer architecture is 64-bit, and 2 64 is often used as the operation base in large number operations, but in this application, the operation base of AVX512IFMA is 2 52 , so Montgomery field conversion is sometimes needed when performing point addition operation. Conversion of a field is essentially a process of Montgomery multiplication once, for example, a is a 381-bit binary large number, R1 is a first Montgomery field, and R2 is a second Montgomery field. To convert aR1 to aR2, only one aR1 and Montgomery multiplication on the finite field R2 in the R2 field is needed. To convert aR2 to aR1, only one aR2 and R1 Montgomery multiplication on the finite field Montgomery multiplication on the top.

[0177] In some embodiments, if the data type of each coordinate value in the coordinate of the point data is an element on a finite field corresponding to the elliptic curve, each coordinate value in the coordinate of the point data is converted into a coordinate value vector corresponding to the target operation base of AVX512IFMA based on a preset rule, including:

[0178] For any coordinate value f in the coordinate value of the point data, if the data type of any coordinate value f is an element on a finite field corresponding to the elliptic curve, the coordinate value vector F corresponding to the target operation base of AVX512IFMA corresponding to any coordinate value f is determined by the following formula:

[0179] f = f0+ 2 52 f1+ 2 104 f2+ 2 156 f3+ 2 208 f4+ 2 260 f5+ 2 312 f6+ 2 364 f7

[0180] F = [f0, f1, f2, f3, f4, f5, f6, f7]

[0181] Wherein, 0≤f i <2 52 and 0≤i<8, i is an integer, and the target operation base is 2 52 .

[0182] Specifically, based on the 8x1 data arrangement of the point data participating in the point addition realized by the AVX-512IFMA instruction set, first, the 2 52 point data representing 381-bit integers are used. Since the AVX-512IFMA instruction set supports multiplication and addition operations on 52-bit unsigned integers in each 64-bit channel of two registers, 2 52 can be naturally used as the base. For example, in the BLS12-381 curve, the 381-bit integer f represented by the base 2 52 can be represented as follows, where 0≤f i <2 52 and 0≤i<8.

[0183] f = f0+ 2 52 f1+ 2 104 f2+ 2 156 f3+ 2 208 f4+ 2 260 f5+ 2 312 f6+ 2 364 f7.

[0184] In some embodiments, a plurality of coordinate value vectors corresponding to each coordinate value of each point data forms a vector set, including:

[0185] The vector set V is determined by the following formula:

[0186]

[0187] wherein the plurality of coordinate value vectors corresponding to any coordinate of any point data are respectively F a , F b , F c , F d , F e , F f , F g and F h , any column of the vector set V corresponds to a coordinate value vector, and the ith row of the vector set V corresponds to a register vector v i = [f i a , f i b , f i c , f i d , f i e , f i f , f i g , f i h ], 0≤i<8, i is an integer.

[0188] Specifically, in the 8x1 parallel calculation of the present application, the main data structure is the vector set V, which is composed of eight vectors v i (0≤i<8). Each v i is composed of eight elements with a base of 2 52 , which can be stored in a 512-bit register for calculation. Here, the number of pairs of point data participating in parallel point addition is also set to be exactly 8, so for eight integers The vector set V is defined as follows, wherein each vector v i = [f i a , f i b , f i c , f i d , f i e , f i f , fi g ,f i h ]。

[0189]

[0190] Based on this data structure, the application can use AVX-512IFMA to implement 8x1 mode basic finite field operation. If the number of pairs of point data participating in parallel point addition is less than 8, for example, 5 pairs of point data are calculated by parallel point addition, then the F a ,F b ,F c ,F d and F e respectively correspond to 5 coordinate value vectors in turn, which are determined based on any coordinate value of any one of the 5 pairs of point data, and the remaining vectors F f ,F g and F h are processed by setting 0.

[0191] Here, the large number operation of different target number fields is described, and first, the large number operation on the finite field GF(2^8) is described below, including modulo addition, modulo subtraction, modulo multiply-addition, modulo multiplication and modulo square.

[0192] For modulo addition, modulo subtraction and modulo multiply-addition operation: the modulo addition operation can be represented as C←A+B mod Q, which includes three steps: first, add A and B, and store the result of their sum in C; then, subtract Q from C, but some channels in C may be negative, so a 512-bit mask vector is created, where each 64-bit element corresponds to 8 integers in C, if the integer in the channel is negative, the corresponding 64-bit element is set to all 1; if it is non-negative, it is set to all 0; by performing a bitwise AND operation between the mask vector and Q, and then adding Q to the negative integers in C, and the non-negative integers add 0 to the result. Based on the similar principle of the above steps, the modulo subtraction C←A-B mod Q only includes two steps, first subtract Y from X, and then use the mask to process the negative part. The modulo multiply-addition is the same as the modulo addition, except that the X and Y addition part in the first stage is replaced by left shift.

[0193] Modulo multiplication and modulo square: here the modulo multiplication adopts the Montgomery multiplication method, which is divided into two stages: integer multiplication and Montgomery reduction. The Montgomery multiplication uses the improved coarse integration hybrid scanning (CIHS) method. The modulo square is the same as the reduction part of the modulo multiplication, and the calculation part is changed from multiplication to square. The operation on GF(2^8) is calculated based on the finite field operation of GF(2^8). ​​The 8×1 modular multiplication can be accelerated using the Karatsuba algorithm. The number of multiplications is reduced from four to three. For modulo square, we can... The number of multiplications is reduced from three to two.

[0194] The parallel point addition method for elliptic curves based on AVX512IFMA provided in this application embodiment can be executed by a parallel point addition device for elliptic curves based on AVX512IFMA. This application embodiment uses the execution of the parallel point addition method for elliptic curves based on AVX512IFMA by a parallel point addition device for elliptic curves based on AVX512IFMA as an example to illustrate the parallel point addition device for elliptic curves based on AVX512IFMA provided in this application embodiment.

[0195] This application also provides a parallel point addition device for elliptic curves based on AVX512IFMA.

[0196] like Figure 2 As shown, the parallel point addition device for elliptic curves based on AVX512IFMA includes: a first determination module 210, a second determination module 220, a third determination module 230, a fourth determination module 240, a data arrangement module 250, and a data processing module 260, wherein...

[0197] The first determining module 210 is used to determine each coordinate in the coordinates of the multi-pair point data participating in parallel point addition, where each pair of point data includes two types of point data: adding point data and added point data.

[0198] The second determining module 220 is used to determine the target number domain corresponding to the multi-point data, wherein the target number domain is a finite field of an elliptic curve or a second-order extension of a finite field.

[0199] The third determining module 230 is used to determine the large number operation rules corresponding to the target number field;

[0200] The fourth determining module 240 is used to determine the target point addition formula of the multi-point data based on the relationship between the Z coordinate value Z1 of the added point data and the Z coordinate value Z2 of the added point data in each pair of point data.

[0201] The data layout module 250 is used to convert the coordinate values ​​of multi-point data into target data corresponding to the AVX512IFMA data structure.

[0202] The data processing module 260 is used to process the target data based on the target point addition formula and the large number operation rules to obtain the point addition result of multiple pairs of point data.

[0203] According to the parallel point addition device for an elliptic curve based on AVX512IFMA provided in the embodiments of the present application, by utilizing the feature that a single instruction multiple data instruction set can simultaneously process multiple data elements of the same type in the same instruction cycle, the underlying 8x1 path finite field operation of the BLS12-381 curve and the upper 8x1 path point addition operation are simultaneously implemented. Since the underlying large number operation rule is determined based on the target number field, and the point addition formula is different due to the change of the coordinate relationship of the point data participating in the point addition calculation, a plurality of types of point addition operation interfaces can be provided, and the 8x1 path parallel acceleration for the elliptic curve point addition part is implemented by using the AVX512IFMA instruction set, so that a substantial performance optimization improvement can be obtained.

[0204] In some embodiments, the relationship between the Z coordinate value Z1 of the point data to be added and the Z coordinate value Z2 of the point data to be added in each pair of point data in the plurality of pairs of point data includes three types, respectively:

[0205] Z1=Z2=1, Z1≠Z2=1, and Z1≠Z2.

[0206] Each coordinate value in the coordinates of the plurality of pairs of point data is converted into a coordinate value vector corresponding to the target operation base number of AVX512IFMA.

[0207] A plurality of coordinate value vectors corresponding to each coordinate value of each pair of point data are constructed into a vector set to obtain target data.

[0208] In some embodiments, converting each coordinate value in the coordinates of the plurality of pairs of point data into a coordinate value vector corresponding to the target operation base number of AVX512IFMA includes:

[0209] Determining the data type corresponding to the plurality of pairs of point data.

[0210] If the data type is a standard element corresponding to the finite field on which the elliptic curve is located, each coordinate value in the coordinates of the plurality of pairs of point data is converted into a coordinate value vector corresponding to the target operation base number of AVX512IFMA based on a preset rule.

[0211] If the data type is a preset data type expressed on a Montgomery field, each coordinate value in the coordinates of the plurality of pairs of point data is converted into a coordinate value vector corresponding to the target operation base number of AVX512IFMA based on a Montgomery field conversion rule corresponding to the target number field.

[0212] In some embodiments, if the data type is a standard element corresponding to the finite field on which the elliptic curve is located, converting each coordinate value in the coordinates of the plurality of pairs of point data into a coordinate value vector corresponding to the target operation base number of AVX512IFMA based on a preset rule includes:

[0213] For any coordinate value f in the coordinate values of the multiple pairs of point data, the data type of any coordinate value f is a standard corresponding to an element on a finite field where the elliptic curve is located, and a coordinate value vector F corresponding to a target operation basis of AVX512IFMA corresponding to any coordinate value f is determined by the following formula:

[0214] f = f0+2 52 f1+2 104 f2+2 156 f3+2 208 f4+2 260 f5+2 312 f6+2 364 f7

[0215] F = [f0, f1, f2, f3, f4, f5, f6, f7]

[0216] Wherein, 0≤f i <2 52 And 0≤i<8, i is an integer, and the target operation basis is 2 52 .

[0217] In some embodiments, a plurality of coordinate value vectors corresponding to each coordinate value of each point data are constructed into a vector set, including:

[0218] The vector set V is determined by the following formula:

[0219]

[0220] Wherein, the plurality of coordinate value vectors corresponding to any coordinate of any point data are respectively F a , F b , F c , F d , F e , F f , F g and F h Any column of the vector set V corresponds to a coordinate value vector, and the ith row of the vector set V corresponds to a register vector v i = [f i a , f i b , f i e , f i d , f i e , f i f , f i g , f i h], 0≤i<8, i is an integer.

[0221] The parallel point addition device for elliptic curve based on AVX512 IFMA in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.

[0222] The parallel point addition device for elliptic curve based on AVX512 IFMA in the embodiments of the present application can be a device with an operating system. The operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems, and the embodiments of the present application are not limited in this regard.

[0223] The parallel point addition device for elliptic curve based on AVX512 IFMA provided in the embodiments of the present application can implement Figure 1 The processes implemented by the method embodiments are not repeated here to avoid repetition.

[0224] Based on the above embodiments, the embodiments of the present application further provide a fast implementation method and device for point addition of elliptic curve based on AVX512 IFMA instruction set, accelerate the implementation of elliptic curve point addition on the CPU platform, provide an engine computing interface, which can be used in application scenarios such as digital signature, privacy protection, and zero-knowledge proof. In the embodiments, the point addition of the group and the group is divided into three cases according to the Z coordinate, and six computing engines are implemented.

[0225] Figure 3As shown, the scheme can be divided into three parts: 8x1 data arrangement, finite field operation and point operation, which are described in detail as follows:

[0226] Part 1: 8x1 data arrangement.

[0227] Since the AVX-512IFMA instruction set supports multiplication and addition operations on 52-bit unsigned integers in each 64-bit channel of two registers, it can be naturally used as a 2 52 As the base. For example, in the BLS12-381 curve, a 381-bit integer f represented by the base 2 52 can be represented as follows, where 0≤f i <2 52 and 0≤i<8.

[0228] f=f0+2 52 f1+2 104 f2+2 156 f3+2 208 f4+2 260 f5+2 312 f6+2 364 f7

[0229] In our 8x1 parallel computation, the main data structure is the vector set V, which consists of 8 vectors v i (0≤i<8). Each v i is composed of eight base-2 52 elements and can be stored in a 512-bit register for computation. For the eight integers The vector set V is defined as follows, where each vector v i =[f i a , f i b , f i c , f i d , f i e , f i f , f i g , f i h ].

[0230]

[0231] Based on this data structure, the AVX-512IFMA can be used to implement the basic finite field operation in 8x1 mode.

[0232] Part 2: Finite field operation.

[0233] This part can realize Domain and its quadratic extension field Large number operations on the field, mainly including: modular addition, modular subtraction, modular multiply-addition, modular multiplication, modular square and Montgomery field conversion.

[0234] For modular addition, modular subtraction and modular multiply-addition operations: modular addition operation can be represented as C←A+B mod Q, which includes three steps: first, add A and B, and store the result of their sum in C; then, subtract Q from C, but some channels in C may appear negative, so create a 512-bit mask vector, where each 64-bit element corresponds to 8 integers in C, if the integer in the channel is negative, the corresponding 64-bit element is set to all 1; if it is non-negative, it is set to all 0; by performing a bitwise AND operation between the mask vector and Q, and then adding Q to the negative integers in C, and adding 0 to the non-negative integers, which has no effect on the result. Based on the similar principle of the above steps, modular subtraction C←A-B mod Q only includes two steps, first subtract Y from x, and then use the mask to process the negative part. Modular multiply-addition is the same as modular addition, except that the first stage of X and Y addition is replaced by left shift.

[0235] Modular multiplication and modular square: here the modular multiplication adopts the Montgomery multiplication method, which is divided into two stages: integer multiplication and Montgomery reduction. Montgomery multiplication uses the improved coarse integration hybrid scanning (CIHS) method. The reduction part of the modular square is the same as that of the modular multiplication, and the calculation part is changed from multiplication to square. The operation on the field is calculated based on the finite field operation For 8x1 modular multiplication on the field , the Karatsuba algorithm can be used to accelerate the number of multiplications from four to three, and for modular square, the number of multiplications can be reduced from three to two.

[0236] Montgomery field conversion: in most cases, the modern computer architecture is 64-bit, and when performing large number operations, 2 64 is often used as the operation base, but in this application, the operation base of AVX512IFMA is 2 52 , so sometimes Montgomery field conversion is needed when performing point addition operation. Once the field conversion is essentially a process of once Montgomery multiplication, for example, a is a 381-bit binary large number, R1 is the first Montgomery field, and R2 is the second Montgomery field. To convert aR1 to aR2, only one aR1 and Montgomery multiplication in the finite field ; to convert aR2 to aR1, only one aR2 and R1 in the finite field Montgomery multiplication on the curve.

[0237] Part 3: Point operation.

[0238] For an elliptic curve point in Jacobian coordinates, it can be represented as (X, Y, Z). For point P1 and point P2, the point addition formula can be divided into PADD * , PADD and PADD + according to Z1 = Z2 = 1, Z1 ≠ Z2 = 1 and Z1 ≠ Z2. For the 8x1 way point operation part, the underlying 8x1 way finite field operation can be directly called to calculate the result according to the point addition formula.

[0239] In some embodiments, as Figure 4 shown, the embodiment of the present application also provides an electronic device 400, which includes a processor 401, a memory 402, and a computer program stored in the memory 402 and capable of running on the processor 401. When the program is executed by the processor 401, it implements each process of the above-mentioned parallel point addition method of elliptic curve based on AVX512IFMA embodiment and achieves the same technical effects. To avoid repetition, it will not be repeated here.

[0240] It should be noted that the electronic device in the embodiment of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.

[0241] The embodiment of the present application also provides a non-transitory computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements each process of the above-mentioned parallel point addition method of elliptic curve based on AVX512IFMA embodiment and achieves the same technical effects. To avoid repetition, it will not be repeated here.

[0242] Among them, the processor is the processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer readable storage medium, such as a computer readable memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0243] The embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the above-mentioned parallel point addition method of elliptic curve based on AVX512IFMA.

[0244] Among them, the processor is the processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer readable storage medium, such as a computer readable memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0245] The chip provided by the embodiment of the present application also includes a processor and a communication interface, the communication interface is coupled with the processor, the processor is used to run programs or instructions, and each process of the parallel point addition method of the elliptic curve based on the AVX512IFMA is realized, and the same technical effects can be achieved. To avoid repetition, details are not described here.

[0246] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system chip, a system chip, a chip system or a system on chip, etc.

[0247] It should be noted that in this paper, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to the order of the functions shown or discussed, but also includes the functions performed in a substantially simultaneous manner or in the opposite order, for example, the described method can be performed in a different order from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.

[0248] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions for making a terminal (which can be a mobile phone, computer, server or network equipment, etc.) execute the method of each embodiment of the present application.

[0249] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, the above-mentioned specific embodiments are only illustrative, not restrictive, and those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the protection scope of the claims.

[0250] In the description of the application, reference has been made to descriptive terms such as "one embodiment", "some embodiments", "an embodiment", "example", "specific example" or "some examples" etc. Such terminology means that a particular feature, structure, material or characteristic being described is included in at least one embodiment or example of the application. The illustrative appearances of such terminology in various places in the specification does not necessarily refer to the same embodiment or example. Moreover, it is appreciated that the specific features, structures, materials or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0251] Although embodiments of this application have been shown and described, it is to be understood that various modifications, substitutions, combinations, and variations can be made therein without departing from the spirit and scope of the application, which is defined by the appended claims and their equivalents.

Claims

1. A parallel point addition method for elliptic curves based on AVX512IFMA, characterized in that, The method comprises: determining each coordinate in the coordinates of a plurality of pairs of point data participating in parallel point addition, each pair of point data comprising two kinds of point data, i.e., point data to be added and point data to be added; determining a target number field corresponding to the plurality of pairs of point data, the target number field being a finite field of the elliptic curve or a quadratic extension field of the finite field; determining a large number operation rule corresponding to the target number field; based on a relationship between a Z coordinate value of the added point data in each pair of point data of the plurality of pairs of point data and a Z coordinate value of the added point data determine a target point adding formula for the plurality of pairs of point data converting coordinate values of the plurality of pairs of point data into target data corresponding to a data structure of the AVX512IFMA; processing the target data based on the target point addition formula and the large number operation rule to obtain a point addition result of the plurality of pairs of point data; wherein the converting of the coordinate values of the plurality of pairs of point data into the target data corresponding to the data structure of the AVX512IFMA comprises: converting each coordinate value in the coordinates of the plurality of pairs of point data into a coordinate value vector corresponding to a target operation basis of the AVX512IFMA; and constructing a plurality of coordinate value vectors corresponding to each coordinate value of each kind of point data into a vector set to obtain the target data.

2. The parallel point-add method for elliptic curves based on AVX512IFMA according to claim 1, wherein, the relationship between the Z coordinate value of the added point data in each pair of point data in the plurality of pairs of point data and the Z coordinate value of the added point data includes three kinds, respectively: , = 1, and .

3. The parallel point-add method for elliptic curves based on AVX512IFMA according to claim 1, wherein, The converting of each coordinate value in the coordinates of the plurality of pairs of point data into the coordinate value vector corresponding to the target operation basis of the AVX512IFMA comprises: determining a data type corresponding to the plurality of pairs of point data; if the data type is a standard element corresponding to a finite field in which the elliptic curve is located, converting each coordinate value in the coordinates of the plurality of pairs of point data into a coordinate value vector corresponding to the target operation basis of the AVX512IFMA based on a preset rule; if the data type is a preset data type expressed on a Montgomery field, converting each coordinate value in the coordinates of the plurality of pairs of point data into a coordinate value vector corresponding to the target operation basis of the AVX512IFMA based on a Montgomery field conversion rule corresponding to the target number field.

4. The parallel point-add method for elliptic curves based on AVX512IFMA according to claim 3, wherein, The converting of each coordinate value in the coordinates of the plurality of pairs of point data into the coordinate value vector corresponding to the target operation basis of the AVX512IFMA based on the preset rule if the data type is the standard element corresponding to the finite field in which the elliptic curve is located comprises: For any coordinate value in the coordinate values ​​of the multi-point data any coordinate value The data type is a standard element corresponding to the finite field containing the elliptic curve, and any coordinate value is determined by the following formula. The corresponding coordinate value vector F corresponds to the target computational basis of the AVX512IFMA: F [ ] wherein , is an integer, the target operation radix is .

5. The parallel point-add method for elliptic curves based on AVX512IFMA of claim 1, wherein, the constructing of the plurality of coordinate value vectors corresponding to each coordinate value of each kind of point data into the vector set comprises: The set of vectors is determined by the equation : Wherein, the plurality of coordinate value vectors corresponding to any coordinate of any one of the point data are respectively , any column of the vector set V corresponds to a coordinate value vector, the first row of the vector set V corresponds to a register vector = , , is an integer.

6. An AVX512IFMA based parallel point addition apparatus for elliptic curves, characterized in that, The method comprises: a first determining module configured to determine each coordinate in the coordinates of a plurality of pairs of point data participating in parallel point addition, each pair of point data comprising two kinds of point data, i.e., point data to be added and point data to be added; a second determining module configured to determine a target number field corresponding to the plurality of pairs of point data, the target number field being a finite field of the elliptic curve or a quadratic extension field of the finite field; a third determining module configured to determine a large number operation rule corresponding to the target number field; a fourth determining module, configured to determine a target point adding formula of the multiple pairs of point data based on a relationship between a Z coordinate value of the added point data in each pair of point data of the multiple pairs of point data and a Z coordinate value of the added point data of the multiple pairs of point data. a data arrangement module configured to convert coordinate values of the plurality of pairs of point data into target data corresponding to a data structure of the AVX512IFMA; a data processing module configured to process the target data based on the target point addition formula and the large number operation rule to obtain a point addition result of the plurality of pairs of point data. The data arrangement module is further configured to convert each coordinate value in the coordinates of the multiple pairs of point data into a coordinate value vector corresponding to a target operation basis of the AVX512IFMA; and form a vector set by using multiple coordinate value vectors corresponding to each coordinate value of each kind of point data, to obtain target data.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the parallel point addition method of the elliptic curve based on the AVX512IFMA when executing the program.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the parallel point addition method of the elliptic curve based on the AVX512IFMA.

9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the parallel point addition method of the elliptic curve based on the AVX512IFMA.

Citation Information

Patent Citations

  • Sm2 performance optimization implementation method

    CN112134704A

  • Elliptic curve point octupling using single instruction multiple data processing

    US20060210068A1