WO2024045665A1 - 多点乘运算系统、方法、图形处理器、电子装置及设备 - Google Patents

多点乘运算系统、方法、图形处理器、电子装置及设备 Download PDF

Info

Publication number
WO2024045665A1
WO2024045665A1 PCT/CN2023/091551 CN2023091551W WO2024045665A1 WO 2024045665 A1 WO2024045665 A1 WO 2024045665A1 CN 2023091551 W CN2023091551 W CN 2023091551W WO 2024045665 A1 WO2024045665 A1 WO 2024045665A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
cycle
target point
target
preset
Prior art date
Application number
PCT/CN2023/091551
Other languages
English (en)
French (fr)
Inventor
马帅
Original Assignee
北京象帝先计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京象帝先计算技术有限公司 filed Critical 北京象帝先计算技术有限公司
Publication of WO2024045665A1 publication Critical patent/WO2024045665A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/724Finite field arithmetic
    • G06F7/725Finite field arithmetic over elliptic curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • H04L9/3252Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using DSA or related signature schemes, e.g. elliptic based signatures, ElGamal or Schnorr schemes

Definitions

  • the present disclosure relates to the field of data processing, and in particular to a multi-point multiplication operation system, a graphics processor, an electronic device, an electronic device and a multi-point multiplication operation method.
  • the multi-point multiplication operation kP+tQ is involved, where k and t are scalars, and P and Q are coordinate points on the elliptic curve.
  • low Hamming weight representation (such as joint sparse or non-adjacent representation) is usually used to convert the scalars in the multi-point multiplication operation into multiple sets of coefficients, and the scalars in the multi-point multiplication operation are converted according to the coordinate points P and Q, calculate the coordinate points A, S, U, V, B and D, and save the coordinate points P, Q, A, S, U, V, B and D as preset elements.
  • U is equal to negative A
  • V is equal to negative S
  • B is equal to negative P
  • D is equal to negative Q.
  • the purpose of the present disclosure is to provide a multi-point multiplication operation system, a graphics processor, an electronic device, an electronic device and a multi-point multiplication operation method, which can reduce the multi-point multiplication operation requirements without significantly affecting the multi-point multiplication operation speed. Storage space occupied.
  • a multi-point multiplication operation system which system includes: a control module and a point multiplication module;
  • the control module is configured to: when the target point R updated in the i-1th cycle is equal to the infinity point, if the target element determined based on the i-th set of coefficients in the i-th cycle is a negative value of the preset element, Then in the i-th cycle, the preset elements are obtained from the storage module, the target point R is updated using the preset elements, and the first signal is set to the first preset value; where the multipoint multiplication operation includes multiple sets of coefficients according to The target point R is updated in the second loop, and multiple sets of coefficients are obtained by converting multiple scalars in multi-point multiplication operations;
  • the point doubling module is configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the first signal is the first preset value, then in the i-th cycle, the target point R is updated.
  • the subtrahends and minuends in the original doubling operation are swapped, and the doubling operation is performed on the target point R based on the swapped subtrahends and minuends.
  • control module is further configured to: set the first signal to the second preset value between the first event and the second event; the first event refers to: the doubling point module The first signal is read in the i-th cycle; the second event refers to: when the target point R updated in the i-th cycle is not equal to the infinity point, the doubling point module reads the A signal.
  • the point doubling module is also configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the first signal is the second preset value, Then perform the original point doubling operation on the target point R in the i-th loop.
  • control module is further configured to: between the first event and the third event, set the first signal to the second preset value; the first event refers to: the doubling point module The first signal is read in the i-th cycle; the third event refers to: when the target point R updated in the i-th cycle is equal to the infinity point, in the i+1-th cycle according to the i+1 set of coefficients Determine target elements;
  • control module is also configured to: when the target point R updated in the i-th cycle is equal to the infinity point, in the i+1-th cycle, determine the target element as the preset element based on the i+1-th set of coefficients. After that, the first signal is set to the second preset value.
  • the system also includes: a point-and-add module;
  • the control module is also configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the target element determined based on the i-th set of coefficients in the i-th cycle is the negative of the preset element. value, then the second signal is set to the third preset value;
  • the point addition module is configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the second signal is the third preset value, then obtain it from the storage module in the i-th cycle
  • the preset element is to combine the target point R after the point doubling operation in the i-th cycle with the preset
  • the elements are subtracted, and the subtraction result is used to update the target point R.
  • control module is further configured to: between the fourth event and the fifth event, set the second signal to the fourth preset value; the fourth event means: the point-adding module The second signal is read in the i-th cycle; the fifth event refers to: when the target point R updated in the i-th cycle is not equal to the infinite point, the point addition module reads the second signal in the i+1-th cycle. Two signals.
  • the point addition module is further configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the second signal is the fourth preset value, Then in the i-th cycle, the preset elements are obtained from the storage module, the target point R after the point doubling operation in the i-th cycle is added to the preset elements, and the target point R is updated using the addition result.
  • the point-and-add module is specifically configured to: connect the input end of the point-and-add module to the target storage part among the multiple storage parts of the storage module to obtain the preset elements stored in the target storage part. .
  • control module is also configured to: read the target point R updated in the last cycle from the storage module in the current cycle, and after updating the target point R using the preset elements, update the target point R
  • the target point R is stored in the storage module to overwrite the target point R already stored in the storage module;
  • the point doubling module is also configured to: read the target point R updated in the previous cycle from the storage module in the current cycle, and after performing a doubling operation on the read target point R, store the target point R after the doubling operation. to the storage module to overwrite the target point R already stored in the storage module;
  • the point addition module is also configured to: read the target point R after the point doubling operation in the current cycle from the storage module in the current cycle; after updating the target point R using the subtraction result/addition result, the updated target point R is stored to the storage module to overwrite the target point R already stored in the storage module.
  • each scalar participating in the multipoint multiplication operation is converted into the result of N exponential operation results multiplied by the corresponding coefficients and then added together.
  • the corresponding coefficients of the i-th exponential operation result of a scalar are collectively used as a set of coefficients, and i is a positive integer less than or equal to N.
  • the conversion method of each scalar is a low Hamming re-conversion method.
  • the preset elements are coordinate points calculated based on coordinate points participating in the multi-point multiplication operation.
  • a graphics processor is also provided.
  • the graphics processor includes the multi-point multiplication system described in any of the above embodiments.
  • an electronic device including the above-mentioned graphics processor.
  • the product form of the electronic device is a graphics card; in other usage scenarios, the product form of the electronic device is a motherboard integrated with a graphics processor.
  • an electronic device which includes the above-mentioned electronic device.
  • the product form of the electronic device is a portable electronic device, such as a smartphone, tablet computer, VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, game console, etc.
  • a multi-point multiplication operation method including:
  • the target point R updated in the i-1th cycle is equal to the infinity point
  • the target element determined based on the i-th set of coefficients in the i-th cycle is a negative value of the preset element
  • the preset elements from the storage module, and use the preset elements to update the target point R;
  • the subtrahends and minuends in the original doubling operation of the target point R are swapped, and the doubling operation is performed on the target point R based on the swapped subtrahends and minuends.
  • the multi-point multiplication operation method also includes:
  • the target point R updated in the i-1th cycle is equal to the infinity point
  • the target element determined based on the i-th set of coefficients in the i-th cycle is a preset element, then in the i-th cycle, the target point R is updated from the storage
  • the module obtains the preset elements and uses the preset elements to update the target point R;
  • the original point doubling operation is performed on the target point R.
  • the multi-point multiplication operation method also includes:
  • the preset element is obtained from the storage module in the i+1th cycle, and the i+1th In the second loop, the target point R after the point doubling operation is subtracted from the preset elements, and the subtraction result is used to update the target point R.
  • the multi-point multiplication operation method also includes:
  • the preset elements are obtained from the storage module in the i+1th cycle, and the The target point R after the point multiplication operation is added to the preset elements, and the addition result is used to update the target point R.
  • the multi-point multiplication operation method before performing the loop operation, also includes:
  • each scalar participating in the multi-point multiplication operation into the result of N exponential operation results multiplied by the corresponding coefficients and then added together.
  • the corresponding coefficients of the i-th exponential operation result of each scalar are collectively used as a set of coefficients, i is A positive integer less than or equal to N.
  • the conversion method of each scalar is a low Hamming re-conversion method.
  • the multi-point multiplication operation method before performing the loop operation, also includes:
  • Figure 1 is a schematic structural diagram of a multi-point multiplication operation system provided by an embodiment of the present disclosure
  • Figure 2 is a schematic flowchart of a multi-point multiplication operation method provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a multi-point multiplication operation method provided by another embodiment of the present disclosure.
  • the terms “first”, “second”, etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used solely to distinguish one characteristic from another.
  • connection or communication between the two components may be understood as a direct connection or communication, or a direct connection or communication between the two components. It can be understood as indirect connection or communication through intermediate components.
  • multi-point multiplication operations also called multi-scalar multiplication operations
  • methods such as joint sparse or non-adjacent representation are usually used to convert the scalars in the multi-point multiplication operation into multiple sets of coefficients, and multiple points are calculated based on the coordinate points in the multi-point multiplication operation. other coordinate points and store them. Then, loop through each set of coefficients, determine the coordinate points corresponding to the set of coefficients based on each set of coefficients traversed, and use the determined coordinate points to update the target point R. After traversing all the coefficients, the final target point R is determined as the result of the multi-point multiplication operation.
  • U is equal to negative A
  • V is equal to negative S
  • B is equal to negative P
  • D is equal to negative Q.
  • one coordinate point is equal to the negative value of another coordinate point, or the two coordinate points are opposite numbers to each other.
  • U is equal to negative A.
  • the present disclosure provides a multi-point multiplication operation system, a graphics processor, an electronic device, an electronic device and a multi-point multiplication operation system. Operation method.
  • FIG. 1 is a schematic structural diagram of a multi-point multiplication operation system provided by an embodiment of the present disclosure. As shown in Figure 1, the system includes a control module and a doubling point module.
  • the control module is configured to: when the target point R updated in the i-1th cycle is equal to the infinity point, if the target element determined based on the i-th set of coefficients in the i-th cycle is a negative value of the preset element, In the i-th cycle, the preset elements are obtained from the storage module, the target point R is updated using the preset elements, and the first signal is set to the first preset value.
  • the point doubling module is configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the first signal is the first preset value, then in the i-th cycle, the target point R is updated.
  • the subtrahends and minuends in the original doubling operation are swapped, and the doubling operation is performed on the target point R based on the swapped subtrahends and minuends.
  • using the preset elements to update the target point R means: assigning the preset elements to the target point R. In other words, the default feature as the new target point R.
  • the first preset value is equal to 1. In the case where the target point R updated in the i-1th cycle is equal to the infinity point, if the target element determined based on the i-th set of coefficients in the i-th cycle is a negative value of the preset element, then in the i-th cycle In, the preset elements are obtained from the storage module, the target point R is updated using the preset elements, and the first signal is set to 1. It should be noted that the first preset value equal to 1 is one of the various embodiments of the present disclosure. For example, in other embodiments, the first preset value equals 0. This disclosure does not limit the specific numerical value of the first preset value.
  • the multipoint multiplication operation includes: updating the target point R through multiple cycles based on multiple sets of coefficients, which are obtained by converting multiple scalars of the multipoint multiplication operation.
  • each scalar participating in the multi-point multiplication operation is converted into the result of N exponential operation results multiplied by the corresponding coefficients and then added together.
  • the th of each scalar is The corresponding coefficients of i exponential operation results are collectively used as a set of coefficients, and i is a positive integer less than or equal to N.
  • the conversion method of each scalar is a low Hamming re-conversion method.
  • Low Hamming re-conversion methods include but are not limited to: joint sparse form (JSF, joint sparse form) and non-adjacent representation (NAF, Non-adjacent form).
  • 2 e-1 , 2 e-2 ...2 1 , 2 0 are the exponential operation results
  • k[e-1], k[e-2]..k[1], k[0] are the exponents The corresponding coefficient of the operation result.
  • 2 e-1 , 2 e-2 ...2 1 , 2 0 are the exponential operation results
  • t[e-1], t[e-2]..t[1], t[0] are the exponents The corresponding coefficient of the operation result.
  • k[e-1] and t[e-1] are regarded as a set of coefficients
  • k[e-2] and t[e-2] are regarded as a set of coefficients.
  • k[0] and t[0] as a set of coefficients to obtain multiple sets of coefficients.
  • k[e-1] and t[e-1] are non-negative and at least one is non-0, and the value range of the remaining coefficients is ⁇ 0, 1, -1 ⁇ .
  • the preset elements are coordinate points calculated based on coordinate points participating in multi-point multiplication operations. In order to speed up the operation, you can calculate the preset elements based on the coordinate points participating in the multi-point multiplication operation and save the preset elements before performing the loop operation.
  • each set of coefficients corresponds to a preset element. For example, when k[e-2] is equal to 1 and t[e-2] is equal to 0, the corresponding coordinate point P is. When k[e-2] is equal to 0 and t[e-2] is equal to 1, the corresponding coordinate point Q is. When k[e-2] is equal to 1 and t[e-2] is equal to 1, the corresponding coordinate point A is. When k[e-2] is equal to 1 and t[e-2] is equal to -1, the corresponding coordinate point S is.
  • the control module will determine whether the target point R updated in the i-1th loop (ie, the previous loop) is equal to the infinity point.
  • the control module will determine whether R i-1 is equal to the infinity point. If the control module determines that the target point R updated in the i-1th cycle is equal to the infinity point, then in the i-th cycle, the control module will determine the target based on a set of coefficients corresponding to the i-th cycle (i.e., the i-th set of coefficients) elements, and use the target elements to update the target point R.
  • a set of coefficients corresponding to the i-th cycle i.e., the i-th set of coefficients
  • the point doubling module will perform a point doubling operation on the target point R, and then other modules may also perform doubling point operations. Perform other operations on the target point R after doubling the points (for example, the point addition module can perform point addition operations on the target point R after doubling the points and the preset features).
  • the control module determines that the target point R updated in the i-1 cycle is equal to the infinity point, the control module will determine the target element based on a set of coefficients corresponding to this cycle. If it is determined that The target element is a negative value of a certain preset element, then the preset element is obtained from the storage module, and the target point R is updated using the preset element.
  • the control module determines that the target element is the coordinate point D based on a set of coefficients [0, -1] corresponding to this cycle. Since D is equal to negative Q, the preset element Q is obtained from the storage module, and based on The default element Q updates the target point R.
  • a first signal is set. If the control module does not use the actual target element to update the target point R, but uses the opposite number of the target element (for example, Q is the opposite number of D) to update the target point R, then the control module sets the first signal to the first preset value. , and end this cycle. In other words, if the first signal is the first preset value, it means that the control module does not use the actual target element to update the target point R, but uses the opposite number of the target element to update the target point R.
  • the control module determines that the target point R updated in the i-1 cycle is not equal to the infinity point, the doubling point module will perform a doubling point operation based on the signal value of the first signal.
  • the first signal is the first preset value, it means that the control module uses the opposite number of the target element to update the target point R in the i-1th cycle. Therefore, the target point R at this time is the opposite number of the real target point R.
  • the point doubling module swaps the subtrahend and the minuend in the original doubling operation, and performs the doubling operation on the target point R based on the swapped subtrahend and minuend, so that the doubling point
  • the calculated target point R is equal to the real target point R.
  • the original doubling operation is:
  • the doubling point operation is actually a modulo subtraction operation between the subtrahend and the minuend
  • the input of the modulo subtraction operation is the storage address of the subtrahend and the minuend.
  • the actual target element for example, D
  • the opposite number of the target element for example, Q
  • the opposite number prime (such as Q) of the target element is used to update the target point R, and in the i-th cycle , by swapping the subtrahends and minuends in the original doubling operation, and performing a doubling operation on the target point R based on the swapped subtrahends and minuends.
  • the inversion operation that should be performed in the i-1th loop can be compensated (for example, after inverting the preset elements, the target point R can be updated using the inverted preset elements. ; Or after updating the target point R using the preset elements, negate the target point R).
  • the present disclosure does not require an additional negation operation, it does not introduce obvious calculation overhead and thus does not significantly affect the multi-point multiplication operation rate.
  • the present disclosure reduces the storage space required for multi-point multiplication operations without significantly affecting the multi-point multiplication operation speed.
  • control module is further configured to: in the case where the target point R updated in the i-1th cycle is equal to the infinity point, if the target element determined according to the i-th set of coefficients in the i-th cycle is If the preset element is used, the preset element is obtained from the storage module in the i-th cycle, the target point R is updated using the preset element, and the first signal is set to the second preset value, or when the first signal is already the second In the case of a preset value, the first signal is maintained at the second preset value.
  • the control module will determine that the target element is the preset element Q based on a set of coefficients [0,1] corresponding to this cycle, then obtain the preset element Q from the storage module, and update it according to the preset element Q Target point R. Since in this cycle, the control module uses the actual target element to update the target point R, instead of using the opposite number of the target element to update the target point R, the first signal is set to the second preset value, or the first signal is Remain at the second default value.
  • the second preset value is equal to 0. It should be noted that the second preset value equal to 0 is one of the various embodiments of the present disclosure. For example, in other embodiments, the second preset value is equal to 1. This disclosure does not limit the specific numerical value of the second preset value.
  • control module is further configured to: between the first event and the second event, set the first signal to the second preset value; the first event refers to: the point doubling module in the i-th cycle The first signal is read in the i-th cycle; the second event refers to: when the target point R updated in the i-th cycle is not equal to the infinity point, the doubling point module reads the first signal in the i+1-th cycle.
  • the first signal is the second preset value, it means that the target point R at this time is equal to the real target point R.
  • control module can set the first signal to the second preset value at any time between the first event and the second event. This disclosure does not limit the specific time. For example, in some specific implementations, the control module may set the first signal to the second preset value after the point doubling module performs the point doubling operation, thereby indicating that the target point R at this time is equal to the real target point R.
  • the control module does not temporarily set the first signal to the second preset value, but in the next cycle when the target point R is determined to be not At the infinity point, the control module sets the first signal to the second preset value, thereby indicating that the target point R at this time is equal to the real target point R.
  • the point doubling module is further configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the first signal is the second preset value, then in the i-th cycle update, In the second loop, the original point doubling operation is performed on the target point R.
  • the point doubling module will perform a point doubling operation based on the signal value of the first signal.
  • the first signal is the second preset value, it means that the target point R at this time is the real target point R.
  • the point doubling module will perform the original point doubling operation on the target point R:
  • control module is further configured to: between the first event and the third event, set the first signal to the second preset value; the first event refers to: the point doubling module in the i-th cycle The first signal is read in; the third event refers to: when the target point R updated in the i-th cycle is equal to the infinity point, the target element is determined based on the i+1 set of coefficients in the i+1-th cycle.
  • the control module is also configured to: when the target point R updated in the i-th cycle is equal to the infinity point, determine the i+1 set of coefficients in the i+1-th cycle. After the target element is a preset element, the first signal is set to the second preset value.
  • the control module may set the first signal to the second preset value after the point doubling module performs the point doubling operation, thereby indicating that the target point R at this time is equal to the real target point R.
  • the control module does not temporarily set the first signal to the second preset value, but in the next cycle when the target point R is determined to be infinity
  • the control module sets the first signal to the second preset value, thereby indicating that the target point R at this time is equal to the real target point R.
  • the system may also include a point and add module.
  • the control module is also configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the target element determined based on the i-th set of coefficients in the i-th cycle is the negative of the preset element. value, the second signal is set to the third preset value.
  • the point addition module is configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the second signal is the third preset value, then obtain it from the storage module in the i-th cycle
  • the preset element is to subtract the target point R after the point doubling operation in the i-th cycle from the preset element, and use the subtraction result to update the target point R.
  • the control module in the i-th cycle (that is, this cycle), the control module will determine whether the target point R is equal to the infinity point. If the control module determines that the target point R is not equal to the infinity point, then in the i-th cycle, when the doubling point module performs a doubling operation on the target point R (including the original doubling operation or the subtrahend and the minuend after exchanging the After doubling the point operation), the point addition module can perform point addition operation on the target point R and the preset elements after the point doubling operation.
  • the control module determines that the target point R is not equal to the infinity point, the control module will determine the target element based on a set of coefficients corresponding to this cycle. If the determined target element is a certain predetermined If the element has a negative value, the second signal is set to the third preset value. In order to facilitate understanding, for example, the control module will determine the target element to be the coordinate point V based on a set of coefficients [-1, 1] corresponding to this cycle. Since V is equal to the negative preset element S, the control module will change the second signal to Set to the third default value. In the present disclosure, the second signal is set to the third preset value to instruct the point addition module to perform the subtraction operation.
  • the point addition module After the point doubling operation module performs a doubling operation on the target point R according to the first signal, the point addition module obtains the preset element (eg S) corresponding to the target element (eg V) from the storage module. The point addition module reads that the second signal is the third preset value, so it performs a subtraction operation, that is, RS, on the target point R and the preset element, and then uses the subtraction result to update the target point R.
  • the preset element eg S
  • the target element eg V
  • the present disclosure since only preset elements such as P, Q, A, and S need to be stored, and there is no need to store elements such as U, V, B, D, etc., the storage space required for multi-point multiplication operations can be effectively reduced.
  • the point addition module since when the point addition module is performing operations, if the second signal is the third preset value, the subtraction operation is directly performed on the target point R and the preset element, and there is no need to perform an additional inversion operation on the preset element. Therefore, no obvious computational overhead is introduced, and thus the multi-point multiplication operation rate is not significantly affected.
  • the present disclosure reduces the storage space required for multi-point multiplication operations without significantly affecting the multi-point multiplication operation speed.
  • the third preset value is equal to 1. It should be noted that the third preset value equal to 1 is one of the various embodiments of the present disclosure. For example, in other embodiments, the third preset value is equal to 0. This disclosure does not limit the specific numerical value of the third preset value.
  • control module is further configured to: between the fourth event and the fifth event, set the second signal to the fourth preset value; the fourth event refers to: the point addition module performs the ith cycle The second signal is read in the i-th cycle; the fifth event refers to: when the target point R updated in the i-th cycle is not equal to the infinity point, the point addition module reads the second signal in the i+1-th cycle.
  • the second signal is the fourth preset value, it is used to instruct the point addition module to perform an addition operation on the target point R and the preset element.
  • control module can set the second signal to the fourth preset value at any time between the fourth event and the fifth event. This disclosure does not limit the specific time. For example, in some specific implementations, the control module may set the second signal to the fourth preset value after the point addition module completes the subtraction operation between the target point R and the preset element. Or in other specific implementations, after the point doubling operation module performs the doubling point operation, the control module does not temporarily set the first signal to the second preset value, but in the next cycle when the target point R is determined to be not At the infinity point, the control module sets the second signal to the fourth preset value.
  • the control module does not temporarily set the first signal to the second preset value, but in the next cycle when the target point R is determined to be not
  • the control module sets the second signal to the fourth preset value only after the point doubling module completes the point doubling operation.
  • the fourth preset value is equal to 0. It should be noted that the fourth preset value equal to 0 is one of the various embodiments of the present disclosure. For example, in other embodiments, the fourth preset value is equal to 1. This disclosure does not limit the specific numerical value of the fourth preset value.
  • the point addition module is further configured to: when the target point R updated in the i-1th cycle is not equal to the infinity point, if the second signal is the fourth preset value, then in the i-th cycle update In the second loop, the preset elements are obtained from the storage module, and the points after the doubling operation in the i-th loop are The target point R is added to the preset elements, and the addition result is used to update the target point R.
  • the point addition module obtains the preset elements from the storage module.
  • the point addition module reads that the second signal is the fourth preset value, so it performs an addition operation on the target point R and the preset element, and then uses the addition result to update the target point R.
  • X 3 (Y 1 -Y 2 Z 1 3 ) 2 -(X 2 Z 1 2 -X 1 ) 2 (X 2 Z 1 2 +X 1 )
  • Y 3 (Y 1 -Y 2 Z 1 3 )(X 3 -X 1 (X 2 Z 1 2 -X 1 ) 2 )-Y 1 (X 2 Z 1 2 -X 1 ) 2
  • Z 3 (X 2 Z 1 2 -X 1 )Z 1
  • the point-and-add module is specifically configured to: connect the input end of the point-and-add module to a target storage portion among multiple storage portions of the storage module to obtain the preset elements stored in the target storage portion.
  • the storage module includes multiple storage parts, and each storage element is stored in a different storage part.
  • the control module determines the target element based on a set of coefficients corresponding to this cycle, the target element is equal to a certain preset element, or equal to the negative value of the preset element.
  • the point-and-click module is connected to the storage part that stores the preset elements, thereby acquiring the preset elements.
  • control module is also configured to: read the target point R updated in the last cycle from the storage module in the current cycle, and after updating the target point R using the preset elements, update The subsequent target point R is stored in the storage module to overwrite the target point R already stored in the storage module;
  • the point doubling module is also configured to: read the target point R updated in the previous cycle from the storage module in the current cycle, and after performing a doubling operation on the read target point R, store the target point R after the doubling operation. to the storage module to overwrite the target point R already stored in the storage module;
  • the point addition module is also configured to: read the target point R after the point doubling operation in the current cycle from the storage module in the current cycle; after updating the target point R using the subtraction result/addition result, the updated target point R is stored to the storage module to overwrite the target point R already stored in the storage module.
  • the storage module may be a storage device (such as a RAM or a register), which is used to store multiple sets of coefficients corresponding to the scalars k and s , and is also used to store the preset elements P, Q, A, and S. Used to store the target point R.
  • the storage module can also be a system formed by multiple storage devices, some of the storage devices are used to store multiple sets of coefficients corresponding to the scalars k and s, and some of the storage devices are used to store the preset elements P, Q, A and S, part of the storage device is used to store the storage target point R, and each storage device can be a RAM or a register.
  • the control module reads the target point R from the storage module (i.e., the target point R updated in the last cycle), and the control module determines whether the read target point R is equal to the infinity point. .
  • the control module determines the target element based on the coefficient corresponding to this cycle. Regardless of whether the target element is a preset element or a negative value of the preset element, the corresponding preset element in the storage module will is read out and will be stored in the storage module as a new target point R, thereby overwriting the target point R already stored in the storage module. When the new target point R is stored in the storage module, this cycle ends.
  • control module determines that the target element is the preset element S or the negative value of the preset element S (ie, the coordinate point V) based on the coefficient corresponding to this cycle, then the preset element S in the storage module will be read out, and will be stored in the storage module as the new target point R.
  • the doubling point module reads the target point R from the storage module (that is, the target point R updated in the last cycle), and according to the signal value of the first signal, the read Perform a doubling operation on the target point R, and then store the target point R after the doubling operation to the storage module, thereby overwriting the target point R already stored in the storage module.
  • the point addition module reads the target point R from the storage module (that is, the target point R after the point doubling operation during this cycle), and according to the signal value of the second signal, the read target point R and the preset The elements perform addition or subtraction operations, and then the addition or subtraction result is used as a new target point R, and the target point R is stored in the storage module, thereby overwriting the target point R already stored in the storage module. After the point addition module stores the new target point R into the storage module, this cycle ends.
  • An embodiment of the present disclosure also provides a graphics processor, which includes the multi-point multiplication system described in any of the above embodiments.
  • the product form of the graphics processor is embodied as a chip.
  • An embodiment of the present disclosure also provides an electronic device, which includes the graphics processor in any of the above embodiments.
  • the product form of the electronic device is a graphics card; in other usage scenarios, the product form of the electronic device is a motherboard integrated with a graphics processor.
  • An embodiment of the present disclosure also provides an electronic device, which includes the above-mentioned electronic device.
  • the product form of the electronic device is a portable electronic device, such as a smartphone, tablet computer, VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, game console, etc.
  • FIG. 2 is a schematic flowchart of a multi-point multiplication operation method provided by an embodiment of the present disclosure. Taking into account the many points provided by this disclosure The multiplication operation method is based on the same inventive concept as the above-mentioned multi-point multiplication operation system. In order to avoid rereading, the multi-point multiplication operation method is briefly introduced below. For the specific implementation of the multi-point multiplication operation method, reference may be made to the above embodiment.
  • the method includes the following steps:
  • S220 In the i+1th cycle, swap the subtrahends and minuends in the original doubling operation of the target point R, and perform a doubling operation on the target point R based on the swapped subtrahends and minuends.
  • the i-th cycle can be understood as the current cycle, that is, the current cycle
  • the i-1th cycle can be understood as the previous cycle
  • the i+1-th cycle can be understood as the next cycle.
  • the target point R updated in the last cycle is equal to the infinity point
  • the target element needs to be determined according to the coefficient corresponding to this cycle, and the target point R needs to be updated using the target element.
  • the preset element itself is used to update the target point R, instead of using the target element (that is, the negative value of the preset element) to update the target point R. Then, in the next cycle, the subtrahends and minuends in the original doubling operation of the target point R are swapped, and the doubling operation is performed on the target point R based on the swapped subtrahends and minuends.
  • the method further includes the following steps:
  • the target point R updated in the i-1th cycle is equal to the infinity point
  • the target element determined based on the i-th set of coefficients in the i-th cycle is a preset element
  • the target point R is updated from the storage
  • the module obtains the preset elements and uses the preset elements to update the target point R; in the i+1th cycle, the original point doubling operation is performed on the target point R.
  • the target element needs to be determined according to the coefficient corresponding to this cycle, and the target point R needs to be updated using the target element.
  • the target point R is updated using the preset element. In other words, the target point R is updated using the actual target elements. Then, in the next loop, the original point doubling operation will be performed on the target point R.
  • the method further includes the following steps:
  • the preset element is obtained from the storage module in the i+1th cycle, and the i+1th In the second loop, the target point R after the point doubling operation is subtracted from the preset elements, and the subtraction result is used to update the target point R.
  • the method further includes the following steps:
  • the preset elements are obtained from the storage module in the i+1th cycle, and the The target point R after the point multiplication operation is added to the preset elements, and the addition result is used to update the target point R.
  • the original point doubling operation will be performed on the target point R, or the subtrahend and the minuend in the original doubling point operation will be swapped, Perform a doubling operation based on the swapped subtrahend and minuend; on the other hand, the target point R after the doubling operation will be added or subtracted from the preset elements, and the addition or subtraction result will be used as the new target point R.
  • the method before performing the loop operation, the method further includes the following steps:
  • each scalar participating in the multi-point multiplication operation into the result of N exponential operation results multiplied by the corresponding coefficients and then added together.
  • the corresponding coefficients of the i-th exponential operation result of each scalar are collectively used as a set of coefficients, i is A positive integer less than or equal to N.
  • each scalar is converted in a low Hamming re-conversion manner.
  • Low Hamming re-conversion methods include but are not limited to: joint sparse form (JSF, joint sparse form) and non-adjacent representation (NAF, Non-adjacent form).
  • the method before performing the loop operation, the method further includes the following steps:
  • FIG. 3 is a schematic flowchart of a multi-point multiplication operation method provided by another embodiment of the present disclosure.
  • the present disclosure explains in detail the multi-point multiplication operation method.
  • k and t need to be converted into multiple sets of coefficients.
  • the scalars k and t can be converted separately using a joint sparse method, thus obtaining ⁇ k[e-1],t[e-1] ⁇ , ⁇ k[e-2],t[e-2] ⁇ ... ⁇ k[1],t[1] ⁇ , ⁇ k[0],t[0] ⁇ and other sets of coefficients.
  • coordinate point A and coordinate point S are also calculated based on coordinate points P and Q, where coordinate point A is equal to P+Q and coordinate point S is equal to P-Q. Then coordinate points P, Q, A and S are combined as preset elements. save.
  • step "2" is a loop operation. Each loop needs to choose to perform step 2.1 or step 2.2 based on the target point R updated in the previous loop. Among them, if the target point R of the last cyclic update is equal to the infinity point, then step 2.1 is performed. If the target point R of the last cyclic update is not equal to the infinity point, step 2.2 is performed.
  • step 1
  • means assigning the value on the right side of the arrow to the variable on the left side of the arrow.
  • R ⁇ A means assigning the coordinate point A to the coordinate point R. In other words, using the coordinate point A to update the coordinate point R, that is, the coordinate point A is used as New coordinate point R.
  • Step 2.1 If the target point R updated in the last cycle is equal to the infinity point, then:
  • pdbl_sub represents the first signal
  • pdbl_sub ⁇ 1 represents setting the first signal to 1, or indicating setting the first signal to high level.
  • Step 2.2 If the target point R updated in the last cycle is not equal to the infinity point, then:
  • -2R refers to swapping the subtrahends and minuends in the original doubling operation, and performing the doubling operation based on the swapped subtrahends and minuends.
  • R ⁇ -2R refers to using the doubling operation.
  • the target point R updates the original target point R;
  • pdbl_sub ⁇ 0 means setting the first signal to 0, or setting the first signal to low level;
  • 2R refers to the original doubling point operation, R ⁇ 2R means using the original doubling point
  • the calculated target point R updates the original target point R.
  • the preset elements (such as coordinates Point P, Q, S or A) updates the target point R, thereby ending the i-th cycle. Since the preset element is not an infinity point, the target point R updated in the i-th cycle must not be an infinity point. Therefore, in the i+1 cycle, the target point R updated in the i-th cycle can no longer be determined. Is it equal to the infinity point? Instead, the corresponding point doubling operation can be performed directly based on the signal value of the first signal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Algebra (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Complex Calculations (AREA)

Abstract

本公开涉及数据处理领域,提供一种多点乘运算系统、图形处理器、电子装置、电子设备及多点乘运算方法,旨在减少多点乘运算所需占用的存储空间。其中,多点乘运算系统包括控制模块和倍点模块,控制模块被配置为:在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中利用预设要素更新目标点R,并将第一信号置为第一预设值;倍点模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第一信号为第一预设值,则在第i次循环中对目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数执行倍点运算。

Description

多点乘运算系统、方法、图形处理器、电子装置及设备
相关申请的交叉引用
本申请基于申请号为CN202211043709.0、申请日为2022年08月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及数据处理领域,尤其涉及一种多点乘运算系统、图形处理器、电子装置、电子设备及多点乘运算方法。
背景技术
在验签流程中,涉及多点乘运算kP+tQ,其中k和t属于标量,P和Q均为椭圆曲线上的坐标点。为了加速多点乘运算,通常会采用低汉明重表示方式(例如联合稀疏或非相邻表示等方式),将多点乘运算中的标量转换成多组系数,并会根据坐标点P和Q,计算出坐标点A、S、U、V、B以及D,将坐标点P、Q、A、S、U、V、B以及D作为预设要素并保存。其中,U等于负A,V等于负S,B等于负P,D等于负Q。接着,循环遍历每组系数,根据遍历到的每组系数,确定该组系数对应的预设要素,并利用该预设要素更新目标点R。在遍历完全部系数后,将最终的目标点R确定为多点乘运算结果。
可以看出,上述过程中需要预先保存P、Q、A、S、U、V、B以及D等8个预设要素,然而由于椭圆曲线运算中的数据通常是不低于256位的大数,因此这8个预设要素所需占用的存储空间较大,导致存储模块的面积较大,也增加了芯片成本。
发明内容
本公开的目的是提供一种多点乘运算系统、图形处理器、电子装置、电子设备及多点乘运算方法,在不显著影响多点乘运算速率的条件下,减少多点乘运算所需占用的存储空间。
根据本公开的一个方面,提供一种多点乘运算系统,该系统包括:控制模块和倍点模块;
控制模块被配置为:在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R,并将第一信号置为第一预设值;其中,多点乘运算包括根据多组系数通过多次循环对目标点R进行更新,多组系数是对多点乘运算的多个标量进行转换后得到的;
倍点模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第一信号为第一预设值,则在第i次循环中对目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对目标点R执行倍点运算。
本公开一种可行的实现方式中,控制模块还被配置为:在第一事件和第二事件之间,将第一信号置为第二预设值;第一事件是指:倍点模块在第i次循环中读取第一信号;第二事件是指:在第i次循环更新的目标点R不等于无穷远点的情况下,倍点模块在第i+1次循环中读取第一信号。
本公开一种可行的实现方式中,倍点模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第一信号为第二预设值,则在第i次循环中对目标点R执行原始倍点运算。
本公开一种可行的实现方式中,控制模块还被配置为:在第一事件和第三事件之间,将第一信号置为第二预设值;第一事件是指:倍点模块在第i次循环中读取第一信号;第三事件是指:在第i次循环更新的目标点R等于无穷远点的情况下,在第i+1次循环中根据第i+1组系数确定目标要素;
或者,控制模块还被配置为:在第i次循环更新的目标点R等于无穷远点的情况下,在第i+1次循环中根据第i+1组系数确定出目标要素为预设要素后,将第一信号置为第二预设值。
本公开一种可行的实现方式中,系统还包括:点加模块;
控制模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则将第二信号置为第三预设值;
点加模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第二信号为第三预设值,则在第i次循环中从存储模块获取预设要素,将第i次循环中倍点运算后的目标点R与预设 要素相减,并利用相减结果更新目标点R。
本公开一种可行的实现方式中,控制模块还被配置为:在第四事件和第五事件之间,将第二信号置为第四预设值;第四事件是指:点加模块在第i次循环中读取第二信号;第五事件是指:在第i次循环更新的目标点R不等于无穷远点的情况下,点加模块在第i+1次循环中读取第二信号。
本公开一种可行的实现方式中,点加模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第二信号为第四预设值,则在第i次循环中从存储模块获取预设要素,将第i次循环中倍点运算后的目标点R与预设要素相加,并利用相加结果更新目标点R。
本公开一种可行的实现方式中,点加模块具体被配置为:将点加模块的输入端与存储模块的多个存储部分中的目标存储部分连接,以获取目标存储部分存储的预设要素。
本公开一种可行的实现方式中,控制模块还被配置为:在当前循环中从存储模块读取上一次循环更新的目标点R,在利用预设要素更新目标点R后,将更新后的目标点R存储至存储模块,以覆盖存储模块已经存储的目标点R;
倍点模块还被配置为:在当前循环中从存储模块读取上一次循环更新的目标点R,在对读取的目标点R执行倍点运算后,将倍点运算后的目标点R存储至存储模块,以覆盖存储模块已经存储的目标点R;
点加模块还被配置为:在当前循环中从存储模块读取当前循环中倍点运算后的目标点R;在利用相减结果/相加结果更新目标点R后,将更新后的目标点R存储至存储模块,以覆盖存储模块已经存储的目标点R。
本公开一种可行的实现方式中,多组系数是通过以下方式转换得到的:将参与多点乘运算的每个标量转换为N个指数运算结果各自乘以相应系数后相加的结果,每个标量的第i个指数运算结果的相应系数,共同作为一组系数,i为小于等于N的正整数。
本公开一种可行的实现方式中,每个标量的转换方式为低汉明重转换方式。
本公开一种可行的实现方式中,预设要素是根据参与多点乘运算的坐标点计算出的坐标点。
根据本公开的另一方面,还提供一种图形处理器,该图形处理器包括上述任一实施例中所述的多点乘运算系统。
根据本公开的另一方面,还提供一种电子装置,该电子装置包括上述图形处理器。在一些使用场景下,该电子装置的产品形式体现为显卡;在另一些使用场景下,该电子装置的产品形式体现为集成了图形处理器的主板。
根据本公开的另一方面,还提供一种电子设备,该电子设备包括上述的电子装置。在一些使用场景下,该电子设备的产品形式是便携式电子设备,例如智能手机、平板电脑、VR设备等;在一些使用场景下,该电子设备的产品形式是个人电脑、游戏主机等。
根据本公开的另一方面,还提供一种多点乘运算方法,包括:
在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R;
在第i+1次循环中对目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对目标点R执行倍点运算。
本公开一种可行的实现方式中,多点乘运算方法还包括:
在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R;
在第i+1次循环中对目标点R执行原始倍点运算。
本公开一种可行的实现方式中,多点乘运算方法还包括:
如果在第i+1次循环中根据第i+1组系数确定的目标要素为预设要素的负值,则在第i+1次循环中从存储模块获取预设要素,将第i+1次循环中倍点运算后的目标点R与预设要素相减,并利用相减结果更新目标点R。
本公开一种可行的实现方式中,多点乘运算方法还包括:
如果在第i+1次循环中根据第i+1组系数确定的目标要素为预设要素,则在第i+1次循环中从存储模块获取预设要素,将第i+1次循环中倍点运算后的目标点R与预设要素相加,并利用相加结果更新目标点R。
本公开一种可行的实现方式中,在执行循环操作之前,多点乘运算方法还包括:
将参与多点乘运算的每个标量转换为N个指数运算结果各自乘以相应系数后相加的结果,每个标量的第i个指数运算结果的相应系数,共同作为一组系数,i为小于等于N的正整数。
本公开一种可行的实现方式中,每个标量的转换方式为低汉明重转换方式。
本公开一种可行的实现方式中,在执行循环操作之前,多点乘运算方法还包括:
根据参与多点乘运算的坐标点计算预设要素;
将预设要素转换为仿射坐标形式的预设要素;
对转换成仿射坐标形式的预设要素进行存储。
附图说明
图1是本公开一实施例提供的多点乘运算系统的结构示意图;
图2是本公开一实施例提供的多点乘运算方法的流程示意图;
图3是本公开另一实施例提供的多点乘运算方法的流程示意图。
具体实施方式
在介绍本公开实施例之前,应当说明的是:本公开部分实施例被描述为处理流程,虽然流程的各个操作步骤可能被冠以顺序的步骤编号,但是其中的操作步骤可以被并行地、并发地或者同时实施。
本公开实施例中可能使用了术语“第一”、“第二”等等来描述各个特征,但是这些特征不应当受这些术语限制。使用这些术语仅仅是为了将一个特征与另一个特征进行区分。
本公开实施例中可能使用了术语“和/或”,“和/或”包括其中一个或更多所列出的相关联特征的任意和所有组合。
应当理解的是,当描述两个部件的连接关系或通信关系时,除非明确指明两个部件之间直接连接或直接通信,否则,两个部件的连接或通信可以理解为直接连接或通信,也可以理解为通过中间部件间接连接或通信。
为了使本公开实施例中的技术方案及优点更加清楚明白,以下结合附图对本公开的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本公开的一部分实施例,而不是所有实施例的穷举。需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
在验签流程中,涉及多点乘运算(也称为多标量乘运算)。为了加速多点乘运算,通常会采用联合稀疏或非相邻表示等方式,将多点乘运算中的标量转换成多组系数,并会根据多点乘运算中的坐标点,计算出多个其他坐标点并存储。接着,循环遍历每组系数,根据遍历到的每组系数,确定该组系数对应的坐标点,并利用确定出的坐标点更新目标点R。在遍历完全部系数后,将最终的目标点R确定为多点乘运算结果。
为便于理解,以两个点乘kP+tQ这一多点乘运算为例,其中k和t属于标量,P和Q均为椭圆曲线上的坐标点。为了加速多点乘运算,通常会采用联合稀疏或非相邻表示等方式,将多点乘运算中的标量转换成多组系数,并会根据坐标点P和Q,计算出坐标点A、S、U、V、B以及D,将坐标点P、Q、A、S、U、V、B以及D作为预设要素并保存。其中,U等于负A,V等于负S,B等于负P,D等于负Q。需要说明的是,本公开中一个坐标点等于另一个坐标点的负值,或者两个坐标点互为相反数,具体是指两个坐标点的Y坐标值互为相反数。比如U等于负A,具体是指U的Y坐标值与A的Y坐标值互为相反数,即YU=-YA
接着,循环遍历每组系数,根据遍历到的每组系数,确定该组系数对应的预设要素,并利用该预设要素更新目标点R。在遍历完全部系数后,将最终的目标点R确定为多点乘运算结果。
可以看出,上述过程中需要预先保存P、Q、A、S、U、V、B以及D等8个预设要素,然而由于椭圆曲线运算中的数据通常是不低于256位的大数,因此这8个预设要素所需占用的存储空间较大,导致存储模块的面积较大,也增加了芯片成本。
为了在不显著影响多点乘运算速率的条件下,减少多点乘运算所需占用的存储空间,本公开提供一种多点乘运算系统、图形处理器、电子装置、电子设备及多点乘运算方法。
参考图1,图1是本公开一实施例提供的多点乘运算系统的结构示意图。如图1所示,系统包括控制模块和倍点模块。
控制模块被配置为:在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R,并将第一信号置为第一预设值。
倍点模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第一信号为第一预设值,则在第i次循环中对目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对目标点R执行倍点运算。
在一些实施例中,利用预设要素更新目标点R是指:将预设要素赋值给目标点R。换言之,将预设 要素作为新的目标点R。
在一些实施例中,第一预设值等于1。在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R,并将第一信号置为1。需要说明的是,第一预设值等于1是本公开的多种实施例中的一种,例如在其它实施例中,第一预设值等于0。本公开对第一预设值的具体数值不做限定。
本公开中,多点乘运算包括:根据多组系数通过多次循环对目标点R进行更新,多组系数是对多点乘运算的多个标量进行转换后得到的。
在一些实施例中,多组系数是通过以下方式转换得到的:将参与多点乘运算的每个标量转换为N个指数运算结果各自乘以相应系数后相加的结果,每个标量的第i个指数运算结果的相应系数,共同作为一组系数,i为小于等于N的正整数。具体地,每个标量的转换方式为低汉明重转换方式。低汉明重转换方式包括但不限于:联合稀疏方式(JSF,joint sparse form)、非相邻表示方式(NAF,Non-adjacent form)。
为便于理解,以联合稀疏方式对标量进行转换为例,可以将多点乘运算kP+tQ中的标量k转换为:
k=k[e-1]×2e-1+k[e-2]×2e-2...k[1]×21+k[0]×20
其中,2e-1、2e-2...21、20为指数运算结果,k[e-1]、k[e-2]..k[1]、k[0]为指数运算结果的相应系数。
同样地,可以将标量将多点乘运算kP+tQ中的标量t转换为:
t=t[e-1]×2e-1+t[e-2]×2e-2...t[1]×21+t[0]×20
其中,2e-1、2e-2...21、20为指数运算结果,t[e-1]、t[e-2]..t[1]、t[0]为指数运算结果的相应系数。
对标量k和标量t进行上述转换后,将k[e-1]和t[e-1]作为一组系数,将k[e-2]和t[e-2]作为一组系数...将k[1]和t[1]作为一组系数,将k[0]和t[0]作为一组系数,从而得到多组系数。其中,k[e-1]和t[e-1]非负且至少有一个非0,其余系数的取值范围是{0,1,-1}。
在一些实施例中,预设要素是根据参与多点乘运算的坐标点计算出的坐标点。为了加速运算,可以在执行循环操作之前,根据参与多点乘运算的坐标点计算出预设要素,并保存预设要素。
为便于理解,以多点乘运算kP+tQ为例,在执行循环操作之前,计算出坐标点A和S,并将坐标点P、Q、A以及S作为预设要素保存。其中,A等于P加Q,S等于P减Q。
需要说明的是,每组系数分别对应一个预设要素。例如当k[e-2]等于1且t[e-2]等于0时,对应坐标点P。当k[e-2]等于0且t[e-2]等于1时,对应坐标点Q。当k[e-2]等于1且t[e-2]等于1时,对应坐标点A。当k[e-2]等于1且t[e-2]等于-1时,对应坐标点S。本公开在执行循环操作时,控制模块会判断第i-1次循环(即上一次循环)更新的目标点R是否等于无穷远点。比如在第i-1次循环中,目标点R由Ri-2被更新为Ri-1。则在第i次循环(即本次循环)中,控制模块会判断Ri-1是否等于无穷远点。如果控制模块确定第i-1次循环更新的目标点R等于无穷远点,则在第i次循环中,控制模块会根据第i次循环对应的一组系数(即第i组系数)确定目标要素,并利用目标要素更新目标点R。如果控制模块确定第i-1次循环更新的目标点R不等于无穷远点,则第i次循环中,倍点模块会对目标点R执行倍点运算,然后其他模块还可能对倍点运算后的目标点R执行其他运算(例如点加模块可以对倍点运算后的目标点R和预设要素执行点加运算)。
具体地,如果在第i次循环中,控制模块确定第i-1次循环更新的目标点R等于无穷远点,则控制模块会根据本次循环对应的一组系数确定目标要素,如果确定出的目标要素为某一预设要素的负值,则从存储模块获取该预设要素,利用该预设要素更新目标点R。为便于理解,例如控制模块根据本次循环对应的一组系数[0,-1],确定出目标要素为坐标点D,由于D等于负Q,于是从存储模块获取预设要素Q,并根据预设要素Q更新目标点R。
本公开中,为了表征循环中是否采用了实际的目标要素更新目标点R,设置了第一信号。如果控制模块没有采用实际的目标要素更新目标点R,而是采用目标要素的相反数(例如Q是D的相反数)更新目标点R,则控制模块将第一信号置为第一预设值,并结束本次循环。换言之,如果第一信号为第一预设值,则说明控制模块没有采用实际的目标要素更新目标点R,而是采用了目标要素的相反数更新目标点R。
如果在第i次循环中,控制模块确定第i-1次循环更新的目标点R不等于无穷远点,则倍点模块会根据第一信号的信号值执行倍点运算。其中,如果第一信号为第一预设值,则说明控制模块在第i-1次循环中,采用了目标要素的相反数更新目标点R。因此,此时的目标点R是真实目标点R的相反数。如此, 在第i次循环中,倍点模块通过将原始倍点运算中的减数与被减数对调,并根据对调后的减数与被减数对目标点R执行倍点运算,从而使得倍点运算后的目标点R等于真实的目标点R。为便于理解,例如原始倍点运算为:
其中,为减数,为被减数。通过对调减数与被减数,则根据对调后的减数与被减数的倍点运算为:
在一些实施例中,倍点运算实际上减数和被减数之间的模减运算,而模减运算的输入为减数和被减数的存储地址。本公开中,当需要对调减数和被减数时,可以在输入减数和被减数的存储地址时,将两者的存储地址进行对调。例如减数存储地址aaddr=5,被减数存储地址baddr=7,在模减运算时,输入的减数存储地址aaddr=7,输入的被减数存储地址baddr=5。
本公开中,在第i-1次循环中没有采用实际的目标要素(例如D)更新目标点R,而是采用了目标要素的相反数(例如Q)更新目标点R。因此只需要存储P、Q、A、S等预设要素,而不需要存储U、V、B、D等要素,可以有效减少多点乘运算所需占用的存储空间。
此外,由于第i-1次循环中没有采用实际的目标要素(例如D)更新目标点R,而是采用了目标要素的相反数素(例如Q)更新目标点R,并且在第i次循环中,通过对调原始倍点运算中的减数和被减数,并根据对调后的减数和被减数对目标点R执行倍点运算。如此,可以在倍点运算的同时,弥补了第i-1次循环中本应执行的取反操作(比如对预设要素进行取反后,再利用取反后的预设要素更新目标点R;或者在利用预设要素更新目标点R后,对目标点R进行取反)。本公开由于不需要额外执行一次取反操作,因此不会引入明显的计算开销,从而不会显著影响多点乘运算速率。总言之,本公开在不显著影响多点乘运算速率的条件下,减少了多点乘运算所需占用的存储空间。
在一些实施例中,控制模块还被配置为:在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R,并将第一信号置为第二预设值,或者在第一信号已经是第二预设值的情况下,保持第一信号为第二预设值。
为便于理解,例如控制模块会根据本次循环对应的一组系数[0,1],确定出目标要素为预设要素Q,于是从存储模块获取预设要素Q,并根据预设要素Q更新目标点R。由于本次循环中,控制模块利用实际的目标要素更新了目标点R,而不是利用目标要素的相反数更新目标点R,因此将第一信号置为第二预设值,或者将第一信号保持为第二预设值。
在一些实施例中,第二预设值等于0。需要说明的是,第二预设值等于0是本公开的多种实施例中的一种,例如在其它实施例中,第二预设值等于1。本公开对第二预设值的具体数值不做限定。
在一些实施例中,控制模块还被配置为:在第一事件和第二事件之间,将第一信号置为第二预设值;第一事件是指:倍点模块在第i次循环中读取第一信号;第二事件是指:在第i次循环更新的目标点R不等于无穷远点的情况下,倍点模块在第i+1次循环中读取第一信号。
需要说明的是,当第一信号为第二预设值时,说明此时的目标点R等于真实的目标点R。
还需要说明的是,控制模块可以在第一事件和第二事件之间的任意时刻,将第一信号置为第二预设值,本公开对具体时刻不做限定。例如在一些具体实施方式中,控制模块可以在倍点模块执行完倍点运算后,将第一信号置为第二预设值,从而表示此时的目标点R等于真实的目标点R。或者在另一些具体实施方式中,在倍点运算模块执行倍点运算后,控制模块暂时不将第一信号置为第二预设值,而是在下一次循环时当目标点R被确定为不是无穷远点时,控制模块才将第一信号置为第二预设值,从而表示此时的目标点R等于真实的目标点R。
在一些实施例中,倍点模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第一信号为第二预设值,则在第i次循环中对目标点R执行原始倍点运算。
具体地,如果在第i次循环中,控制模块确定目标点R不等于无穷远点,则倍点模块会根据第一信号的信号值执行倍点运算。其中,如果第一信号为第二预设值,则说明此时的目标点R是真实目标点R。如此,在第i次循环中,倍点模块会对目标点R执行原始倍点运算:
在一些实施例中,控制模块还被配置为:在第一事件和第三事件之间,将第一信号置为第二预设值;第一事件是指:倍点模块在第i次循环中读取第一信号;第三事件是指:在第i次循环更新的目标点R等于无穷远点的情况下,在第i+1次循环中根据第i+1组系数确定目标要素。或者,控制模块还被配置为:在第i次循环更新的目标点R等于无穷远点的情况下,在第i+1次循环中根据第i+1组系数确定出 目标要素为预设要素后,将第一信号置为第二预设值。
例如在一些具体实施方式中,控制模块可以在倍点模块执行完倍点运算后,将第一信号置为第二预设值,从而表示此时的目标点R等于真实的目标点R。或者在另一些具体实施方式中,在倍点运算模块执行倍点运算后,控制模块暂时不将第一信号置为第二预设值,而是在下一次循环时当目标点R被确定为无穷远点时,控制模块才将第一信号置为第二预设值,从而表示此时的目标点R等于真实的目标点R。
如图1所示,在一些实施例中,系统还可以包括点加模块。
控制模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则将第二信号置为第三预设值。
点加模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第二信号为第三预设值,则在第i次循环中从存储模块获取预设要素,将第i次循环中倍点运算后的目标点R与预设要素相减,并利用相减结果更新目标点R。
本公开中,在第i次循环(即本次循环)中,控制模块会判断目标点R是否等于无穷远点。如果控制模块确定目标点R不等于无穷远点,则第i次循环中,当倍点模块对目标点R执行倍点运算(包括原始倍点运算或者对调减数和被减数数后的倍点运算)后,点加模块可以对倍点运算后的目标点R和预设要素执行点加运算。
具体地,如果在第i次循环中,控制模块确定目标点R不等于无穷远点,则控制模块会根据本次循环对应的一组系数确定目标要素,如果确定出的目标要素为某一预设要素的负值,则将第二信号置为第三预设值。为便于理解,例如控制模块会根据本次循环对应的一组系数[-1,1],确定出目标要素为坐标点V,由于V等于负的预设要素S,于是控制模块将第二信号置为第三预设值。本公开中,通过将第二信号置为第三预设值,以指示点加模块执行相减运算。
当倍点运算模块根据第一信号对目标点R执行倍点运算后,点加模块从存储模块获取目标要素(例如V)对应的预设要素(例如S)。点加模块读取到第二信号为第三预设值,于是对目标点R和预设要素执行相减操作,即R-S,然后利用相减结果更新目标点R。为便于理解,例如R=(X1,Y1,Z1),Z1≠0,S=(X2,Y2,Z2),R≠S,则R-S=(X3,Y3,Z3);其中:
X3=(Y1+Y2Z1 3)2-(X2Z1 2-X1)2(X2Z1 2+X1)
Y3=(Y1+Y2Z1 3)(X3-X1(X2Z1 2-X1)2)-Y1(X2Z1 2-X1)2
Z3=(X2Z1 2-X1)Z1
本公开中,由于只需要存储P、Q、A、S等预设要素,而不需要存储U、V、B、D等要素,可以有效减少多点乘运算所需占用的存储空间。此外,由于点加模块在进行运算时,如果第二信号为第三预设值,则直接对目标点R和预设要素执行相减操作,不需要对预设要素额外执行一次取反操作,因此不会引入明显的计算开销,从而不会显著影响多点乘运算速率。总言之,本公开在不显著影响多点乘运算速率的条件下,减少了多点乘运算所需占用的存储空间。
在一些实施例中,第三预设值等于1。需要说明的是,第三预设值等于1是本公开的多种实施例中的一种,例如在其它实施例中,第三预设值等于0。本公开对第三预设值的具体数值不做限定。
在一些实施例中,控制模块还被配置为:在第四事件和第五事件之间,将第二信号置为第四预设值;第四事件是指:点加模块在第i次循环中读取第二信号;第五事件是指:在第i次循环更新的目标点R不等于无穷远点的情况下,点加模块在第i+1次循环中读取第二信号。
需要说明的是,当第二信号为第四预设值时,用于指示点加模块对目标点R和预设要素执行相加运算。
还需要说明的是,控制模块可以在第四事件和第五事件之间的任意时刻,将第二信号置为第四预设值,本公开对具体时刻不做限定。例如在一些具体实施方式中,控制模块可以在点加模块执行完目标点R和预设要素的相减操作后,将第二信号置为第四预设值。或者在另一些具体实施方式中,在倍点运算模块执行倍点运算后,控制模块暂时不将第一信号置为第二预设值,而是在下一次循环时当目标点R被确定为不是无穷远点时,控制模块才将第二信号置为第四预设值。或者在另一些具体实施方式中,在倍点运算模块执行倍点运算后,控制模块暂时不将第一信号置为第二预设值,而是在下一次循环时当目标点R被确定为不是无穷远点,并且倍点模块执行完倍点运算后,控制模块才将第二信号置为第四预设值。
在一些实施例中,第四预设值等于0。需要说明的是,第四预设值等于0是本公开的多种实施例中的一种,例如在其它实施例中,第四预设值等于1。本公开对第四预设值的具体数值不做限定。
在一些实施例中,点加模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果第二信号为第四预设值,则在第i次循环中从存储模块获取预设要素,将第i次循环中倍点运算后的 目标点R与预设要素相加,并利用相加结果更新目标点R。
具体地,当倍点运算模块根据第一信号对目标点R执行倍点运算后,点加模块从存储模块获取预设要素。点加模块读取到第二信号为第四预设值,于是对目标点R和预设要素执行相加操作,然后利用相加结果更新目标点R。为便于理解,例如R=(X1,Y1,Z1),Z1≠0,S=(X2,Y2,Z2),R≠S,则R+S=(X3,Y3,Z3);其中:
X3=(Y1-Y2Z1 3)2-(X2Z1 2-X1)2(X2Z1 2+X1)
Y3=(Y1-Y2Z1 3)(X3-X1(X2Z1 2-X1)2)-Y1(X2Z1 2-X1)2
Z3=(X2Z1 2-X1)Z1
在一些实施例中,点加模块具体被配置为:将点加模块的输入端与存储模块的多个存储部分中的目标存储部分连接,以获取目标存储部分存储的预设要素。
具体地,存储模块包括多个存储部分,每个存储要素分别存储在不同的存储部分。当控制模块根据本次循环对应的一组系数确定出目标要素后,目标要素等于某一预设要素,或者等于该预设要素的负值。点加模块与存储该预设要素的存储部分连接,从而获取该预设要素。
如图1所示,在一些实施例中,控制模块还被配置为:在当前循环中从存储模块读取上一次循环更新的目标点R,在利用预设要素更新目标点R后,将更新后的目标点R存储至存储模块,以覆盖存储模块已经存储的目标点R;
倍点模块还被配置为:在当前循环中从存储模块读取上一次循环更新的目标点R,在对读取的目标点R执行倍点运算后,将倍点运算后的目标点R存储至存储模块,以覆盖存储模块已经存储的目标点R;
点加模块还被配置为:在当前循环中从存储模块读取当前循环中倍点运算后的目标点R;在利用相减结果/相加结果更新目标点R后,将更新后的目标点R存储至存储模块,以覆盖存储模块已经存储的目标点R。
本公开中,存储模块可以是一个存储装置(例如RAM或者寄存器),该存储装置用于存储标量k和s对应的多组系数,还用于存储预设要素P、Q、A以及S,还用于存储目标点R。或者存储模块也可以是由多个存储装置形成的系统,多个存储装置中的部分存储装置用于存储标量k和s对应的多组系数,部分存储装置用于存储预设要素P、Q、A以及S,部分存储装置用于存储存储目标点R,每个存储装置可以是RAM或者寄存器。
本公开具体实现时,在每一次循环期间,控制模块从存储模块读取出目标点R(即上一次循环更新的目标点R),控制模块判断读取出的目标点R是否等于无穷远点。
如果读取的目标点R等于无穷远点,则控制模块根据本次循环对应的系数确定目标要素,无论目标要素是预设要素还是预设要素的负值,存储模块中的相应预设要素会被读取出,并将作为新的目标点R被存储至存储模块,从而覆盖存储模块中已经存储的目标点R。当新的目标点R存储至存储模块后,本次循环结束。例如,控制模块根据本次循环对应的系数确定目标要素为预设要素S或者预设要素S的负值(即坐标点V),则存储模块中的预设要素S会被读取出,并将作为新的目标点R被存储至存储模块。
如果读取的目标点R不等于无穷远点,则倍点模块从存储模块读取出目标点R(即上一次循环更新的目标点R),并根据第一信号的信号值,对读取的目标点R执行倍点运算,然后将倍点运算后的目标点R存储至存储模块,从而覆盖存储模块中已经存储的目标点R。接着,点加模块从存储模块读取出目标点R(即本次循环期间经过倍点运算后的目标点R),并根据第二信号的信号值,对读取的目标点R和预设要素执行相加或相减操作,然后将相加结果或相减结果作为新的目标点R,并将该目标点R存储至存储模块,从而覆盖存储模块中已经存储的目标点R。点加模块将新的目标点R存储至存储模块后,本次循环结束。
本公开实施例还提供一种图形处理器,该图形处理器包括上述任一实施例中所述的多点乘运算系统。在一些使用场景下,该图形处理器的产品形式体现为芯片。
本公开实施例还提供一种电子装置,该电子装置包括上述任一实施例中的图形处理器。在一些使用场景下,该电子装置的产品形式体现为显卡;在另一些使用场景下,该电子装置的产品形式体现为集成了图形处理器的主板。
本公开实施例还提供一种电子设备,该电子设备包括上述的电子装置。在一些使用场景下,该电子设备的产品形式是便携式电子设备,例如智能手机、平板电脑、VR设备等;在一些使用场景下,该电子设备的产品形式是个人电脑、游戏主机等。
参考图2,图2是本公开一实施例提供的多点乘运算方法的流程示意图。考虑到本公开提供的多点 乘运算方法与上述多点乘运算系统基于同一发明构思,为了避免重读,以下对多点乘运算方法做简要介绍。对于多点乘运算方法的具体实现,可参考上述实施例。
如图2所示,该方法包括以下步骤:
S210:在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R。
S220:在第i+1次循环中对目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对目标点R执行倍点运算。
本公开中,第i次循环可以理解成本次循环,也即当前循环,第i-1次循环可以理解成上一次循环,第i+1次循环可以理解成下一次循环。本公开中,在上一次循环更新的目标点R等于无穷远点的情况下,本次循环期间需要根据本次循环对应的系数确定目标要素,并利用目标要素更新目标点R。
其中,如果本次循环期间确定的目标要素等于预设要素的负值,则利用该预设要素本身更新目标点R,而不是利用目标要素(即预设要素的负值)更新目标点R。接着,在下一次循环中,会对目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对目标点R执行倍点运算。
在一些实施例中,该方法还包括以下步骤:
在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素,则在第i次循环中从存储模块获取预设要素,利用预设要素更新目标点R;在第i+1次循环中对目标点R执行原始倍点运算。
本公开中,在上一次循环更新的目标点R等于无穷远点的情况下,本次循环期间需要根据本次循环对应的系数确定目标要素,并利用目标要素更新目标点R。
其中,如果本次循环期间确定的目标要素等于预设要素,则利用该预设要素更新目标点R。换言之,利用实际的目标要素更新目标点R。接着,在下一次循环中,会对目标点R执行原始倍点运算。
在一些实施例中,该方法还包括以下步骤:
如果在第i+1次循环中根据第i+1组系数确定的目标要素为预设要素的负值,则在第i+1次循环中从存储模块获取预设要素,将第i+1次循环中倍点运算后的目标点R与预设要素相减,并利用相减结果更新目标点R。
在一些实施例中,该方法还包括以下步骤:
如果在第i+1次循环中根据第i+1组系数确定的目标要素为预设要素,则在第i+1次循环中从存储模块获取预设要素,将第i+1次循环中倍点运算后的目标点R与预设要素相加,并利用相加结果更新目标点R。
本公开中,在第i+1次循环中,一方面,如前所述,会对目标点R执行原始倍点运算,或者对原始倍点运算中的减数和被减数进行对调后,根据对调后的减数和被减数执行倍点运算;另一方面,会将倍点运算后的目标点R与预设要素相加或相减,并将相加结果或相减结果作为新的目标点R。
在一些实施例中,在执行循环操作之前,该方法还包括以下步骤:
将参与多点乘运算的每个标量转换为N个指数运算结果各自乘以相应系数后相加的结果,每个标量的第i个指数运算结果的相应系数,共同作为一组系数,i为小于等于N的正整数。
在一些实施例中,每个标量的转换方式为低汉明重转换方式。低汉明重转换方式包括但不限于:联合稀疏方式(JSF,joint sparse form)、非相邻表示方式(NAF,Non-adjacent form)。
在一些实施例中,在执行循环操作之前,该方法还包括以下步骤:
根据参与多点乘运算的坐标点计算预设要素;将预设要素转换为仿射坐标形式的预设要素;对转换成仿射坐标形式的预设要素进行存储。
参考图3,图3是本公开另一实施例提供的多点乘运算方法的流程示意图。结合图3,本公开对多点乘运算方法进行详细说明。
以多点乘运算kP+tQ为例,其中k和t属于参与多点乘运算的两个标量,P和Q属于参与多点乘运算的坐标点。首先需要将k和t转换成多组系数,如前所述,可以采用联合稀疏方式对标量k和t分别进行转换,从而得到{k[e-1],t[e-1]}、{k[e-2],t[e-2]}...{k[1],t[1]}、{k[0],t[0]}等多组系数。并且,还根据坐标点P和Q计算出坐标点A和坐标点S,其中坐标点A等于P+Q,坐标点S等于P-Q,然后将坐标点P、Q、A以及S作为预设要素并保存。
然后结合图3,按照以下步骤进行处理。其中,步骤“2”是一种循环操作,每一次循环需要根据上一次循环更新的目标点R,选择执行步骤2.1或步骤2.2。其中,如果上一次循环更新的目标点R等于无穷远点,则执行步骤2.1,如果上一次循环更新的目标点R不等于无穷远点,则执行步骤2.2。
步骤1:
若{k[e-1],t[e-1]}={1,1},则R←A;
若{k[e-1],t[e-1]}={1,0},则R←P;
若{k[e-1],t[e-1]}={0,1},则R←Q;
其中,←表示将箭头右侧的值赋值给箭头左侧的变量,例如R←A表示将坐标点A赋值给坐标点R,换言之,利用坐标点A更新坐标点R,也即将坐标点A作为新的坐标点R。
步骤2:
另i∈{e-2、e-3...1、0},按照i从大到小的顺序进行循环,直至i小于0,具体如下:
步骤2.1:若上一次循环更新的目标点R等于无穷远点,则:
若{k[i],t[i]}={0,1},则R←Q;
若{k[i],t[i]}={0,-1},则R←Q,pdbl_sub←1;
若{k[i],t[i]}={1,0},则R←P;
若{k[i],t[i]}={1,1},则R←A;
若{k[i],t[i]}={1,-1},则R←S;
若{k[i],t[i]}={-1,0},则R←P,pdbl_sub←1;
若{k[i],t[i]}=={-1,1},则R←S,pdbl_sub←1;
若{k[i],t[i]}={-1,-1},则R←A,pdbl_sub←1;
其中,pdbl_sub表示第一信号,pdbl_sub←1表示将第一信号置为1,或者表示将第一信号置为高电平。
步骤2.2:若上一次循环更新的目标点R不等于无穷远点,则:
子步骤2.2.1:
若pdbl_sub=1,则R←-2R,pdbl_sub←0,结束子步骤2.2.1;
若pdbl_sub=0,则R←2R,结束子步骤2.2.1;
其中,-2R是指对原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数执行倍点运算,R←-2R是指利用倍点运算后的目标点R更新原目标点R;pdbl_sub←0表示将第一信号置为0,或者表示将第一信号置为低电平;2R是指原始倍点运算,R←2R是指利用原始倍点运算后的目标点R更新原目标点R。
子步骤2.2.2:
若{k[i],t[i]}={0,1},则R←R+Q;
若{k[i],t[i]}={0,-1},则R←R-Q;
若{k[i],t[i]}={1,0},则R←R+P;
若{k[i],t[i]}={1,1},则R←R+A;
若{k[i],t[i]}={1,-1},则R←R+S;
若{k[i],t[i]}={-1,0},则R←R-P;
若{k[i],t[i]}=={-1,1},则R←R-S;
若{k[i],t[i]}={-1,-1},则R←R-A。
还需要说明的是,本公开在实施期间,如果第i-1次循环更新的目标点R等于无穷远点,则在第i次循环中,如前所述,会利用预设要素(例如坐标点P、Q、S或者A)更新目标点R,从而结束第i次循环。由于预设要素并不是无穷远点,因此第i次循环更新的目标点R必定不是无穷远点,所以在第i+1次循环中,也可以不再判断第i次循环更新的目标点R是否等于无穷远点,而是可以直接根据第一信号的信号值,执行相应的倍点运算。
尽管已描述了本公开的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本公开范围的所有变更和修改。
显然,本领域的技术人员可以对本公开进行各种改动和变型而不脱离本公开的精神和范围。这样,倘若本公开的这些修改和变型属于本公开权利要求及其等同技术的范围之内,则本公开也意图包含这些改动和变型在内。

Claims (22)

  1. 一种多点乘运算系统,所述系统包括:控制模块和倍点模块;
    所述控制模块被配置为:在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取所述预设要素,利用所述预设要素更新所述目标点R,并将第一信号置为第一预设值;其中,所述多点乘运算包括根据多组系数通过多次循环对所述目标点R进行更新,所述多组系数是对所述多点乘运算的多个标量进行转换后得到的;
    所述倍点模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果所述第一信号为第一预设值,则在第i次循环中对所述目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对所述目标点R执行倍点运算。
  2. 根据权利要求1所述的系统,所述控制模块还被配置为:在第一事件和第二事件之间,将所述第一信号置为第二预设值;所述第一事件是指:所述倍点模块在第i次循环中读取所述第一信号;所述第二事件是指:在第i次循环更新的目标点R不等于无穷远点的情况下,所述倍点模块在第i+1次循环中读取所述第一信号。
  3. 根据权利要求2所述的系统,所述倍点模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果所述第一信号为第二预设值,则在第i次循环中对所述目标点R执行原始倍点运算。
  4. 根据权利要求1所述的系统,所述控制模块还被配置为:在第一事件和第三事件之间,将所述第一信号置为第二预设值;所述第一事件是指:所述倍点模块在第i次循环中读取所述第一信号;所述第三事件是指:在第i次循环更新的目标点R等于无穷远点的情况下,在第i+1次循环中根据第i+1组系数确定目标要素;
    或者,所述控制模块还被配置为:在第i次循环更新的目标点R等于无穷远点的情况下,在第i+1次循环中根据第i+1组系数确定出目标要素为预设要素后,将所述第一信号置为第二预设值。
  5. 根据权利要求1所述的系统,所述系统还包括:点加模块;
    所述控制模块还被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则将第二信号置为第三预设值;
    所述点加模块被配置为:在第i-1次循环更新的目标点R不等于无穷远点的情况下,如果所述第二信号为第三预设值,则在第i次循环中从所述存储模块获取所述预设要素,将第i次循环中倍点运算后的目标点R与所述预设要素相减,并利用相减结果更新目标点R。
  6. 根据权利要求5所述的系统,所述控制模块还被配置为:在第四事件和第五事件之间,将所述第二信号置为第四预设值;所述第四事件是指:所述点加模块在第i次循环中读取所述第二信号;所述第五事件是指:在第i次循环更新的目标点R不等于无穷远点的情况下,所述点加模块在第i+1次循环中读取所述第二信号。
  7. 根据权利要求5所述的系统,所述点加模块还被配置为:在第i-1次循环更新的目标点R不等于 无穷远点的情况下,如果所述第二信号为第四预设值,则在第i次循环中从所述存储模块获取所述预设要素,将第i次循环中倍点运算后的目标点R与所述预设要素相加,并利用相加结果更新目标点R。
  8. 根据权利要求5所述的系统,所述点加模块具体被配置为:将点加模块的输入端与所述存储模块的多个存储部分中的目标存储部分连接,以获取目标存储部分存储的预设要素。
  9. 根据权利要求5至8任一项所述的系统,所述控制模块还被配置为:在当前循环中从所述存储模块读取上一次循环更新的目标点R,在利用所述预设要素更新目标点R后,将更新后的目标点R存储至所述存储模块,以覆盖所述存储模块已经存储的目标点R;
    所述倍点模块还被配置为:在当前循环中从所述存储模块读取上一次循环更新的目标点R,在对读取的目标点R执行倍点运算后,将倍点运算后的目标点R存储至所述存储模块,以覆盖所述存储模块已经存储的目标点R;
    所述点加模块还被配置为:在当前循环中从所述存储模块读取当前循环中倍点运算后的目标点R;在利用相减结果/相加结果更新目标点R后,将更新后的目标点R存储至所述存储模块,以覆盖所述存储模块已经存储的目标点R。
  10. 根据权利要求1至8任一项所述的系统,所述多组系数是通过以下方式转换得到的:将参与所述多点乘运算的每个标量转换为N个指数运算结果各自乘以相应系数后相加的结果,每个标量的第i个指数运算结果的相应系数,共同作为一组系数,i为小于等于N的正整数。
  11. 根据权利要求10所述的系统,每个标量的转换方式为低汉明重转换方式。
  12. 根据权利要求1至8任一项所述的系统,所述预设要素是根据参与所述多点乘运算的坐标点计算出的坐标点。
  13. 一种图形处理器,包括权利要求1至12任一项所述的系统。
  14. 一种电子装置,包括权利要求13所述的图形处理器。
  15. 一种电子设备,包括权利要求14所述的电子装置。
  16. 一种多点乘运算方法,包括:
    在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素的负值,则在第i次循环中从存储模块获取所述预设要素,利用所述预设要素更新所述目标点R;
    在第i+1次循环中对所述目标点R的原始倍点运算中的减数和被减数进行对调,并根据对调后的减数和被减数对所述目标点R执行倍点运算。
  17. 根据权利要求16所述的方法,还包括:
    在第i-1次循环更新的目标点R等于无穷远点的情况下,如果在第i次循环中根据第i组系数确定的目标要素为预设要素,则在第i次循环中从存储模块获取所述预设要素,利用所述预设要素更新所述目标点R;
    在第i+1次循环中对所述目标点R执行原始倍点运算。
  18. 根据权利要求16所述的方法,还包括:
    如果在第i+1次循环中根据第i+1组系数确定的目标要素为预设要素的负值,则在第i+1次循环中从 存储模块获取所述预设要素,将第i+1次循环中倍点运算后的目标点R与所述预设要素相减,并利用相减结果更新目标点R。
  19. 根据权利要求16所述的方法,还包括:
    如果在第i+1次循环中根据第i+1组系数确定的目标要素为预设要素,则在第i+1次循环中从存储模块获取所述预设要素,将第i+1次循环中倍点运算后的目标点R与所述预设要素相加,并利用相加结果更新目标点R。
  20. 根据权利要求16至19任一项所述的方法,在执行循环操作之前,还包括:
    将参与所述多点乘运算的每个标量转换为N个指数运算结果各自乘以相应系数后相加的结果,每个标量的第i个指数运算结果的相应系数,共同作为一组系数,i为小于等于N的正整数。
  21. 根据权利要求20所述的方法,每个标量的转换方式为低汉明重转换方式。
  22. 根据权利要求16至19任一项所述的方法,在执行循环操作之前,还包括:
    根据参与所述多点乘运算的坐标点计算所述预设要素;
    将所述预设要素转换为仿射坐标形式的预设要素;
    对转换成仿射坐标形式的预设要素进行存储。
PCT/CN2023/091551 2022-08-30 2023-04-28 多点乘运算系统、方法、图形处理器、电子装置及设备 WO2024045665A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211043709.0A CN115129297B (zh) 2022-08-30 2022-08-30 多点乘运算系统、方法、图形处理器、电子装置及设备
CN202211043709.0 2022-08-30

Publications (1)

Publication Number Publication Date
WO2024045665A1 true WO2024045665A1 (zh) 2024-03-07

Family

ID=83387352

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/091551 WO2024045665A1 (zh) 2022-08-30 2023-04-28 多点乘运算系统、方法、图形处理器、电子装置及设备

Country Status (2)

Country Link
CN (1) CN115129297B (zh)
WO (1) WO2024045665A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129297B (zh) * 2022-08-30 2022-12-13 北京象帝先计算技术有限公司 多点乘运算系统、方法、图形处理器、电子装置及设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017067859A (ja) * 2015-09-28 2017-04-06 株式会社メガチップス スカラー倍算装置及びスカラー倍算方法
CN108650087A (zh) * 2018-05-16 2018-10-12 广东工业大学 一种二进制域F2m下的SM2椭圆曲线签名点乘加密方法
CN111966324A (zh) * 2020-08-19 2020-11-20 哈尔滨理工大学 面向多椭圆曲线标量乘法器的实现方法、装置及存储介质
JP2022045614A (ja) * 2020-09-09 2022-03-22 キオクシア株式会社 演算装置
EP4027574A1 (en) * 2021-01-11 2022-07-13 Thales DIS France SA Method for securing a multiple point multiplication operation against side-channel attacks
CN115129297A (zh) * 2022-08-30 2022-09-30 北京象帝先计算技术有限公司 多点乘运算系统、方法、图形处理器、电子装置及设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340494B (zh) * 2020-05-15 2020-08-28 支付宝(杭州)信息技术有限公司 资产类型一致性证据生成、交易、交易验证方法及系统
CN113794572A (zh) * 2021-09-28 2021-12-14 南京宁麒智能计算芯片研究院有限公司 一种高性能椭圆曲线数字签名与验签的硬件实现系统和方法
CN114553425A (zh) * 2022-02-25 2022-05-27 东南大学 基于高性能模逆的椭圆数字签名曲线硬件实现方法及系统
CN114465735B (zh) * 2022-04-12 2022-06-17 北京象帝先计算技术有限公司 验签系统、电子装置、电子设备及验签方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017067859A (ja) * 2015-09-28 2017-04-06 株式会社メガチップス スカラー倍算装置及びスカラー倍算方法
CN108650087A (zh) * 2018-05-16 2018-10-12 广东工业大学 一种二进制域F2m下的SM2椭圆曲线签名点乘加密方法
CN111966324A (zh) * 2020-08-19 2020-11-20 哈尔滨理工大学 面向多椭圆曲线标量乘法器的实现方法、装置及存储介质
JP2022045614A (ja) * 2020-09-09 2022-03-22 キオクシア株式会社 演算装置
EP4027574A1 (en) * 2021-01-11 2022-07-13 Thales DIS France SA Method for securing a multiple point multiplication operation against side-channel attacks
CN115129297A (zh) * 2022-08-30 2022-09-30 北京象帝先计算技术有限公司 多点乘运算系统、方法、图形处理器、电子装置及设备

Also Published As

Publication number Publication date
CN115129297B (zh) 2022-12-13
CN115129297A (zh) 2022-09-30

Similar Documents

Publication Publication Date Title
CN112214726B (zh) 运算加速器
US10311127B2 (en) Sparse matrix vector multiplication
US20030123656A1 (en) Elliptic curve cryptosystem apparatus, storage medium storing elliptic curve cryptosystem program, and elliptic curve cryptosystem arithmetic method
WO2024045665A1 (zh) 多点乘运算系统、方法、图形处理器、电子装置及设备
CN108845828B (zh) 一种协处理器、矩阵运算加速方法及系统
WO2022016926A1 (zh) 神经网络计算装置和数据读取、数据存储方法及相关设备
CN111814957B (zh) 神经网络运算方法及相关设备
CN116188942A (zh) 一种图像卷积方法、装置、设备及存储介质
CN111210004A (zh) 卷积计算方法、卷积计算装置及终端设备
CN113342671A (zh) 对运算模块进行验证的方法、装置、电子设备和介质
CN116888591A (zh) 一种矩阵乘法器、矩阵计算方法及相关设备
CN109460535B (zh) 一种基于云的有限域矩阵求逆装置及求逆方法
CN111966473A (zh) 一种线性回归任务的运行方法及装置、电子设备
CN108255463B (zh) 一种数字逻辑运算方法、电路和fpga芯片
US6119140A (en) Two-dimensional inverse discrete cosine transform circuit and microprocessor realizing the same and method of implementing 8×8 two-dimensional inverse discrete cosine transform
CN114510217A (zh) 处理数据的方法、装置和设备
CN108334946B (zh) 深度神经网络模型的处理方法、装置和设备
CN113836481B (zh) 矩阵计算电路、方法、电子设备及计算机可读存储介质
CN115113848B (zh) 签名/验签电路、装置、设备、方法及坐标还原电路
US20240069868A1 (en) Mac operator related to correcting a computational error
TWI281619B (en) Data processing structure and method for fast Fourier transformation/inverse fast Fourier transformation
CN116596990B (zh) 目标检测方法、装置、设备及存储介质
JP3613466B2 (ja) データ演算処理装置及びデータ演算処理プログラム
CN111507178A (zh) 数据处理的优化方法及装置、存储介质、计算机设备
CN118276942A (zh) 用于执行矢量计算的方法、计算装置、介质和程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23858705

Country of ref document: EP

Kind code of ref document: A1