WO2014101613A1 - 一种在嵌入式系统中生成坐标点的方法 - Google Patents

一种在嵌入式系统中生成坐标点的方法 Download PDF

Info

Publication number
WO2014101613A1
WO2014101613A1 PCT/CN2013/087924 CN2013087924W WO2014101613A1 WO 2014101613 A1 WO2014101613 A1 WO 2014101613A1 CN 2013087924 W CN2013087924 W CN 2013087924W WO 2014101613 A1 WO2014101613 A1 WO 2014101613A1
Authority
WO
WIPO (PCT)
Prior art keywords
point value
data
initial point
value
initial
Prior art date
Application number
PCT/CN2013/087924
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 飞天诚信科技股份有限公司
Priority to US14/423,465 priority Critical patent/US9613229B2/en
Publication of WO2014101613A1 publication Critical patent/WO2014101613A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • 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

Definitions

  • the present invention relates to the field of cryptography, and more particularly to a method of generating coordinate points in an embedded system. Background technique
  • a method of generating coordinate points in an embedded system comprising the steps of:
  • the second fixed value is a modulus
  • the obtained initial point value is multiplied by the data in the selected data bit, and the obtained point multiplication result and the intermediate point value are added to obtain a point.
  • Adding a result, and updating the intermediate point value to the point plus result, the initial value of the intermediate point value is (0, 0);
  • step S6 determining whether there is an unprocessed data bit in the first data, if yes, returning to step S2; otherwise, performing step S6;
  • a method of generating coordinate points in an embedded system comprising the steps of:
  • step S3 determining whether the data in the selected data bit is zero, if yes, proceeding to step S6; otherwise, executing step S4;
  • step S6 determining whether there is an unprocessed data bit in the first data, if yes, returning to step S2; otherwise, performing step S7;
  • a method of generating coordinate points in an embedded system comprising the steps of:
  • the second data is obtained by taking a bit length of the first data according to a preset packet length. 53, determining whether the second data is zero, if yes, proceeding to step S5; otherwise, performing step S4;
  • the first data is divided according to the preset packet length, to obtain multiple packets.
  • the second fixed value is a modulus
  • the obtained initial point value is multiplied by the data in the selected group, and the obtained point multiplication result and the intermediate point value are added to the point to obtain a point plus
  • the intermediate point value is updated to the point plus result, and the initial value of the intermediate point value is (0, 0);
  • step S10 determining whether there is an unprocessed packet in the first data, if yes, returning to step S6; otherwise, performing step S10;
  • a method of generating coordinate points in an embedded system comprising the steps of:
  • the second data is obtained by taking a bit length of the first data according to a preset packet length.
  • step S5 determines whether the second data is zero, if yes, executing step S5; otherwise, performing step S4;
  • the first data is divided according to the preset packet length, to obtain multiple packets.
  • the second fixed value is a modulus
  • the obtained initial point value is added to the intermediate point value to obtain an operation result, and the intermediate point value is updated to the operation result, where the intermediate point is The initial value of the value is (0, 0);
  • step S11 determining whether there is an unprocessed packet in the first data, if yes, returning to step S6; otherwise, performing step S11;
  • FIG. 1 is a flowchart of a method for generating coordinate points in an embedded system according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for adding an initial point value and an intermediate point value according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of a method for generating coordinate points in an embedded system according to Embodiment 2 of the present invention
  • FIG. 4 is a flowchart of a method for generating coordinate points in an embedded system according to Embodiment 3 of the present invention
  • FIG. 5 is a flowchart of a method for generating coordinate points in an embedded system according to Embodiment 4 of the present invention
  • FIG. 6 is a flowchart of a method for generating coordinate points in an embedded system according to Embodiment 5 of the present invention
  • FIG. 7 is a flowchart of a method for generating coordinate points in an embedded system according to Embodiment 6 of the present invention.
  • the first embodiment of the present invention provides a method for generating coordinate points in an embedded system. By querying a pre-stored initial point value list, the initial point value in the initial point value list is obtained, and the initial point value is calculated according to the initial point value.
  • the process is shown in Figure 1, which includes the following steps:
  • Step 101 Perform modulo on the random number by using the first fixed value as a modulus to obtain the first data.
  • the method further includes: generating a random number k, obtaining a first fixed value n;
  • Step 102 Determine whether the first data is 0. If yes, output error information; otherwise, perform step 103; in other embodiments of the present invention, if the first data is 0, a random number may also be generated, and return to the step 101; Step 103: Convert the first data into a binary number; in this embodiment, if the first data is 372, then convert to the corresponding 9-bit binary number 101110100, that is, the data bit length of the first data is 9;
  • this step is a preferred step.
  • the first data is a binary number
  • the first data need not be converted into a binary number, and the object of the present invention can also be achieved.
  • Step 104 Number the data bits of the converted binary number, and use the lowest bit of the binary number as the current data bit to obtain data in the current data bit.
  • the data bits of the binary number obtained according to the first data conversion are numbered starting from 0 in the order from the lower bit to the upper bit; for example, the first data is converted into a 9-bit binary number 101110100, and the data bit length is 9, starting from 0, the maximum number is 8, the highest digit is 8, the lowest digit is 0; the current data bit is the lowest digit, the data in the current data bit is 0;
  • Step 105 Determine whether the data in the current data bit is 0, if yes, go to step 106; otherwise, go to step 107;
  • Step 106 Obtain a data bit higher than the current data bit by one bit from the converted binary number, update the current data bit to the data bit, and return to step 105;
  • Step 107 According to the number corresponding to the current data bit, obtain a corresponding initial point value from the pre-stored initial point value list, add the obtained initial point value and the intermediate point value, and update the intermediate point value to a point.
  • the initial value of the intermediate point value is (0, 0), and the initial point value list includes multiple numbers and initial point values corresponding to the number, and the initial value corresponding to the number of i is xG ⁇ y).
  • G(x, y) is the preset first point value; when the number is 0, the corresponding initial point value is 2 Q xG(x, y); when the number is 1, the corresponding initial point value is S ⁇ G ⁇ y);
  • the result of the point-add operation between the initial point value and the intermediate point value is 2 2 xG(x, y), and the intermediate point value is updated to 2 2 xG(x, y) ;
  • the operation of generating the initial point value list may include: generating a plurality of continuous numbers according to the preset bit length, wherein the lowest value is zero; using 2 as the base, each number is an index, and the calculation is performed. a power value corresponding to each number; a power value corresponding to the number is multiplied by the first point value to obtain an initial point value corresponding to the number, and an initial point value list is generated according to each number and an initial point value corresponding to each number;
  • the generated numbers are: 8, 7, 6, 5, 4, 3, 2, 1, and 0, and the corresponding power values are 2 2 2 6 , 2 5 2 2 2 2 2 1 and 2°;
  • G 7 2 7 xG(x,y)
  • G 6 2 6 xG( x,y)
  • G 5 2 G(x,y)
  • G 4 2 4 xG(x,y)
  • G 3 2 3 xG(x,y) GfS ⁇ GCx ⁇ GfSixG ⁇ y)
  • G Q 2 Q xG( X , y) ;
  • Table 1 The list of initial point values generated is shown in Table 1:
  • Step 108 Determine whether the current data bit is the highest bit of the converted binary number, if yes, proceed to step 109; otherwise, return to step 106;
  • Step 109 output the intermediate point value as the generated coordinate point
  • the obtained intermediate point value Q l x2 8 xG(x,y)+l x2 6 xG(x,y)+l x2 5 xG(x,y) +l x2 4 xG(x,y)+l x2 2 xG(x,y).
  • the initial point value in the initial point value list is obtained by querying the preset initial point value list, and the calculation is performed according to the initial point value, thereby greatly improving the operation speed.
  • step 107 of the first embodiment the initial point value (the first abscissa, the second abscissa) and the intermediate point value (the second abscissa, the second ordinate) are added to each other to obtain a point addition operation.
  • the process of the operation result (the third abscissa, the third ordinate), as shown in FIG. 2, includes the following steps:
  • Step 201 Modulate the second ordinate and the first ordinate by using a second fixed value, and obtain a first difference;
  • the second fixed value is a modulus, and the second horizontal coordinate and the first horizontal The coordinate is subtracted to obtain a second difference;
  • Step 202 Modulate the first difference and the second difference by using a second fixed value to obtain a first parameter.
  • Step 203 using a second fixed value as the modulus, the first parameter and the first The parameter is modularly multiplied to obtain a first product;
  • Step 204 Modulating the first product and the first abscissa and the second abscissa with a second fixed value, to obtain a third abscissa;
  • Step 205 performing modulus reduction on the first abscissa and the third abscissa by using a second fixed value as a modulus, to obtain a third difference value;
  • Step 206 Modulating the third difference value and the first parameter by using a second fixed value, to obtain a second product;
  • the highest bit of the converted binary number may be used as the current data bit to obtain data in the current data bit, and it is determined whether the data in the current data bit is 0. If yes, the converted data is obtained. Obtaining a data bit lower than the current data bit by one bit in the binary number, updating the current data bit to the data bit, continuing to determine whether the data in the current data bit is 0, and performing subsequent operations; otherwise, corresponding to the current data bit. The number of the initial point value obtained from the pre-stored initial point value list, the obtained initial point value and the intermediate point value are added to the point, and the intermediate point value is updated to the operation result of the point plus operation, and the current judgment is performed.
  • the data bit is the lowest bit of the converted binary number, and if so, the intermediate point value is output as the generated coordinate point; otherwise, the data bit lower than the current data bit is obtained from the converted binary number, The current data bit is updated to the data bit, and it is continuously determined whether the data in the current data bit is 0 or not. Continued operation.
  • the above process can also achieve the object of the invention.
  • the data in the current data bit may not be determined to be zero, but the initial point value corresponding to the current data bit is directly obtained from the initial point value list, and the obtained initial point value and the current data bit are obtained.
  • the data in the data is multiplied, and the point multiplication is performed according to the obtained point multiplication result.
  • Embodiment 2 For the specific process, refer to the second embodiment.
  • Embodiment 2 of the present invention provides a method for generating coordinate points in an embedded system. As shown in FIG. 2, the following steps are included:
  • Step 301 Generate multiple consecutive numbers according to the preset bit length.
  • the smallest number is zero; for example, when the preset bit length is 9 bits, the generated numbers are: 8, 7,
  • Step 302 using 2 as the base, each number is an index, and calculating a power value corresponding to each number;
  • Step 303 Dot-multiply the power value corresponding to the number and the first point value to obtain an initial point value corresponding to the number, and generate an initial point value list according to each number and an initial point value corresponding to each number;
  • the initial point value list includes multiple numbers and initial point values corresponding to the number, and the initial value corresponding to the number of i is xG ⁇ y), and G(x, y) is the preset first point. Value; in this embodiment, a point can be obtained from a preset elliptic curve, and the coordinates of the point are taken as the first point value, ⁇ ,
  • the generated initial point value list can be seen in Table 1;
  • Step 304 Perform modulo on the random number by using the first fixed value as the modulus, to obtain the first data;
  • the first fixed value is n
  • the random number is k
  • the first data is k mod n
  • the random number k is determined according to the predefined elliptic curve as the first fixed value n is step 305: Whether the data is 0, if yes, the error message is output; otherwise, step 306 is performed; step 306: converting the first data into a binary number;
  • this step is a preferred step.
  • the first data is a binary number
  • the first data need not be converted into a binary number, and the object of the present invention can also be achieved.
  • Step 307 number the data bits of the converted binary number, and use the lowest bit of the binary number as the current data bit to obtain the data in the current data bit.
  • the data bits of the binary number obtained according to the first data conversion are numbered starting from 0 in the order from the lower bit to the upper bit;
  • the intermediate point value is 2 2 xG(x,y);
  • Step 310 Determine whether the current data bit is the highest bit of the converted binary number, and if yes, execute step 312; otherwise, execute step 311;
  • Step 311 Acquire a data bit one bit higher than the current data bit, update the current data bit to the data bit, and return to step 308;
  • Step 312 output the intermediate point value as the generated coordinate point;
  • the random number k is >, then
  • the embodiment of the present invention generates an initial point value list according to a preset bit length, and in the process of generating a coordinate point, queries the initial point value list, obtains an initial point value in the initial point value list, and performs according to the initial point value. Calculations greatly increase the speed of the calculation.
  • the binary data obtained by the first data conversion may be divided, and the obtained packets are numbered, and the preset initial point value list is queried according to the group number and the value to obtain an initial point.
  • the matching initial point value in the value list is calculated according to the initial point value.
  • Embodiment 3 of the present invention provides a method for generating coordinate points in an embedded system. As shown in FIG. 4, the following steps are included:
  • Step 401 Perform modulo on the random number by using the first fixed value as an modulo to obtain the first data.
  • Step 402 Determine whether the first data is 0, if yes, output error information; otherwise, perform step 403;
  • Step 403 convert the first data into a binary number;
  • this step is a preferred step.
  • the first data is a binary number
  • the first data need not be converted into a binary number, and the object of the present invention can also be achieved.
  • Step 404 The second data is obtained by taking the bit length of the converted binary number according to the preset packet length.
  • Step 405 determining whether the second data is 0, if yes, executing step 407; otherwise, performing step 406; In this embodiment, if the first data is 372, the corresponding data is converted to a corresponding 9-bit binary number 101110100. If the preset packet length is 2, the second data is 1;
  • Step 406 Complement 0 in the high bit of the converted binary number, and return to step 404;
  • the preset packet length is 2, the first data is 372, and then converted to the corresponding 9 binary number 101110100, the second data obtained by using 2 to 9 modulo is 1; then the 101110100 is added. 0, the 10-bit binary number 0101110100 is obtained, and the second data obtained by modulating 2 to 10 is 0;
  • Step 407 Divide the converted binary data according to the preset packet length, and number the obtained packets, and use the lowest packet in the binary data as the current packet;
  • the packets obtained by dividing the binary data according to the preset packet length are numbered according to the order from the lower bit to the upper bit; wherein the bit length of the packet is the preset packet length.
  • the preset packet length is 2, and the binary number is 0101110100.
  • the divided packets are, in order from high to low, "01", "01", “11", "01", and "00", respectively. 4, 3, 2, 1, and 0; group the group "00" with the number 0 as the current group;
  • Step 408 Determine whether the value of the current packet is zero. If yes, go to step 409; otherwise, go to step 410; Step 409, obtain the packet adjacent to the current packet and higher than the current packet from the converted binary number, The current packet is updated to the packet, and returns to step 408;
  • Step 410 Obtain a corresponding initial point value from the pre-stored initial point value list according to the current group number and the value, add the obtained initial point value and the intermediate point value, and update the intermediate point value to The result of the operation of the point addition operation.
  • the initial point value list may be queried according to the current group number, and the index corresponding to the number in the initial point value list is obtained, and then the initial point value corresponding to the index equal to the current group value is obtained, and the obtained initial point value is obtained.
  • the initial value of the intermediate point value is (0, 0), and the initial point value list includes multiple numbers, multiple indexes corresponding to each number, and initial point values corresponding to each index; the number of indexes corresponding to each number Depending on the preset packet length, when the preset packet length is ⁇ , the number of indexes corresponding to each number is 2 ⁇ -1, which are integers from 1 to 2 ⁇ -1 respectively;
  • the initial point value corresponding to the 2 n -l index corresponding to the number i is the point multiplication result of each index with 2 13 ⁇ 4 xG( X , y), ⁇ , l x2 13 ⁇ 4 xG(x, y)...(2 n -l)x2 1>>n xG(x,y), G(x,y) is a preset first point value;
  • the preset packet length is 2, and the index corresponding to number 0 includes 1, 2, and 3, and the corresponding initial point values are l x2°xG(x, y) 2x2 0 xG(x, y) and 3 2° x G (x, y);
  • the index corresponding to number 1 includes 1, 2, and 3, and the corresponding initial point values are l x2 1>>2 xG( X , y), 2x2 1>>2 xG( X , y) and 3x2 1>>2 xG( X , y) ;
  • the binary number obtained by the first data conversion is 101110100, if the current group number is 1, and the value is 01, the initial value obtained is: (0,0), the result of the point addition operation between the initial point value and the intermediate point value is The value is updated to 2 2 xG(x,y);
  • the operation of generating the initial point value list may include: generating a plurality of continuous values according to the preset bit length and the preset packet length; generating multiple consecutive values for each number according to the preset packet length Index, where the number of the number is the ratio of the preset bit length to the preset packet length, the lowest value is zero, the index with the smallest value is 1; the base 2 is the index, and each number is an index, and each is calculated.
  • the power value corresponding to the number; the power value, the index, and the first point value corresponding to the number are multiplied to obtain an initial point value corresponding to the number and the index, and each index corresponding to each number and number, and the number An initial point value corresponding to the index, generating a list of initial point values;
  • the generated numbers are: 4, 3, 2, 1, and 0, respectively, and the corresponding power values are 2 8 , 2 6 , 2 2 . 2 and 2 0 ;
  • G wl 3x2 2 xG(x,y);
  • G 2 _ 1Q 2x2 4 xG(; X , y:) and
  • G 2 _ u 3x2 4 xG(; X , y:) ;
  • G 3-1 Q 2x2 6 xG(x,y) and
  • G 3-11 3x2 6 xG(x,y);
  • G 4 ⁇ 2x2 8 xG(x,y) and
  • G 4-11 3x2
  • Step 411 Determine whether the current packet is the highest-order packet among the converted binary numbers, and if yes, execute step 412; otherwise, return to step 409;
  • Step 412 output the intermediate point value as the generated coordinate point
  • the initial point value in the initial point value list is obtained by querying the preset initial point value list, and the calculation is performed according to the initial point value, thereby greatly improving the operation speed.
  • the highest-order packet among the converted binary numbers may be used as the current packet, and it is determined whether the value of the current packet is zero. If yes, the binary number is obtained adjacent to the current packet and is more current than the current packet. Grouping a low packet, updating the current packet to the packet, continuing to determine whether the current packet value is zero, and performing subsequent operations; otherwise, obtaining a corresponding initial from the initial point value list according to the current packet number and value Point value, add the obtained initial point value and the intermediate point value, and update the intermediate point value to the operation result of the point addition operation, and determine whether the current group is the lowest group in the binary number, and if so, The intermediate point value is output as the generated coordinate point; otherwise, the packet that is adjacent to the current packet and lower than the current packet is obtained from the binary number, the current packet is updated to the packet, and the value of the current packet is continuously determined to be zero, and Subsequent operations.
  • the initial point value corresponding to the current group is directly obtained from the initial point value list, and the obtained initial point value is compared with the current grouped value. Multiply, and perform a point addition operation according to the obtained point multiplication result. For the specific process, refer to Embodiment 4.
  • Embodiment 4 of the present invention provides a method for generating coordinate points in an embedded system. As shown in FIG. 5, the following steps are included:
  • Step 501 Generate multiple consecutive numbers according to the preset bit length and the preset packet length.
  • the number of the number is the ratio of the preset bit length to the preset packet length, and the smallest value is zero; for example, the preset bit length is 10 bits, and the preset packet length is 2, the generated number is The number is 5, which are: 4, 3, 2, 1 and 0;
  • Step 502 Taking the base 2 as a base, the product of each number and the preset packet length is an index, and the power value corresponding to each number is calculated;
  • Step 503 The power value corresponding to the number and the first point value Performing point multiplication to obtain an initial point value corresponding to the number, and generating an initial point value list according to each number and an initial point value corresponding to each number;
  • the initial point value list includes multiple numbers and initial point values corresponding to the number; when the preset group length is n, the initial point values corresponding to the number i are 2 13 ⁇ 4 xG( X , y), G(x , y) is the preset first point value;
  • Step 504 Perform modulo on the random number by using the first fixed value as an modulo to obtain the first data.
  • Step 505 Determine whether the first data is 0, if yes, output error information; otherwise, perform step 506; Step 506: Convert the first data into a binary number;
  • the first data is 372, it is converted into a corresponding 9-bit binary number 101110100;
  • this step is a preferred step.
  • the first data is a binary number
  • the first data need not be converted into a binary number, and the object of the present invention can also be achieved.
  • Step 507 The second data is obtained by taking the bit length of the converted binary number according to the preset packet length; Step 508: determining whether the second data is 0, if yes, executing step 510; otherwise, performing step 509; In this embodiment, if the first data is 372, it is converted into a corresponding 9-bit binary number 101110100, such as a preset. The packet length is 2, and the second data is 1;
  • Step 509 Complement 0 in the high bit of the converted binary number, and return to step 507;
  • the preset packet length is 2, the first data is 372, and then converted to the corresponding 9 binary number 101110100, the second data obtained by using 2 to 9 modulo is 1; then the 101110100 is added. 0, the 10-bit binary number 0101110100 is obtained, and the second data obtained by modulating 2 to 10 is 0;
  • Step 510 Divide the converted binary data according to the preset packet length, and number the obtained packets, and use the lowest packet in the binary data as the current packet;
  • the packets obtained by dividing the binary data according to the preset packet length are numbered according to the order from the lower bit to the upper bit; wherein the bit length of the packet is the preset packet length.
  • the preset packet length is 2, and the binary number is 0101110100.
  • the divided packets are, in order from high to low, "01", "01", “11", "01", and "00", respectively. 4, 3, 2, 1, and 0; group the group "00" with the number 0 as the current group;
  • Step 511 Obtain a corresponding initial point value from a pre-stored initial point value list according to the current grouping number; for example, when the binary number obtained by the first data conversion is 101110100, if the current grouping number is 1, the acquiring is performed.
  • the initial point value is: GfS ⁇ G ⁇ y);
  • Step 512 Multiply the obtained initial point value by the value of the current grouping, perform a point addition operation on the obtained point multiplication result and the intermediate point value, and update the intermediate point value to the operation result of the point addition operation;
  • the initial value of the intermediate point value is (0, 0); for example, the binary number obtained by the first data conversion is 101110100, and if the current group corresponding number is 2, the corresponding initial point value obtained is:
  • the initial point value is multiplied by the value of the current grouping, and the obtained point multiplication result is lx2 2 xG(x, y); the point multiplication result is added to the intermediate point value (0, 0), and the obtained result is updated.
  • the intermediate point value is 2 2 xG(x, y); for the specific process of performing the point addition operation on the obtained point multiplication result and the intermediate point value, refer to step 201 to step 207 in FIG.
  • Step 513 Determine whether the current packet is the highest-order packet among the converted binary numbers, and if yes, execute step 515; otherwise, execute step 514;
  • Step 514 Obtain a packet adjacent to the current packet and higher than the current packet from the converted binary number, update the current packet to the packet, and return to step 511.
  • Step 515 output the intermediate point value as the generated coordinate point
  • the obtained intermediate point value Q l x2 8 xG(x,y)+l x2 6 xG(x,y)+3x2 4 xG(x,y) +l x2 2 xG(x,y)+0x2°xG(x,y).
  • an initial point value list is generated according to a preset bit length and a preset group length, and in the process of generating a coordinate point, the initial point value list is queried, and an initial point value in the initial point value list is obtained, and according to The initial point value is calculated, which greatly increases the operation speed.
  • Embodiment 5 of the present invention provides a method for generating coordinate points in an embedded system. As shown in FIG. 5, the following steps are included:
  • Step 601 Obtain a random number and a first fixed value, and perform modulo on the random number with a first fixed value to obtain a first data.
  • the first data is a binary number 101110100.
  • Step 602 Select an unprocessed data bit from the first data.
  • Step 603 Determine whether the data in the selected data bit is zero. If yes, execute step 606; otherwise, execute step 604.
  • Step 604 Obtain an initial point value corresponding to the selected data bit from a pre-stored initial point value list according to the location of the selected data bit in the first data.
  • each initial point value in the initial point value list is an operation result obtained by multiplying different power values by a preset first point value G(x, y), and the power value may be 2 1 , i is included An element in a sequence of consecutive integers, such as zero, which is a finite sequence. Specifically, an initial point value of a corresponding size may be obtained from the initial point value list according to the location of the selected data bit in the first data.
  • the corresponding initial point value is the initial value of the initial value in the initial point value list, that is, 2 Q xG( X , y) ; the selected data bit When it is the first digit, the corresponding initial point value is 2 0 ⁇ , ).
  • the number corresponding to the selected data bit in the initial point value table may be determined according to the position of the selected data bit in the first data, The initial point value corresponding to the number is used as the initial point value corresponding to the selected data bit. For example, if the initial point value list is as shown in Table 1, if the selected data bit is the 0th bit, the corresponding number is 0, and the corresponding initial point value is G. ; The selected data bit is the first digit, then the corresponding number is
  • Step 605 Perform a point addition operation on the obtained initial point value and the intermediate point value to obtain an operation result, and update the intermediate point value to the operation result.
  • the initial value of the intermediate point value is (0, 0).
  • Step 606 determining whether there is an unprocessed data bit in the first data, if yes, returning to step 602; otherwise, performing step 607.
  • step 607 the intermediate point value is output as the result data.
  • the initial point value in the initial point value list is obtained by querying the preset initial point value list, and the calculation is performed according to the initial point value, thereby greatly improving the operation speed.
  • Embodiment 6 of the present invention provides a method for generating coordinate points in an embedded system. As shown in FIG. 6, the following steps are included:
  • Step 701 Obtain a random number and a first fixed value, and perform modulo on the random number with a first fixed value to obtain a first data.
  • the first data is a binary number 101110100 with a bit length of 9.
  • Step 702 Reserve a bit length of the first data according to a preset packet length to obtain second data.
  • Step 703 Determine whether the second data is zero. If yes, go to step 705; otherwise, go to step 704. Step 704, adding zeros to the high bits of the first data, and returning to step 702.
  • the first data after zero padding is 0101110100.
  • Step 705 Divide the first data according to the preset packet length to obtain multiple packets.
  • the divided groups are, in order from high to low: "01”, "01", “11", "01", and "00".
  • Step 706 Select an unprocessed packet from the first data.
  • Step 707 Acquire an initial point value corresponding to the selected group from a pre-stored initial point value list according to the location of the selected group in the first data.
  • each initial point value in the initial point value list is an operation result obtained by multiplying different power values by a preset first point value G(x, y), and the power value may be 2 1 i to include zero An element in a sequence of consecutive integers, the sequence is a finite sequence, and n is the preset packet length.
  • an initial point value of a corresponding size may be obtained from the initial point value list according to the location of the selected data bit in the first data. For example, if the selected data bit is the 0th bit, gp, and the lowest bit, the corresponding initial point value is the initial value of the smallest value in the initial point value list, that is, 2 Q!>2 xG( X , y) ; When the data bit is the first bit, the corresponding initial point value is 2 1>>2 xG( X , y:).
  • Step 708 Multiply the obtained initial point value by the data in the selected group, perform a point addition operation on the obtained point multiplication result and the intermediate point value, obtain an operation result, and update the intermediate point value to the operation result.
  • Step 709 determining whether there is an unprocessed packet in the first data, if yes, returning to step 706; otherwise, performing step 710.
  • step 710 the intermediate point value is output as the result data.
  • the initial point value obtained is 2 8 xG(x, y:), 2 6 xG(x, y) 2 4 xG(x, y) 2 2 xG(x, y) and 2 Q xG(x,y), after adding points, the resulting data is obtained.
  • the embodiment of the present invention queries a preset initial point value list, obtains an initial point value in the initial point value list, and calculates according to the initial point value and the selected group data. , greatly improved the speed of computing.
  • the steps in the method described in connection with the embodiments disclosed herein may be implemented directly in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Abstract

一种在嵌入式系统中生成坐标点的方法,包括以下步骤:获取随机数和第一固定值,并以第一固定值为模数,对随机数进行取模,得到第一数据;从所述第一数据中选取各个数据位,当选取的数据位中的数据不为零时,根据选取的数据位在所述第一数据中的位置,从预先存储的初始点值列表中获取与所述选取的数据位对应的初始点值,将获取的初始点值与中间点值进行点加运算,将得到的运算结果作为结果数据输出。本发明通过查询预先设置的初始点值列表,获取初始点值列表中的初始点值,并根据该初始点值进行计算,极大地提高了生成坐标点的运算速度。

Description

一种在嵌入式系统中生成坐标点的方法 技术领域
本发明涉及密码学领域, 尤其涉及一种在嵌入式系统中生成坐标点的方法。 背景技术
随着科学技术的发展, 数据安全性的要求也越来越高, 现有保护数据安全性具有加密 和签名等实现方式, 但是加密过程和签名过程都需要有密钥的参与, 现有生成密钥的过程 中数据量大, 运算速度慢, 使得加密和签名过程的实现效率都很低。 发明内容
本发明的目的是提供一种在嵌入式系统中生成坐标点的方法, 以解决现有技术中生成 坐标点的运算速度慢的缺陷。
为此, 根据本发明的第一方面, 提供了一种在嵌入式系统中生成坐标点的方法, 包括 以下步骤:
51、 获取随机数和第一固定值, 并以第一固定值为模数, 对随机数进行取模, 得到第 一数据;
52、 从所述第一数据中选取一个未被处理过的数据位;
53、 根据选取的数据位在所述第一数据中的位置, 从预先存储的初始点值列表中获取 与所述选取的数据位对应的初始点值, 所述初始点值列表中的各个初始点值分别为不同的 幂值与预设的第一点值进行点乘得到的运算结果;
54、 以所述第二固定值为模数, 将获取的初始点值与所述选取的数据位中的数据进行 点乘, 对得到的点乘结果与中间点值进行点加运算, 得到点加结果, 并将所述中间点值更 新为所述点加结果, 所述中间点值的初始值为 (0, 0);
55、 判断所述第一数据中是否存在未被处理过的数据位, 如果存在, 在返回步骤 S2; 否则, 执行步骤 S6;
56、 将所述中间点值作为结果数据输出。
根据本发明的第二方面, 提供了一种在嵌入式系统中生成坐标点的方法, 包括以下步 骤:
51、 获取随机数和第一固定值, 并以第一固定值为模数, 对随机数进行取模, 得到第 一数据;
52、 从所述第一数据中选取一个未被处理过的数据位;
S3、判断选取的数据位中的数据是否为零, 如果是, 则执行步骤 S6; 否则, 执行步骤 S4;
54、 根据所述选取的数据位在所述第一数据中的位置, 从预先存储的初始点值列表中 获取与所述选取的数据位对应的初始点值, 所述初始点值列表中的各个初始点值分别为不 同的幂值与预设的第一点值进行点乘得到的运算结果;
55、 将获取的初始点值与中间点值进行点加运算, 得到点加结果, 并将所述中间点值 更新为所述点加结果, 所述中间点值的初始值为 (0, 0);
56、 判断所述第一数据中是否存在未被处理过的数据位, 如果存在, 在返回步骤 S2; 否则, 执行步骤 S7;
57、 将所述中间点值作为结果数据输出。
根据本发明的第三方面, 提供了一种在嵌入式系统中生成坐标点的方法, 包括以下步 骤:
51、 获取随机数和第一固定值, 并以所述第一固定值为模数, 对所述随机数进行取模, 得到第一数据;
52、 根据预设分组长度对所述第一数据的位长取余, 得到第二数据; 53、 判断所述第二数据是否为零, 如果是, 则执行步骤 S5 ; 否则, 执行步骤 S4;
54、 在所述第一数据的高位补零, 返回步骤 S2;
55、 根据所述预设分组长度对所述第一数据进行划分, 得到多个分组;
56、 从所述第一数据中选取一个未被处理过的分组;
57、 根据选取的分组在所述第一数据中的位置, 从预先存储的初始点值列表中获取与 所述选取的分组对应的初始点值, 所述初始点值列表中的各个初始点值分别为不同的幂值 与预设的第一点值进行点乘得到的运算结果;
58、 以所述第二固定值为模数, 将获取的初始点值与所述选取的分组中的数据进行点 乘, 对得到的点乘结果与中间点值进行点加运算, 得到点加结果, 并将所述中间点值更新 为所述点加结果, 所述中间点值的初始值为 (0, 0);
59、 判断所述第一数据中是否存在未被处理过的分组, 如果存在, 在返回步骤 S6; 否 则, 执行步骤 S10;
S10、 将所述中间点值作为结果数据输出。
根据本发明的第四方面, 提供了一种在嵌入式系统中生成坐标点的方法, 包括以下步 骤:
51、 获取随机数和第一固定值, 并以所述第一固定值为模数, 对所述随机数进行取模, 得到第一数据;
52、 根据预设分组长度对所述第一数据的位长取余, 得到第二数据;
53、 判断所述第二数据是否为零, 如果是, 则执行步骤 S5 ; 否则, 执行步骤 S4;
54、 在所述第一数据的高位补零, 返回步骤 S2;
55、 根据所述预设分组长度对所述第一数据进行划分, 得到多个分组;
56、 从所述第一数据中选取一个未被处理过的分组;
57、 判断选取的分组中的数据是否为零, 如果是, 则执行步骤 S10; 否则, 执行步骤
S8;
58、 根据选取的分组在所述第一数据中的位置和所述选取的分组中的数据, 从预先存 储的初始点值列表中获取与所述选取的分组对应的初始点值, 所述初始点值列表中的各个 初始点值分别为不同的幂值与预设的第一点值进行点乘得到的运算结果;
59、 以所述第二固定值为模数, 将获取的初始点值与中间点值进行点加运算, 得到运 算结果, 并将所述中间点值更新为所述运算结果, 所述中间点值的初始值为 (0, 0);
510、 判断所述第一数据中是否存在未被处理过的分组, 如果存在, 在返回步骤 S6; 否则, 执行步骤 S11 ;
511、 将所述中间点值作为结果数据输出。
本发明的有益效果: 通过查询预先设置的初始点值列表, 获取初始点值列表中的初始 点值, 并根据该初始点值进行计算, 极大地提高了生成坐标点的运算速度。 附图说明
图 1为本发明实施例一中的一种在嵌入式系统中生成坐标点的方法流程图; 图 2为本发明实施例一中将初始点值与中间点值进行点加运算的方法流程图; 图 3为本发明实施例二中的一种在嵌入式系统中生成坐标点的方法流程图; 图 4为本发明实施例三中的一种在嵌入式系统中生成坐标点的方法流程图; 图 5为本发明实施例四中的一种在嵌入式系统中生成坐标点的方法流程图; 图 6为本发明实施例五中的一种在嵌入式系统中生成坐标点的方法流程图; 图 7为本发明实施例六中的一种在嵌入式系统中生成坐标点的方法流程图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地 描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本 发明中的实施例, 本领域的技术人员在没有做出创造性劳动前提下所获得的所有其他实施 例, 都属于本发明保护的范围。 实施例一
本发明实施例一提供了一种在嵌入式系统中生成坐标点的方法, 通过查询预先存储的 初始点值列表, 获取初始点值列表中匹配的初始点值, 并根据该初始点值进行计算, 其流 程如图 1所示, 包括以下步骤:
步骤 101 : 以第一固定值为模数, 对随机数进行取模, 得到第一数据;
优选地, 步骤 101之前还包括: 生成随机数 k, 获取第一固定值 n;
步骤 102: 判断第一数据是否为 0, 如果是, 则输出错误信息; 否则, 执行步骤 103 ; 在本发明的其他实施例中, 如果第一数据为 0, 还可生成随机数, 并返回步骤 101 ; 步骤 103 : 将第一数据转换为二进制数; 在本实施例中, 如第一数据为 372, 则转换为 相应的 9位二进制数 101110100, 即第一数据的数据位长度为 9;
需要说明的是, 本步骤为优选步骤, 当第一数据为二进制数时, 不需要将第一数据转 换为二进制数, 同样可以实现本发明的发明目的。
步骤 104: 对转换得到的二进制数的数据位进行编号, 将该二进制数的最低位作为当 前数据位, 获取当前数据位中的数据;
本实施例中, 按照从低位到高位的顺序, 从 0开始, 对根据第一数据转换得到的二进 制数的数据位进行编号;例如,第一数据转化为 9位二进制数 101110100,数据位长度为 9, 从 0开始编号, 最大编号为 8, 最高位的编号为 8, 最低位的编号为 0; 当前数据位为最低 位, 当前数据位中的数据为 0;
步骤 105 : 判断当前数据位中的数据是否为 0, 如果是, 则执行步骤 106; 否则, 执行 步骤 107;
步骤 106: 从转换得到的二进制数中获取比当前数据位高一位的数据位, 将当前数据 位更新为该数据位, 返回步骤 105 ;
步骤 107: 根据当前数据位对应的编号, 从预先存储的初始点值列表中获取对应的初 始点值, 将获取的初始点值与中间点值进行点加运算, 并将中间点值更新为点加运算的运 算结果;
其中, 中间点值的初始值为 (0,0), 初始点值列表中包括多个编号以及该编号对应的初 始点值, 取值为 i的编号对应的初始点值为 xG^y), G(x,y)为预设的第一点值; 编号为 0 时, 对应的初始点值为 2QxG(x,y); 编号为 1时, 对应的初始点值为 S^G^y); 根据第一数 据转换得到的二进制数为 101110100时,若当前数据位对应的编号为 2,则获取的对应的初 始点值为: G2=22xG(x,y); 中间点值为 (0,0), 则初始点值与中间点值进行点加运算的运算结 果为 22xG(x,y), 将中间点值更新为 22xG(x,y);
生成初始点值列表的操作, 可具体包括: 根据预设的位长, 生成多个取值连续的编号, 其中, 取值最小的编号为零; 以 2为底数, 各个编号为指数, 计算得到各个编号对应的幂 值; 对编号对应的幂值与第一点值进行点乘, 得到与编号对应的初始点值, 并根据各个编 号以及与各个编号对应的初始点值生成初始点值列表;
例如, 预设的位长为 9位时, 生成的编号分别为: 8、 7、 6、 5、 4、 3、 2、 1和 0, 则 对应的幂值分别为 2 2 26、 25、 2 2 2 21和 2°; 点乘后得到的初始点值分别为 G8=28xG(x,y) G7=27xG(x,y)、 G6=26xG(x,y) G5=2 G(x,y)、 G4=24xG(x,y) G3=23xG(x,y) GfS^GCx^GfSixG ^y)和 GQ=2QxG(X,y); 生成初始点值列表如表 1所示:
初始点值列表示例
编号 8 7 6 5 4 3 2 1 0
初始点值 G8 G7 G6 G5 G4 G3 G2 Gi Go 步骤 108: 判断当前数据位是否为转换得到的二进制数的最高位, 如果是, 则执行步 骤 109; 否则, 返回步骤 106;
步骤 109: 将中间点值作为生成的坐标点输出;
例如, 根据第一数据转换得到的二进制数为 101110100时, 获取的初始点值分别为编 号为 2、4、5、6和 8的数据位对应的初始点值,即, G8=28xG(X,y)、G6=26xG(X,y)、G5=25xG(x,y)、 G4=24xG(x,y) G2=22xG(x,y) ; 根据上述初始点值进行点加运算之后, 得到的中间点值 Q=l x28xG(x,y)+l x26xG(x,y)+l x25xG(x,y)+l x24xG(x,y)+l x22xG(x,y)。
本发明实施例通过查询预先设置的初始点值列表, 获取初始点值列表中的初始点值, 并根据该初始点值进行计算, 极大地提高了运算速度。
在本实施例一的步骤 107中, 将初始点值 (第一横坐标, 第二横坐标)与中间点值 (第二 横坐标, 第二纵坐标)进行点加运算, 得到点加运算的运算结果 (第三横坐标, 第三纵坐标) 的过程, 如图 2所示, 包括以下步骤:
步骤 201 : 以第二固定值为模数, 对第二纵坐标和第一纵坐标进行模减, 得到第一差 值; 以第二固定值为模数, 对第二横坐标和第一横坐标进行模减得到第二差值;
步骤 202: 以第二固定值为模数, 对第一差值和第二差值进行模除, 得到第一参数; 步骤 203 : 以第二固定值为模数, 对第一参数和第一参数进行模乘, 得到第一乘积; 步骤 204: 以第二固定值为模数, 对第一乘积和第一横坐标、 第二横坐标进行模减, 得到第三横坐标;
步骤 205 : 以第二固定值为模数, 对第一横坐标和第三横坐标进行模减, 得到第三差 值;
步骤 206: 以第二固定值为模数, 对第三差值和第一参数进行模乘, 得到第二乘积; 步骤 207: 以第二固定值为模数, 对第二乘积和第一纵坐标进行模减, 得到第三纵坐 标;
本发明其他实施例中, 还可以将转换得到的二进制数的最高位作为当前数据位, 获取 当前数据位中的数据, 判断当前数据位中的数据是否为 0, 如果是, 则从转换得到的二进 制数中获取比当前数据位低一位的数据位, 将当前数据位更新为该数据位, 继续判断当前 数据位中的数据是否为 0, 并进行后续的操作; 否则, 根据当前数据位对应的编号, 从预 先存储的初始点值列表中获取对应的初始点值, 将获取的初始点值与中间点值进行点加运 算, 并将中间点值更新为点加运算的运算结果, 判断当前数据位是否为转换得到的二进制 数的最低位, 如果是, 则将中间点值作为生成的坐标点输出; 否则, 从转换得到的二进制 数中获取比当前数据位低一位的数据位, 将当前数据位更新为该数据位, 继续判断当前数 据位中的数据是否为 0, 并进行后续的操作。 上述流程同样可以实现本发明的发明目的。
本发明其他实施例中, 还可以不判断当前数据位中的数据是否为零, 而是直接从初始 点值列表中获取当前数据位对应的初始点值, 将获取的初始点值与当前数据位中的数据进 行点乘, 并根据得到的点乘结果进行点加运算, 具体流程参见实施例二。 实施例二
本发明实施例二提供了一种在嵌入式系统中生成坐标点的方法, 如图 2所示, 包括以 下步骤:
步骤 301 : 根据预设的位长, 生成多个取值连续的编号;
其中, 取值最小的编号为零; 例如, 预设的位长为 9位时, 生成的编号分别为: 8、 7、
6、 5、 4、 3、 2、 1禾口 0;
步骤 302: 以 2为底数, 各个编号为指数, 计算得到各个编号对应的幂值;
例如, 编号分别为: 8、 7、 6、 5、 4、 3、 2、 1和 0时, 对应的幂值分别为 28、 27、 26
25、 2 23、 22、 21和 20; 步骤 303 : 对编号对应的幂值与第一点值进行点乘, 得到与编号对应的初始点值, 并 根据各个编号以及与各个编号对应的初始点值生成初始点值列表;
其中, 初始点值列表中包括多个编号以及该编号对应的初始点值, 取值为 i的编号对 应的初始点值为 xG^y) , G(x,y)为预设的第一点值; 本实施例中, 可以从预设的椭圆曲 线上获取一个点, 将该点的坐标作为第一点值, 艮卩,
Figure imgf000007_0001
点 值分别为 G8=28xG(x,y)、 G7=27xG(x,y)、 G6=26xG(x,y)、 G5=25xG(x,y)、 G4=24xG(x,y)、 G3=23xG(x,y) G2=22xG(x,y) GfS^G^y)和 Go=2QxG(X,y) ; 生成的初始点值列表可参见 表 1所示;
步骤 304 : 以第一固定值为模数, 对随机数进行取模, 得到第一数据;
例如, 第一固定值为 n, 随机数为 k, 则第一数据为 k mod n; 本实施例中, 随机数 k 以根据预定义的椭圆曲线确定第一固定值 n 为 步骤 305 : 判断第一数据是否为 0, 如果是, 则输出错误信息; 否则, 执行步骤 306; 步骤 306 : 将第一数据转换为二进制数;
需要说明的是, 本步骤为优选步骤, 当第一数据为二进制数时, 不需要将第一数据转 换为二进制数, 同样可以实现本发明的发明目的。
步骤 307 : 对转换得到的二进制数的数据位进行编号, 将该二进制数的最低位作为当 前数据位, 获取当前数据位中的数据;
本实施例中, 按照从低位到高位的顺序, 从 0开始, 对根据第一数据转换得到的二进 制数的数据位进行编号;
步骤 308 : 根据当前数据位对应的编号, 从初始点值列表中获取对应的初始点值; 例如, 若当前数据位对应的编号为 2, 则获取的对应的初始点值为: G2=22xG(x,y) ; 步骤 309 : 将获取的初始点值与当前数据位中的数据进行点乘, 对得到的点乘结果与 中间点值进行点加运算, 并将中间点值更新为点加运算的运算结果;
其中, 中间点值的初始值为 (0,0), 若当前数据位对应的编号为 2, 则获取的对应的初始 点值为: G2=22xG(x,y) ; 该初始点值与当前数据位中的数据进行点乘, 得到的点乘结果为 l x22xG(x,y) ; 将点乘结果与中间点值 (0,0)进行点加运算, 可得到更新后的中间点值 22xG(x,y) ;
对得到的点乘结果与中间点值进行点加运算的具体过程, 可参见图 2中的步骤 201至 步骤 207。
步骤 310 : 判断当前数据位是否为转换得到的二进制数的最高位, 如果是, 则执行步 骤 312 ; 否则, 执行步骤 311 ;
步骤 311 : 获取比当前数据位高一位的数据位, 将当前数据位更新为该数据位, 返回 步骤 308 ;
步骤 312 : 将中间点值作为生成的坐标点输出;
Figure imgf000007_0002
随机数 k为 >, 则
Figure imgf000008_0001
本发明实施例根据预设的位长生成初始点值列表, 并在生成坐标点的过程中, 查询该 初始点值列表, 获取初始点值列表中的初始点值, 并根据该初始点值进行计算, 极大地提 高了运算速度。
在本发明其他实施例中, 还可以对根据第一数据转换得到的二进制数据进行划分, 并 对得到的分组进行编号, 根据分组的编号和取值查询预先设置的初始点值列表, 获取初始 点值列表中匹配的初始点值, 并根据该初始点值进行计算, 具体流程参见实施例三。 实施例三
本发明实施例三提供了一种在嵌入式系统中生成坐标点的方法,, 如图 4所示, 包括以 下步骤:
步骤 401 : 以第一固定值为模数, 对随机数进行取模, 得到第一数据;
步骤 402: 判断第一数据是否为 0, 如果是, 则输出错误信息; 否则, 执行步骤 403 ; 步骤 403 : 将第一数据转换为二进制数;
需要说明的是, 本步骤为优选步骤, 当第一数据为二进制数时, 不需要将第一数据转 换为二进制数, 同样可以实现本发明的发明目的。
步骤 404: 根据预设分组长度对转换得到的二进制数的位长取余, 得到第二数据; 步骤 405 : 判断第二数据是否为 0, 如果是, 则执行步骤 407; 否则, 执行步骤 406; 在本实施例中, 如第一数据为 372, 则转换为相应的 9位二进制数 101110100, 如预设 分组长度为 2, 则第二数据为 1 ;
步骤 406: 在转换得到的二进制数的高位补 0, 返回步骤 404;
在本实施例中, 如预设分组长度为 2, 第一数据为 372, 则转化为相应的 9二进制数 101110100, 则用 2对 9取模得到的第二数据为 1 ; 则在 101110100前补 0, 得到 10位的二 进制数 0101110100, 用 2对 10取模得到的第二数据为 0;
步骤 407: 根据预设分组长度对转换得到的二进制数据进行划分, 并对得到的分组进 行编号, 将二进制数据中最低位的分组作为当前分组;
本实施例中, 按照从低位到高位的顺序, 从 0开始, 对根据预设分组长度对二进制数 据划分得到的分组进行编号; 其中, 分组的位长为预设分组长度。 例如, 预设分组长度为 2, 二进制数为 0101110100, 划分得到的分组, 从高到低依次为: "01"、 "01"、 "11"、 "01" 和 "00", 对应的编号分别为 4、 3、 2、 1和 0; 将编号为 0的分组 "00"作为当前分组;
步骤 408: 判断当前分组的值是否为零, 如果是, 执行步骤 409; 否则, 执行步骤 410; 步骤 409, 从转换得到的二进制数中获取与当前分组相邻且比当前分组高的分组, 将 当前分组更新为该分组, 返回步骤 408;
步骤 410, 根据当前分组的编号和取值, 从预先存储的初始点值列表中获取对应的初 始点值, 将获取的初始点值与中间点值进行点加运算, 并将中间点值更新为点加运算的运 算结果.
具 地, 可以根据当前分组的编号查询初始点值列表, 获取初始点值列表中该编号对 应的索引, 进而获取与当前分组的取值相等的索引对应的初始点值, 对获取的初始点值与 中间点值进行点加运算, 并将中间点值更新为点加运算的运算结果; 对获取的初始点值与 中间点值进行点加运算的具体过程, 可参见图 2中的步骤 201至步骤 207。
其中, 中间点值的初始值为 (0,0), 初始点值列表中包括多个编号、 各个编号对应的多 个索引, 以及各个索引对应的初始点值; 每个编号对应的索引的数量取决于预设分组长度, 当预设分组长度为 η时, 每个编号对应的索引的数量为 2η-1, 分别为从 1到 2η-1的整数; 编号 i对应的 2n-l个索引对应的初始点值分别为各个索引与 2xG(X,y)的点乘结果, 艮卩, l x2xG(x,y)...(2n-l)x21>>nxG(x,y), G(x,y)为预设的第一点值;
例如, 预设分组长度为 2, 编号 0对应的索引包括 1、 2和 3, 分别对应的初始点值为 l x2°xG(x,y) 2x20xG(x,y)和 3 2°xG(x,y); 编号 1对应的索引包括 1、 2和 3, 分别对应的 初始点值为 l x21>>2xG(X,y)、 2x21>>2xG(X,y)和 3x21>>2xG(X,y); 根据第一数据转换得到的二进 制数为 101110100 时, 若当前分组的编号为 1, 取值为 01, 则获取的初始点值为: 中间点值为 (0,0), 则初始点值与中间点值进行点加运算的运算结果为
Figure imgf000009_0001
值更新为 22xG(x,y);
生成初始点值列表的操作, 可具体包括: 根据预设的位长和预设分组长度, 生成多个 取值连续的编号; 根据预设分组长度, 为每个编号生成多个取值连续的索引, 其中, 编号 的数量为预设的位长与预设分组长度之比, 取值最小的编号为零, 取值最小的索引为 1 ; 以 2为底数, 各个编号为指数, 计算得到各个编号对应的幂值; 对编号对应的幂值、 索引 和第一点值进行点乘, 得到与该编号和该索引对应的初始点值, 并根据各个编号、 编号对 应的各个索引, 以及与编号和索引对应的初始点值, 生成初始点值列表;
例如, 预设的位长为 10位, 预设分组长度为 2 时, 生成的编号分别为: 4、 3、 2、 1 和 0, 则对应的幂值分别为 28、 26、 2 22和 20; 点乘之后, 可得到编号 0对应的索引 1、 2和 3分别对应的初始点值, 为 G =l x2QxG(x,y)、
编号 1对应的索引 1、 2和 3分别对应的初始点值,
Figure imgf000009_0002
和 Gwl=3x22xG(x,y);编号 2对应的索引 1、2和 3分别对应的初始点值,为 G2^H=l x24xG(X,y)、 G2_1Q=2x24xG(;X,y:)和 G2_u=3x24xG(;X,y:); 编号 3对应的索引 1、 2禾 B 3分别对应的初始点值, 为 G3-()1=l x26xG(x,y)、 G3-1Q=2x26xG(x,y)和 G3-11=3x26xG(x,y); 编号 4对应的索引 1、 2和 3 分别对应的初始点值, 为 G«n=l x28xG(x,y)、 G4^=2x28xG(x,y)和 G4-11=3x28xG(x,y); 生成 初始点值列表如表 2所示:
Figure imgf000009_0003
步骤 411 : 判断当前分组是否为转换得到的二进制数中最高位的分组, 如果是, 则执 行步骤 412; 否则, 返回步骤 409;
步骤 412: 将中间点值作为生成的坐标点输出;
例如, 根据第一数据转换得到的二进制数为 101110100 时, 划分得到的分组为 "01"、 "01"、 "11"、 "01"和 "00", 对应的编号分别为 4、 3、 2、 1和 0; 从初始点值列表中获取编 号为 4、 3、 2和 1 的分组对应初始点值, 分别为 G4_oi=l x28xG(x,y) G3_oi=l ><26xG(x,y) G2_u=3x24xG(X,y)和 G^flxS^G^y); 根据上述初始点值进行点加运算之后, 得到的中间 点值 Q=lx28xG(x,y)+l x26xG(x,y)+3x24xG(x,y)+lx22xG(x,y)。
本发明实施例通过查询预先设置的初始点值列表, 获取初始点值列表中的初始点值, 并根据该初始点值进行计算, 极大地提高了运算速度。
本发明其他实施例中, 还可以将转换得到的二进制数中最高位的分组作为当前分组, 判断当前分组的值是否为零, 如果是, 则从二进制数中获取比当前分组相邻且比当前分组 低的分组, 将当前分组更新为该分组, 继续判断当前分组的值是否为零, 并进行后续的操 作; 否则, 根据当前分组的编号和取值, 从初始点值列表中获取对应的初始点值, 将获取 的初始点值与中间点值进行点加运算, 并将中间点值更新为点加运算的运算结果, 判断当 前分组是否为二进制数中最低位的分组, 如果是, 则将中间点值作为生成的坐标点输出; 否则, 从二进制数中获取比当前分组相邻且比当前分组低的分组, 将当前分组更新为该分 组, 继续判断当前分组的值是否为零, 并进行后续的操作。
本发明其他实施例中, 还可以不判断当前分组的值是否为零, 而是直接从初始点值列 表中获取当前分组对应的初始点值, 将获取的初始点值与当前分组的值进行点乘, 并根据 得到的点乘结果进行点加运算, 具体流程参见实施例四。 实施例四
本发明实施例四提供了一种在嵌入式系统中生成坐标点的方法, 如图 5所示, 包括以 下步骤:
步骤 501 : 根据预设的位长和预设分组长度, 生成多个取值连续的编号;
其中, 编号的数量为预设的位长与预设分组长度之比, 取值最小的编号为零; 例如, 预设的位长为 10位, 预设分组长度为 2时, 生成的编号的数量为 5, 分别为: 4、 3、 2、 1 和 0;
步骤 502: 以 2为底数, 各个编号与预设分组长度的乘积为指数, 计算得到各个编号 对应的幂值;
例如, 编号分别为: 4、 3、 2、 1和 0时, 对应的幂值分别为 28、 26、 2 22和 2Q; 步骤 503: 对编号对应的幂值和第一点值进行点乘, 得到与编号对应的初始点值, 并 根据各个编号以及与各个编号对应的初始点值, 生成初始点值列表;
其中, 初始点值列表中包括多个编号以及该编号对应的初始点值; 当预设分组长度为 n时, 编号 i对应的初始点值分别为 2xG(X,y), G(x,y)为预设的第一点值;
例如, 编号 4、 3、 2、 1和 0对应的幂值, 分别为 28、 26、 2 22和 2Q时, 点乘之后, 得到各个编号对应的初始点值, 分别为 G4=28xG(x,y)、 G3=26xG(x,y) G2=24xG(x,y) GfS^G^y;)和 GQ=2QxG<;X,y:); 生成的初始点值列表如表 3所示:
初始点值列表示例三
Figure imgf000010_0001
步骤 504: 以第一固定值为模数, 对随机数进行取模, 得到第一数据;
步骤 505: 判断第一数据是否为 0, 如果是, 则输出错误信息; 否则, 执行步骤 506; 步骤 506: 将第一数据转换为二进制数;
在本实施例中, 如第一数据为 372, 则转换为相应的 9位二进制数 101110100;
需要说明的是, 本步骤为优选步骤, 当第一数据为二进制数时, 不需要将第一数据转 换为二进制数, 同样可以实现本发明的发明目的。
步骤 507: 根据预设分组长度对转换得到的二进制数的位长取余, 得到第二数据; 步骤 508: 判断第二数据是否为 0, 如果是, 则执行步骤 510; 否则, 执行步骤 509; 在本实施例中, 如第一数据为 372, 则转换为相应的 9位二进制数 101110100, 如预设 分组长度为 2, 则第二数据为 1 ;
步骤 509: 在转换得到的二进制数的高位补 0, 返回步骤 507;
在本实施例中, 如预设分组长度为 2, 第一数据为 372, 则转化为相应的 9二进制数 101110100, 则用 2对 9取模得到的第二数据为 1 ; 则在 101110100前补 0, 得到 10位的二 进制数 0101110100, 用 2对 10取模得到的第二数据为 0;
步骤 510: 根据预设分组长度对转换得到的二进制数据进行划分, 并对得到的分组进 行编号, 将二进制数据中最低位的分组作为当前分组;
本实施例中, 按照从低位到高位的顺序, 从 0开始, 对根据预设分组长度对二进制数 据划分得到的分组进行编号; 其中, 分组的位长为预设分组长度。 例如, 预设分组长度为 2, 二进制数为 0101110100, 划分得到的分组, 从高到低依次为: "01"、 "01"、 "11"、 "01" 和 "00", 对应的编号分别为 4、 3、 2、 1和 0; 将编号为 0的分组 "00"作为当前分组;
步骤 511, 根据当前分组的编号, 从预先存储的初始点值列表中获取对应的初始点值; 例如, 根据第一数据转换得到的二进制数为 101110100时, 若当前分组的编号为 1, 则 获取的初始点值为: GfS^G^y);
步骤 512: 将获取的初始点值与当前分组的值进行点乘, 对得到的点乘结果与中间点 值进行点加运算, 并将中间点值更新为点加运算的运算结果;
其中, 中间点值的初始值为 (0,0) ; 例如, 根据第一数据转换得到的二进制数为 101110100, 若当前分组对应的编号为 2, 则获取的对应的初始点值为:
Figure imgf000011_0001
该 初始点值与当前分组的值进行点乘, 得到的点乘结果为 lx22xG(x,y); 将点乘结果与中间点 值 (0,0)进行点加运算, 可得到更新后的中间点值 22xG(x,y); 对得到的点乘结果与中间点值 进行点加运算的具体过程, 可参见图 2中的步骤 201至步骤 207。
步骤 513: 判断当前分组是否为转换得到的二进制数中最高位的分组, 如果是, 则执 行步骤 515; 否则, 执行步骤 514;
步骤 514: 从转换得到的二进制数中获取与当前分组相邻且比当前分组高的分组, 将 当前分组更新为该分组, 返回步骤 511 ;
步骤 515: 将中间点值作为生成的坐标点输出;
例如, 根据第一数据转换得到的二进制数为 101110100 时, 得到的中间点值 Q=l x28xG(x,y)+l x26xG(x,y)+3x24xG(x,y)+l x22xG(x,y)+0x2°xG(x,y)。
本发明实施例根据预设的位长和预设分组长度生成初始点值列表, 并在生成坐标点的 过程中, 查询该初始点值列表, 获取初始点值列表中的初始点值, 并根据该初始点值进行 计算, 极大地提高了运算速度。 实施例五
本发明实施例五提供了一种在嵌入式系统中生成坐标点的方法, 如图 5所示, 包括以 下步骤:
步骤 601, 获取随机数和第一固定值, 并以第一固定值为模数, 对随机数进行取模, 得到第一数据。
例如, 第一数据为二进制数 101110100。
步骤 602, 从第一数据中选取一个未被处理过的数据位。
步骤 603, 判断选取的数据位中的数据是否为零, 如果是, 则执行步骤 606; 否则, 执 行步骤 604。
步骤 604, 根据选取的数据位在第一数据中的位置, 从预先存储的初始点值列表中获 取与所述选取的数据位对应的初始点值。
其中, 初始点值列表中的各个初始点值分别为不同的幂值与预设的第一点值 G(x,y)进 行点乘得到的运算结果, 幂值可以为 21, i为包括零在内的连续整数序列中的元素, 该序列 为有限序列。 具体地, 可以根据选取的数据位在第一数据中的位置, 从初始点值列表中获取对应大 小的初始点值。 例如, 选取的数据位为第 0位, gp, 最低位时, 对应的初始点值为初始点 值列表中取值最小的初始点值, 即 2QxG(X,y); 选取的数据位为第 1位时, 对应的初始点值 为 2 0^, )。
当初始点值列表中包含多个编号以及各个编号对应的初始点值时, 可以根据选取的数 据位在第一数据中的位置, 确定初始点值表中与选取的数据位对应的编号, 将该编号对应 的初始点值作为与选取的数据位对应的初始点值。 例如, 初始点值列表如表 1所示, 选取 的数据位为第 0位, 则对应的编号为 0, 对应的初始点值为 G。; 选取的数据位为第 1位, 则对应的编号为
步骤 605, 将获取的初始点值与中间点值进行点加运算, 得到运算结果, 并将中间点 值更新为该运算结果。
其中, 中间点值的初始值为 (0, 0)。
步骤 606,判断第一数据中是否存在未被处理过的数据位,如果存在,在返回步骤 602; 否则, 执行步骤 607。
步骤 607, 将中间点值作为结果数据输出。
本实施例中,第一数据为 101110100时,获取的初始点值为 G8=28xG(x,y:)、 G6=26xG(x,y:)、 G5=25xG(x,y) G4=24xG(x,y) G2=22xG(x,y) , 依次点加之后, 得到的结果数据为 Q=l x28xG(x,y)+l x26xG(x,y)+l x25xG(x,y)+l x24xG(x,y)+l x22xG(x,y)。
本发明实施例通过查询预先设置的初始点值列表, 获取初始点值列表中的初始点值, 并根据该初始点值进行计算, 极大地提高了运算速度。 实施例六
本发明实施例六提供了一种在嵌入式系统中生成坐标点的方法, 如图 6所示, 包括以 下步骤:
步骤 701, 获取随机数和第一固定值, 并以第一固定值为模数, 对随机数进行取模, 得到第一数据。
例如, 第一数据为二进制数 101110100, 位长为 9。
步骤 702, 根据预设分组长度对所述第一数据的位长取余, 得到第二数据。
步骤 703, 判断第二数据是否为零, 如果是, 则执行步骤 705 ; 否则, 执行步骤 704。 步骤 704, 在第一数据的高位补零, 返回步骤 702。
例如, 预设分组长度为 2时, 补零之后的第一数据为 0101110100。
步骤 705, 根据预设分组长度对第一数据进行划分, 得到多个分组。
例如, 划分得到的分组, 从高到低依次为: "01"、 "01"、 "11"、 "01"和 "00"。
步骤 706, 从第一数据中选取一个未被处理过的分组。
步骤 707, 根据选取的分组在所述第一数据中的位置, 从预先存储的初始点值列表中 获取与所述选取的分组对应的初始点值。
其中, 初始点值列表中的各个初始点值分别为不同的幂值与预设的第一点值 G(x,y)进 行点乘得到的运算结果, 幂值可以为 21 i为包括零在内的连续整数序列中的元素, 该序 列为有限序列, n为预设分组长度。
具体地, 可以根据选取的数据位在第一数据中的位置, 从初始点值列表中获取对应大 小的初始点值。 例如, 选取的数据位为第 0位, gp, 最低位时, 对应的初始点值为初始点 值列表中取值最小的初始点值, 即 2Q!>2xG(X,y); 选取的数据位为第 1位时, 对应的初始点 值为 21>>2xG(X,y:)。
步骤 708, 将获取的初始点值与选取的分组中的数据进行点乘, 对得到的点乘结果与 中间点值进行点加运算, 得到运算结果, 并将中间点值更新为该运算结果。
其中, 中间点值的初始值为 (0, 0)。 步骤 709, 判断第一数据中是否存在未被处理过的分组, 如果存在, 在返回步骤 706; 否则, 执行步骤 710。
步骤 710, 将中间点值作为结果数据输出。
本实施例中, 第一数据为 101110100时, 获取的初始点值为 28xG(x,y:)、 26xG(x,y) 24xG(x,y) 22xG(x,y)和 2QxG(x,y), 依次点加之后, 得到的结果数据
Q=l x28xG(x,y)+l x26xG(x,y)+3x24xG(x,y)+l x22xG(x,y)+0x2°xG(x,y)。
本发明实施例根据选取的分组在第一数据中的位置, 查询预先设置的初始点值列表, 获取初始点值列表中的初始点值, 并根据该初始点值以及选取的分组的数据进行计算, 极 大地提高了运算速度。 结合本文中所公开的实施例描述的方法中的步骤可以直接用硬件、 处理器执行的软件 模块, 或者二者的结合来实施。 软件模块可以置于随机存储器 (RAM)、 内存、 只读存储器 (ROM), 电可编程 ROM、 电可擦除可编程 ROM、 寄存器、 硬盘、 可移动磁盘、 CD-ROM、 或技术领域内所公知的任意其它形式的存储介质中。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于此, 本领域 的技术人员在本发明揭露的技术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保 护范围之内。 因此, 本发明的保护范围应所述以权利要求的保护范围为准。

Claims

权利要求书
1、 一种在嵌入式系统中生成坐标点的方法, 其特征在于, 包括以下步骤:
51、 获取随机数和第一固定值, 并以第一固定值为模数, 对随机数进行取模, 得到第 一数据;
52、 从所述第一数据中选取一个未被处理过的数据位;
53、 根据选取的数据位在所述第一数据中的位置, 从预先存储的初始点值列表中获取 与所述选取的数据位对应的初始点值, 所述初始点值列表中的各个初始点值分别为不同的 幂值与预设的第一点值进行点乘得到的运算结果;
54、 将获取的初始点值与所述选取的数据位中的数据进行点乘, 对得到的点乘结果与 中间点值进行点加运算, 得到点加结果, 并将所述中间点值更新为所述点加结果, 所述中 间点值的初始值为 (0, 0);
55、 判断所述第一数据中是否存在未被处理过的数据位, 如果存在, 在返回步骤 S2; 否则, 执行步骤 S6;
56、 将所述中间点值作为结果数据输出。
2、 如权利要求 1所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长, 生成包含零在内的、 多个取值连续的整数;
以 2为底数, 各个整数为指数, 计算得到各个整数对应的幂值;
对各个整数对应的幂值与所述第一点值进行点乘, 得到包含多个初始点值的初始点值 列表。
3、 如权利要求 1所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长, 生成包含零在内的、 多个取值连续的编号;
以 2为底数, 各个编号为指数, 计算得到各个编号对应的幂值;
对各个编号对应的幂值与所述第一点值进行点乘, 得到与各个编号对应的初始点值, 并根据各个编号以及与各个编号对应的初始点值生成初始点值列表。
4、 如权利要求 3所述的方法, 其特征在于, 所述根据选取的数据位在所述第一数据中 的位置, 从预先存储的初始点值列表中获取与所述选取的数据位对应的初始点值, 具体为: 所述根据所述选取的数据位在所述第一数据中的位置, 确定所述初始点值表中与所述 选取的数据位对应的编号, 将所述编号对应的初始点值作为与所述选取的数据位对应的初 始点值。
5、 如权利要求 3所述的方法, 其特征在于, 所述从第一数据中选取一个未被处理过的 数据位之前, 还包括:
按照从低到高的顺序, 对所述第一数据的数据位进行编号;
所述根据选取的数据位在所述第一数据中的位置, 从预先存储的初始点值列表中获取 与所述选取的数据位对应的初始点值, 具体为:
根据所述选取的数据位的编号, 从预先存储的初始点值列表中获取对应的初始点值。
6、 一种在嵌入式系统中生成坐标点的方法, 其特征在于, 包括以下步骤:
51、 获取随机数和第一固定值, 并以第一固定值为模数, 对随机数进行取模, 得到第 一数据;
52、 从所述第一数据中选取一个未被处理过的数据位;
S3、判断选取的数据位中的数据是否为零, 如果是, 则执行步骤 S6; 否则, 执行步骤 S4;
54、 根据所述选取的数据位在所述第一数据中的位置, 从预先存储的初始点值列表中 获取与所述选取的数据位对应的初始点值, 所述初始点值列表中的各个初始点值分别为不 同的幂值与预设的第一点值进行点乘得到的运算结果;
55、 将获取的初始点值与中间点值进行点加运算, 得到点加结果, 并将所述中间点值 更新为所述点加结果, 所述中间点值的初始值为 (0, 0); 56、 判断所述第一数据中是否存在未被处理过的数据位, 如果存在, 在返回步骤 S2; 否则, 执行步骤 S7;
57、 将所述中间点值作为结果数据输出。
7、 如权利要求 6所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长, 生成包含零在内的、 多个取值连续的整数;
以 2为底数, 各个整数为指数, 计算得到各个整数对应的幂值;
对各个整数对应的幂值与所述第一点值进行点乘, 得到包含多个初始点值的初始点值 列表。
8、 如权利要求 6所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长, 生成包含零在内的、 多个取值连续的编号;
以 2为底数, 各个编号为指数, 计算得到各个编号对应的幂值;
对各个编号对应的幂值与所述第一点值进行点乘, 得到与各个编号对应的初始点值, 并根据各个编号以及与各个编号对应的初始点值生成初始点值列表。
9、 如权利要求 8所述的方法, 其特征在于, 所述根据选取的数据位在所述第一数据中 的位置, 从预先存储的初始点值列表中获取与所述选取的数据位对应的初始点值, 具体为: 所述根据所述选取的数据位在所述第一数据中的位置, 确定所述初始点值表中与所述 选取的数据位对应的编号, 将所述编号对应的初始点值作为与所述选取的数据位对应的初 始点值。
10、 如权利要求 8所述的方法, 其特征在于, 所述从第一数据中选取一个未被处理过 的数据位之前, 还包括:
按照从低到高的顺序, 对所述第一数据的数据位进行编号;
所述根据选取的数据位在所述第一数据中的位置, 从预先存储的初始点值列表中获取 与所述选取的数据位对应的初始点值, 具体为:
根据所述选取的数据位的编号, 从预先存储的初始点值列表中获取对应的初始点值。
11、 一种在嵌入式系统中生成坐标点的方法, 其特征在于, 包括以下步骤:
51、 获取随机数和第一固定值, 并以所述第一固定值为模数, 对所述随机数进行取模, 得到第一数据;
52、 根据预设分组长度对所述第一数据的位长取余, 得到第二数据;
53、 判断所述第二数据是否为零, 如果是, 则执行步骤 S5 ; 否则, 执行步骤 S4;
54、 在所述第一数据的高位补零, 返回步骤 S2;
55、 根据所述预设分组长度对所述第一数据进行划分, 得到多个分组;
56、 从所述第一数据中选取一个未被处理过的分组;
57、 根据选取的分组在所述第一数据中的位置, 从预先存储的初始点值列表中获取与 所述选取的分组对应的初始点值, 所述初始点值列表中的各个初始点值分别为不同的幂值 与预设的第一点值进行点乘得到的运算结果;
58、 将获取的初始点值与所述选取的分组中的数据进行点乘, 对得到的点乘结果与中 间点值进行点加运算, 得到点加结果, 并将所述中间点值更新为所述点加结果, 所述中间 点值的初始值为 (0, 0);
59、 判断所述第一数据中是否存在未被处理过的分组, 如果存在, 在返回步骤 S6; 否 则, 执行步骤 S10;
S10、 将所述中间点值作为结果数据输出。
12、 如权利要求 11所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长和所述预设分组长度, 生成包含零在内的、 多个取值连续的整数; 以 2为底数, 各个整数与所述预设分组长度的乘积为指数, 计算得到各个整数对应的 幂值;
对各个整数对应的幂值与所述第一点值进行点乘, 得到包含多个初始点值的初始点值 列表。
13、 如权利要求 11所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长和所述预设分组长度, 生成包含零在内的、 多个取值连续的编号; 以 2为底数, 各个编号与所述预设分组长度的乘积为指数, 计算得到各个编号对应的 幂值;
对各个编号对应的幂值与所述第一点值进行点乘, 得到与各个编号对应的初始点值, 并根据各个编号以及与各个编号对应的初始点值生成初始点值列表。
14、 如权利要求 13所述的方法, 其特征在于, 所述根据选取的分组在所述第一数据中 的位置, 从预先存储的初始点值列表中获取与所述选取的分组对应的初始点值, 具体为: 所述根据所述选取的分组在所述第一数据中的位置, 确定所述初始点值表中与所述选 取的分组对应的编号,将所述编号对应的初始点值作为与所述选取的分组对应的初始点值。
15、 如权利要求 13所述的方法, 其特征在于, 所述从第一数据中选取一个未被处理过 的分组之前, 还包括:
按照从低到高的顺序, 对根据所述第一数据划分得到的分组进行编号;
所述根据选取的分组在所述第一数据中的位置, 从预先存储的初始点值列表中获取与 所述选取的分组对应的初始点值, 具体为:
根据所述选取的分组的编号, 从预先存储的初始点值列表中获取对应的初始点值。
16、 一种在嵌入式系统中生成坐标点的方法, 其特征在于, 包括以下步骤:
51、 获取随机数和第一固定值, 并以所述第一固定值为模数, 对所述随机数进行取模, 得到第一数据;
52、 根据预设分组长度对所述第一数据的位长取余, 得到第二数据;
53、 判断所述第二数据是否为零, 如果是, 则执行步骤 S5 ; 否则, 执行步骤 S4;
54、 在所述第一数据的高位补零, 返回步骤 S2;
55、 根据所述预设分组长度对所述第一数据进行划分, 得到多个分组;
56、 从所述第一数据中选取一个未被处理过的分组;
57、 判断选取的分组中的数据是否为零, 如果是, 则执行步骤 S10; 否则, 执行步骤
S8;
58、 根据选取的分组在所述第一数据中的位置和所述选取的分组中的数据, 从预先存 储的初始点值列表中获取与所述选取的分组对应的初始点值, 所述初始点值列表中的各个 初始点值分别为不同的幂值与不同的索引以及预设的第一点值进行点乘得到的运算结果;
59、 以所述第二固定值为模数, 将获取的初始点值与中间点值进行点加运算, 得到运 算结果, 并将所述中间点值更新为所述运算结果, 所述中间点值的初始值为 (0, 0);
510、 判断所述第一数据中是否存在未被处理过的分组, 如果存在, 在返回步骤 S6; 否则, 执行步骤 S11 ;
511、 将所述中间点值作为结果数据输出。
17、 如权利要求 16所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长和所述预设分组长度, 生成包含零在内的、 多个取值连续的整数; 以
2为底数, 各个整数与所述预设分组长度的乘积为指数, 计算得到各个整数对应的幂值; 根据所述预设分组的长度生成多个索引; 以所述第二固定值为模数, 对各个整数对应 的幂值与所述第一点值以及所述索引进行点乘, 得到包含多个初始点值的初始点值列表。
18、 如权利要求 16所述的方法, 其特征在于, 所述初始点值列表通过以下方式生成: 根据预设的位长和所述预设分组的长度, 生成包含零在内的、 多个取值连续的编号; 以 2为底数, 各个编号与所述预设分组长度的乘积为指数, 计算得到各个编号对应的幂值; 根据所述预设分组的长度生成多个索引; 以所述第二固定值为模数, 对各个编号对应的幂 值与所述第一点值以及所述索引进行点乘, 得到与各个编号对应的初始点值, 并根据各个 编号以及与各个编号对应的初始点值生成初始点值列表。 19、 如权利要求 18所述的方法, 其特征在于, 所述根据选取的分组在所述第一数据中 的位置和所述选取的分组中的数据, 从预先存储的初始点值列表中获取与所述选取的分组 对应的初始点值, 具体为:
所述根据所述选取的分组在所述第一数据中的位置, 确定所述初始点值表中与所述选 取的分组对应的编号, 根据所述选取的分组中的数据, 从所述编号对应的初始点值中获取 与所述选取的分组对应的初始点值。
20、 如权利要求 18所述的方法, 其特征在于, 所述从第一数据中选取一个未被处理过 的分组之前, 还包括:
按照从低到高的顺序, 对根据所述第一数据划分得到的分组进行编号;
所述根据选取的分组在所述第一数据中的位置和所述选取的分组中的数据, 从预先存 储的初始点值列表中获取与所述选取的分组对应的初始点值, 具体为:
根据所述选取的分组的编号和所述选取的分组中的数据, 从预先存储的初始点值列表 中获取对应的初始点值。
PCT/CN2013/087924 2012-12-28 2013-11-27 一种在嵌入式系统中生成坐标点的方法 WO2014101613A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/423,465 US9613229B2 (en) 2012-12-28 2013-11-27 Method for generating coordinate point in embedded system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210587204.0A CN103092688B (zh) 2012-12-28 2012-12-28 一种在嵌入式系统中生成坐标点的方法
CN201210587204.0 2012-12-28

Publications (1)

Publication Number Publication Date
WO2014101613A1 true WO2014101613A1 (zh) 2014-07-03

Family

ID=48205298

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/087924 WO2014101613A1 (zh) 2012-12-28 2013-11-27 一种在嵌入式系统中生成坐标点的方法

Country Status (3)

Country Link
US (1) US9613229B2 (zh)
CN (1) CN103092688B (zh)
WO (1) WO2014101613A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092688B (zh) * 2012-12-28 2015-11-18 飞天诚信科技股份有限公司 一种在嵌入式系统中生成坐标点的方法
CN104142969B (zh) * 2013-11-27 2018-04-06 北京星网锐捷网络技术有限公司 数据分块的处理方法和装置
CN108627129A (zh) * 2018-04-28 2018-10-09 滨州职业学院 一种基于嵌入式的机械制造用三坐标测量方法
CN112769553B (zh) * 2020-12-30 2022-08-19 北京宏思电子技术有限责任公司 嵌入式系统中加快sm9双线性对运算的实现方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6633896B1 (en) * 2000-03-30 2003-10-14 Intel Corporation Method and system for multiplying large numbers
US20040096057A1 (en) * 2002-11-20 2004-05-20 Moore Stephen F. Modular multiplication of multi-precision numbers
CN101216754A (zh) * 2007-12-27 2008-07-09 广州杰赛科技股份有限公司 模乘运算的处理方法、数据加解密处理的方法、装置
CN102508632A (zh) * 2011-09-30 2012-06-20 飞天诚信科技股份有限公司 一种在嵌入式系统中实现乘法运算的方法和装置
CN103092688A (zh) * 2012-12-28 2013-05-08 飞天诚信科技股份有限公司 一种在嵌入式系统中生成坐标点的方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE60132962T2 (de) * 2000-01-21 2009-02-26 Sony Corp. Datenverarbeitungsvorrichtung und datenverarbeitungsverfahren
US20060224817A1 (en) * 2005-03-31 2006-10-05 Atri Sunil R NOR flash file allocation
US9166902B1 (en) * 2012-09-14 2015-10-20 Cisco Technology, Inc. Per-port multicast processing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6633896B1 (en) * 2000-03-30 2003-10-14 Intel Corporation Method and system for multiplying large numbers
US20040096057A1 (en) * 2002-11-20 2004-05-20 Moore Stephen F. Modular multiplication of multi-precision numbers
CN101216754A (zh) * 2007-12-27 2008-07-09 广州杰赛科技股份有限公司 模乘运算的处理方法、数据加解密处理的方法、装置
CN102508632A (zh) * 2011-09-30 2012-06-20 飞天诚信科技股份有限公司 一种在嵌入式系统中实现乘法运算的方法和装置
CN103092688A (zh) * 2012-12-28 2013-05-08 飞天诚信科技股份有限公司 一种在嵌入式系统中生成坐标点的方法

Also Published As

Publication number Publication date
US9613229B2 (en) 2017-04-04
CN103092688B (zh) 2015-11-18
US20160012253A1 (en) 2016-01-14
CN103092688A (zh) 2013-05-08

Similar Documents

Publication Publication Date Title
JP6353536B2 (ja) デジタル署名の生成方法及び装置
JP2012014203A5 (zh)
WO2017202161A1 (zh) 基于无证书两方认证密钥协商方法、装置和存储介质
JP2020522912A (ja) 鍵共有デバイス及び方法
CN108540291B (zh) 基于身份的云存储中数据完整性验证方法
WO2014101613A1 (zh) 一种在嵌入式系统中生成坐标点的方法
WO2015164996A1 (zh) 椭圆域曲线运算方法和椭圆域曲线运算器
CN109145616B (zh) 基于高效模乘的sm2加密、签名和密钥交换的实现方法及系统
CN110519058A (zh) 一种对于基于格的公钥加密算法的加速方法
WO2017049790A1 (zh) 一种基于多变量密码技术的在线离线签名系统及方法
CN102393812A (zh) 椭圆曲线密码体制中的快速点乘算法的实现方法
WO2011050624A1 (zh) 数据变换方法及装置
CN112737778B (zh) 数字签名生成、验证方法及装置、电子设备及存储介质
CN103929305A (zh) Sm2签名算法的实现方法
WO2014036829A1 (zh) 一种产生Gold序列的方法及芯片
CN114840174B (zh) 一种使用多乘法器快速实现蒙哥马利模乘的系统及方法
JP5427117B2 (ja) メッセージ認証子生成装置、メッセージ認証子検証装置、メッセージ認証子生成方法、メッセージ認証子検証方法、およびプログラム
TWI444028B (zh) 應用增強型窗口方法和相互交替型式於純量乘法演算法之橢圓形曲線加密方法
CN102394747B (zh) 一种快速嵌入明文到椭圆曲线上一点的方法
JP5816383B2 (ja) インターリーバーインデックス生成装置及び方法
CN113505383A (zh) 一种ecdsa算法执行系统及方法
RU2401513C2 (ru) Способ формирования и проверки подлинности электронной цифровой подписи, заверяющей электронный документ
WO2014067410A1 (zh) 一种在嵌入式系统中快速生成坐标点的方法
CN114650135B (zh) 一种软硬件协同的sm2椭圆曲线密码算法实现方法
CN116822537A (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: 13869606

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14423465

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13869606

Country of ref document: EP

Kind code of ref document: A1