ECC Anti-attack method and apparatus suitable for automobile security chip, device, and medium
In the ECC implementation of automotive security chips, the point operation disassembly method in the scalar average decomposition method is adjusted so that the operation operations of each cycle are double point operations and point addition operations, which solves the difficulty of resisting SPA at the same time in the existing technology. Attack and meet the issues of ISO 26262 standard, achieving both high efficiency and high fault detection rate.
Patent Information
- Application Number
- WO2024222905P0
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-10-31
AI Technical Summary
When automotive security chips implement elliptic curve cryptography (ECC), it is difficult to meet the requirements of high efficiency, high fault detection rate and attack resistance at the same time, especially when facing side-channel attacks and Safe-error fault injection attacks. The technology cannot effectively resist SPA attacks and meet the circuit fault detection rate requirements of the ISO 26262 functional safety standard.
By adjusting the point operation disassembly method in the scalar average decomposition method, the operation operations of each cycle are the same, including doubling point operations and point addition operations, eliminating the difference in operation time and power consumption between loops, and ensuring that through preprocessing The operation of each cycle is real, preventing false operation steps from affecting the final result.
It effectively resists power consumption attacks and Safe-error fault injection attacks, meets the high fault detection rate requirements of the ISO 26262 functional safety standard, while maintaining the high efficiency of scalar multiplication operations and avoiding the increase in calculation volume caused by false operation steps.
Smart Images

Figure CN2024090174_31102024_PF_FP_ABST
Abstract
Description
ECC anti-attack method, device, equipment and medium applicable to automotive safety chips
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 202310474162.8 filed on April 27, 2023, which is incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the technical field of automotive safety chips, and in particular to an ECC anti-attack method, device, equipment, and medium applicable to automotive safety chips. Background Art
[0004] In the automotive security chip sector, elliptic curve cryptography (ECC) has been widely implemented and applied due to its "short key" advantage over the traditional RSA (Rivest, Shamir, Adleman) public key cryptography at the same level of security strength. In particular, ECC has replaced RSA as the mainstream public key cryptography in the highly concurrent security authentication scenarios of connected vehicles (V2X). While automotive security chips offer more internal storage resources than smart cards and IoT security chips, they are still essentially embedded MCU (microcontroller unit) chips, with certain limitations on on-chip resource consumption and higher requirements for ECC implementation performance.
[0005] At the same time, circuit implementation in automotive chips often needs to adhere to the requirements of the ISO 26262 functional safety standard and meet a high circuit fault detection rate. Furthermore, side-channel attacks against cryptographic circuits are increasingly becoming a major threat to information leakage. Side-channel attacks (SCA), also known as side-channel attacks, exploit the power consumption, electromagnetic, and other side-channel information leaked by cryptographic algorithms during circuit operation to analyze signatures and reveal secret data such as encryption keys within the circuit. Power consumption / electromagnetic analysis is currently the most common type of side-channel attack, and attacks are carried out by monitoring physical information such as current, voltage, and electromagnetic leakage from the cryptographic system. Simple power / electromagnetic analysis (SPA / SEMA) can be used to directly observe the power consumption characteristics of the cryptographic circuit during operation. If there are clearly identifiable features on the power consumption curve, analyzing a single curve can reveal a wealth of sensitive information. Fault injection attacks, another threatening attack method for cryptographic circuits, inject faults into key steps of the circuit's operation and analyze the injected faults to obtain secret data.
[0006] Therefore, the implementation of ECC in automotive safety chips needs to take into account goals such as high efficiency, high fault detection rate, and anti-attack, while being economical in resource expenditure.
[0007] Summary of the Invention
[0008] A first aspect of the present disclosure provides an ECC anti-attack method suitable for automotive safety chips, comprising: in the process of calculating scalar multiplication using the scalar average decomposition method, when the values of all bits in the scalar bit group corresponding to the current cycle are 0, the next cycle is decomposed by point operation based on the principle that the final calculation result remains unchanged to obtain a first point operation part decomposed into the current cycle and a second point operation part decomposed into the next cycle.
[0009] In some embodiments of the first aspect of the present disclosure, the method further includes: determining whether the last loop in the scalar multiplication calculation process can still be decomposed by point operation based on the value of each bit in the scalar bit group corresponding to the last loop, and if it is determined that the last loop cannot be decomposed by point operation, preprocessing the scalar bit group corresponding to the last loop so that the last loop can be decomposed by point operation.
[0010] In some embodiments of the first aspect of the present disclosure, the point operation decomposition of the next cycle is performed based on the principle that the final calculation result remains unchanged, including: the points accumulated in the next cycle before decomposition are recorded as T, the first point operation part after decomposition is recorded as T', and the second point operation part after decomposition is recorded as T"; by performing point operation decomposition on the accumulated point T, T, T', and T" satisfy the following formula: [2] T'+T"=T.
[0011] In some embodiments of the first aspect of the present disclosure, performing point operation decomposition on the accumulated point T includes: when the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] are all 0, the accumulated point T is disassembled into the first point operation part of the current cycle: T'=[2 s-1 ]P, the accumulated point T is disassembled into the second point operation part of the next cycle: T" = -[2 s ]P; wherein m represents the number of segments into which the scalar is divided in the scalar average decomposition method, s represents the length of the segment, and P represents any point on the elliptic curve.
[0012] In some embodiments of the first aspect of the present disclosure, performing point operation decomposition on the accumulated point T includes: when the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] has only one bit l i When the value of is 1, the accumulated point T is decomposed into the first point operation part of the current loop: T'=[2 i*s ]P, the accumulated point T is disassembled into the second point operation part of the next cycle: T" = -[2 i*s ]P; wherein, m represents the number of segments into which the scalar is divided in the scalar average decomposition method, 0≤i≤m-1, P represents any point on the elliptic curve, and s represents the length of the segment.
[0013] In some embodiments of the first aspect of the present disclosure, performing point operation decomposition on the accumulated point T includes: when the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0], two or more bits have the value 1, l i(0) =…=l i(x-1) =l i(x) = 1, the accumulated points are decomposed into the first point operation part of the current loop: T' = [2 i(x)*s-1 ]P, the accumulated points are disassembled into the second point operation part of the next cycle: T" = [2 i(0)*s ]·P+…+[2 i(x-1)*sP; where m represents the number of segments into which the scalar is divided in the scalar average decomposition method, 0 ≤ i(0) < … < i(x - 1) < i(x) ≤ m - 1, P represents any point on the elliptic curve, and s represents the length of each segment.
[0014] In some embodiments of the first aspect of the present disclosure, the preprocessing of the scalar bit group corresponding to the last loop to enable the last loop to perform point operation decomposition includes: if the value of the lowest bit of the scalar is 1, then at least one bit value in the scalar bit group corresponding to the last loop is 1, and it is determined that there is no need to perform point operation decomposition; if the value of the lowest bit of the scalar is 0, then the scalar k is incremented by 1 to obtain scalar k' = k + 1 to ensure that at least one bit value in the last loop is 1, and after all operations are completed, the final calculation result is subtracted by point P to correct the deviation of the operation result caused by the preprocessing of the scalar, where P represents any point on the elliptic curve.
[0015] In some embodiments of the first aspect of the present disclosure, the method further includes: if the value of the lowest bit of the scalar is 1, then the scalar k is subtracted by 2 s to obtain scalar k' = k - 2 s and after all operations are completed, the final calculation result is added by point [2 s P to correct the deviation of the operation result caused by the preprocessing of the scalar, making the process of calculating scalar multiplication independent of the parity of the scalar, where P represents any point on the elliptic curve.
[0016] In some embodiments of the first aspect of the present disclosure, in the case of [2]T’ + T” = T, the final calculation result remains unchanged.
[0017] In some embodiments of the first aspect of the present disclosure, the method further includes: based on the scalar average decomposition method, the scalar is evenly divided into m segments, where the length of each segment is represented as s, and both m and s are integers. [[ID=第十九]]
[0018] In some embodiments of the first aspect of the present disclosure, before evenly dividing the scalar into m segments, the method further includes pre - calculating the points on the elliptic curve.
[0019] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present disclosure provides an ECC anti-attack device suitable for an automotive safety chip, including: a point operation disassembly module, which is used to, in the process of calculating scalar multiplication using the scalar average decomposition method, when the values of all bits in the scalar bit group corresponding to the current cycle are 0, perform point operation disassembly on the next cycle based on the principle that the final calculation result remains unchanged, so as to obtain a first point operation part disassembled into the current cycle and a second point operation part disassembled into the next cycle.
[0020] In some embodiments of the second aspect of the present disclosure, the device also includes: a scalar preprocessing module, which is used to determine whether the last loop in the scalar multiplication calculation process can still perform point operation decomposition based on the value of each bit in the scalar bit group corresponding to the last loop, and if it is determined that the last loop cannot perform point operation decomposition, preprocess the scalar bit group corresponding to the last loop so that the last loop can perform point operation decomposition.
[0021] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the ECC anti-attack method applicable to automotive safety chips.
[0022] To achieve the above-mentioned objectives and other related objectives, the fourth aspect of the present disclosure provides an automotive safety chip, comprising: a processor and a memory; the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal executes the ECC anti-attack method applicable to the automotive safety chip.
[0023] As described above, the disclosed ECC anti-attack method, apparatus, device, and medium for automotive safety chips have the following beneficial effects: By adjusting the accumulated points in the scalar average decomposition method, the disclosed method makes the calculation operations in each cycle the same, that is, each cycle performs doubling and point addition operations. This eliminates the differences in branch operation time and power consumption between cycles in the calculation process, making it impossible to identify sensitive information through power consumption attacks. It also avoids the problem of using false operations to fail to meet the high fault detection rate required by the ISO 26262 functional safety standard for automotive chips. The disclosed method can achieve the aforementioned beneficial effects with a relatively small amount of calculation and pre-stored points. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] FIG1 is a flow chart showing an ECC anti-attack method applicable to an automotive safety chip according to an embodiment of the present disclosure.
[0025] FIG2 is a schematic structural diagram of an ECC anti-attack device applicable to an automotive safety chip according to an embodiment of the present disclosure.
[0026] FIG3 is a schematic diagram showing the structure of an automotive safety chip according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following describes the embodiments of the present disclosure through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present disclosure from the content disclosed in this specification. The present disclosure can also be implemented or applied through different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0028] It should be noted that in the following description, reference is made to the accompanying drawings, which describe several embodiments of the present disclosure. It should be understood that other embodiments may also be used, and that mechanical, structural, electrical, and operational changes may be made without departing from the spirit and scope of the present disclosure. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present disclosure is limited only by the claims of the published patents. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between one element or feature shown in the figure and another element or feature.
[0029] In this disclosure, unless otherwise expressly specified or limited, terms such as "mounted," "connected," "connect," "fixed," and "holding" should be understood broadly. For example, these terms may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; or internal communication between two components. Those skilled in the art will understand the specific meanings of these terms in this disclosure based on specific circumstances.
[0030] Furthermore, as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, "A, B, or C" or "A, B, and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B, and C". Exceptions to this definition occur only when the combination of elements, functions, or operations is inherently mutually exclusive in some way.
[0031] In the high-efficiency implementation scheme of embedded chip ECC in related technologies, in order to improve the efficiency of the "scalar multiplication" operation, which is the most time-consuming in ECC calculations, the "scalar average decomposition method" is usually used. The scalar average decomposition method is a calculation method that divides the scalar into n segments (n is an integer) and then performs a cyclic scan of the bits of the n segments of sub-scalars at the same time. This method completes part of the calculation amount in advance through pre-calculation and pre-storage points, which greatly improves the efficiency of the scalar multiplication operation. The following takes the example of dividing the scalar into 4 segments to give the implementation method of the scalar average decomposition method. The algorithm content is shown below.
[0032] The scalar in the ECC scalar multiplication operation usually needs to be kept confidential, that is, it is sensitive information that cannot be known by attackers. The problem with the scalar average decomposition method is that the point addition operation in step 4.2 has branch differences. For example, when the values of multiple bits (also called scalar bit groups) of the scalar corresponding to the current loop are all 0 (i.e., a in Algorithm 1), i =b i =c i =d i = 0), the point T added by point Q (ie T[a i ,b i ,c i ,d i ]) is the infinite point O. According to the principle of elliptic curve, for the elliptic curve E(F q) satisfies P+O=P. Therefore, the point addition operation of the point at infinity is not necessary, which causes the branches of the current loop to be different from those of other loops. That is to say, when the values of all bits of the scalar bit group corresponding to the current loop are 0, the point addition operation of step 4.2 is not necessary, while the doubling operation of step 4.1 is required for each loop. The point addition operation and the doubling operation have different operation steps, and a clear difference can be seen in the power consumption curve. Therefore, once the attacker finds that two doubling operations (for example, the doubling operation of the current loop and the doubling operation of the next loop) are completed continuously (that is, the current loop lacks the point addition step), he can know that the values of all bits of the scalar bit group corresponding to the current loop are 0, thereby leaking sensitive information and becoming unable to resist SPA attacks.
[0033] In order to solve the above problem, a method is provided in the related art. For example, when the values of all bits of the scalar bit group corresponding to the current loop are 0, a false operation is performed, that is, a point addition operation is also completed, but the result is discarded. This point addition operation can be called a false operation. The specific algorithm 2 is shown below.
[0034] In its implementation, Algorithm 2 eliminates the differences in branch computation time and power consumption between loops during the computation process, making it impossible to distinguish between them based on their power consumption characteristics. This effectively resists SPA attacks while also minimizing the amount of computation required. This is the currently commonly used ECC anti-attack implementation method.
[0035] However, while the currently used ECC attack-resistant implementation method (Algorithm 2) eliminates differences in power consumption characteristics during operation execution and can defend against SPA attacks, it cannot defend against a type of fault injection attack known as safe-error. While observing the power consumption of the ECC circuit, the attacker injects a fault into the circuit while observing the execution of a dot-add operation (i.e., step 4.2 of Algorithm 2). By observing the impact of the injected fault on the final execution result, the attacker can determine whether the dot-add operation is true or false. In other words, if the injected fault affects the final execution result, the dot-add operation at the point of fault injection is true, meaning that at least one bit in the scalar bit group corresponding to the current cycle is non-zero. Conversely, if the injected fault does not affect the final result, the dot-add operation at the point of fault injection is false, meaning that all bits in the scalar bit group corresponding to the current cycle are zero. Once the attacker has identified the authenticity of the dot-add operations in each cycle of the ECC operation through the safe-error attack, they can then use the SPA attack to obtain sensitive scalar information.
[0036] Furthermore, the currently used ECC attack-resistant implementation method introduces dummy calculation steps that have no impact on the final result. When implemented in automotive safety chips, this significantly hinders the circuit fault detection rate required by the ISO 26262 functional safety standard. Cryptographic algorithms inherently exhibit significant diffusion and avalanche effects. Any minor data change during algorithm execution can significantly impact the final result. This characteristic allows engineers to simply verify the correctness of the final result of the cryptographic circuit execution to determine with high error detection probability whether a local circuit has failed. For example, to verify whether a circuit has failed during a signature calculation, simply verifying the signature result can determine whether a circuit has failed. However, if a dummy calculation step that has no impact on the final result is introduced to mitigate SPA attacks, even if the local circuitry executing the dummy calculation branch (such as a branch in the state machine) or the internal memory used to store the dummy calculation result fails (including temporary or persistent failures), the correctness of the final execution result cannot be used to determine whether the failure occurred.
[0037] Therefore, the currently commonly used ECC anti-attack implementation method can neither resist the SPA attack superimposed with the safe-error fault injection attack, nor can it meet the circuit fault detection rate requirements required by the ISO 26262 functional safety standard.
[0038] In view of the shortcomings of the above-mentioned related technologies, the purpose of the present disclosure is to solve the problem that the currently used ECC anti-attack implementation method can neither resist SPA attacks under superimposed safe-error fault injection attacks, nor meet the circuit fault detection rate requirements required by the ISO26262 functional safety standard.
[0039] The disclosed embodiments provide an ECC anti-attack method, system, terminal, and medium applicable to automotive safety chips, aiming to propose an improved scalar average decomposition method. In the disclosed embodiments, if the values of all bits in the scalar bit group corresponding to the current cycle are 0, by changing the points added in the current round (current cycle) and the next round (next cycle), a branch situation in which the point addition operation is skipped is achieved, so that the operation operations in each cycle are the same, that is, each cycle performs a doubling operation and a dot addition operation. In this way, the differences in the operation time and power consumption of the branches between the various cycles in the operation process can be eliminated, making it impossible to identify sensitive information through power consumption attacks, and the point operation in each cycle (whether it is a doubling operation or a dot addition operation) is a true operation. Therefore, once a fault is injected into any step of the method, it will affect the final operation result.
[0040] In order to make the purpose, technical solutions and advantages of the present disclosure more clearly understood, the following embodiments and the accompanying drawings further illustrate the technical solutions in the embodiments of the present disclosure. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not intended to limit the invention.
[0041] Before further explaining the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are explained. The nouns and terms involved in the embodiments of the present disclosure are subject to the following explanations.
[0042] Elliptic curve cryptography (ECC) is a type of public-key cryptosystem based on the elliptic curve discrete logarithm problem. It uses a finite point group of an elliptic curve over a finite field to replace the finite cyclic group in a discrete logarithm-based cryptosystem. The mathematical foundation of ECC's security lies in the computational intractability of the elliptic curve discrete logarithm problem (ECDLP). The core operation of ECC is scalar multiplication.
[0043] Scalar multiplication is the rule for performing multiple operations on the same point in ECC calculations. It can be expressed as [k]G, where k represents a scalar and G represents a point. Scalar multiplication is performed by loop scanning multiple bits of the scalar. In ECC calculations, scalar multiplication is typically broken down into two basic operations: point doubling and point addition.
[0044] Point multiplication operation: Adding a point to itself.
[0045] Point addition operation: Add two different points on the elliptic curve.
[0046] In this article, doubling point operation and point addition operation may be collectively referred to as point operation, that is, point operation includes doubling point operation and point addition operation.
[0047] The present disclosure provides an ECC attack resistance method for automotive safety chips, a system for executing the ECC attack resistance method for automotive safety chips, and a storage medium storing an executable program for implementing the ECC attack resistance method for automotive safety chips. Regarding the implementation of the ECC attack resistance method for automotive safety chips, the present disclosure describes an exemplary implementation scenario for ECC attack resistance in automotive safety chips.
[0048] As shown in Figure 1, a flowchart of an ECC attack resistance method for automotive safety chips in an embodiment of the present disclosure is shown. The ECC attack resistance method for automotive safety chips in this embodiment mainly includes the following steps S11 to S12.
[0049] Step S11: When calculating a scalar multiplication using the scalar average decomposition method, if all bits in the scalar bit group corresponding to the current loop are 0, the next loop is decomposed by point operation based on the principle that the final calculation result remains unchanged, thereby obtaining a first point operation portion decomposed into the current loop and a second point operation portion decomposed into the next loop. The scalar multiplication operation is performed by loop scanning of multiple bits of the scalar.
[0050] In the embodiment of the present disclosure, based on the principle that the final calculation result remains unchanged, the next cycle is decomposed into point operations, including: the points accumulated in the next cycle before decomposition are denoted as T, the first point operation part after decomposition is denoted as T', and the second point operation part after decomposition is denoted as T", and the decomposition is performed so that T, T', and T" satisfy the following conditions:
[0051] [2]T'+T"=T.
[0052] In the case of [2]T'+T"=T, the final calculation result remains unchanged. In this article, the accumulated point refers to the intermediate result (temporary variable point) of the iterative operation during the scalar multiplication calculation process.
[0053] In the embodiment of the present disclosure, when the scalar multiplication [k]P is calculated using the scalar average decomposition method, the length of the scalar k is t, and the scalar k is divided into m segments, each segment length In the process of scanning the scalar bit group, for example, the values of the scalar bit group corresponding to the current cycle are all 0, which can be recorded as the first bit group [j m-1 ,…,j1,j0], and satisfy [j m-1 ,…,j1,j0]=[0,…,0,0]. The scalar bit group corresponding to the next cycle is represented as the second bit group [l m-1 ,…,l1,l0], where l m-1,…,l1,l0 are 0 or 1 respectively, and the accumulated points T[l m-1 ,…,l1,l0]=[l m-1 2 (m-1)s ]P+…+[l1·2 s ]P+[l0]P.
[0054] By decomposing the above accumulated points T[l m-1 ,…,l1,l0], part of the calculation amount is transferred to the current loop, so that both the current loop and the next loop perform point addition operations. The point T accumulated before disassembly is disassembled to the point where the first point operation is performed in the current loop (the first point operation part) and is represented as T', and is disassembled to the point where the second point operation is performed in the next loop (the second point operation part) and is represented as T". According to the overall operation of the loop, as long as [2]T'+T"=T is satisfied, the final result can be kept unchanged. It should be understood that each round of operation (each loop) includes doubling point operation and point addition operation. Since doubling point operation must be performed first in each round of operation, T' will become [2]T' in the next loop.
[0055] In the embodiment of the present disclosure, according to the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0], the values of T' and T" can be determined.
[0056] In some embodiments, the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] are all 0, that is, l m-1 =...=l1=l0=0, T'=[2 s-1 ]P, T"=-[2 s ]P;s represents the length of each segment.
[0057] In some embodiments, the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] has only one bit with a value of 1, that is, l i =1(0≤i≤m-1), T'=[2 i*s ]P, T"=-[2 i*s ]P;s represents the segment length.
[0058] In some embodiments, the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] when two or more bits have the value 1, that is, l i(0) =…=l i(x-1) =l i(x) =1(0≤i(0)<… <i(x-1)<i(x)≤m-1),T’=[2 i(x)*s-1 ]P, T” = [2i(0)*s ]P+…+[2 i(x-1)*s ]P;s represents the segment length.
[0059] Step S12: Determine whether the last loop can still be decomposed by point operation based on the value of each bit in the scalar bit group corresponding to the last loop in the scalar multiplication calculation process, and if it is determined that the last loop cannot be decomposed by point operation, preprocess the scalar bit group corresponding to the last loop so that the last loop can be decomposed by point operation.
[0060] In the embodiment of the present disclosure, if the values of all bits of the scalar bit group corresponding to the last cycle are 0, point operation decomposition cannot be performed. This can be solved by preprocessing the scalar.
[0061] In the embodiment of the present disclosure, considering that the scalar average decomposition method scans the scalar bit group from high bit to low bit, the following judgment can be made: if the value of the lowest bit of the scalar is 1, then the value of at least one bit in the scalar bit group corresponding to the last cycle is 1, and it is determined that there is no need to perform point operation decomposition; according to the value of the lowest bit of an even number is 0, the value of the lowest bit of an odd number is 1, if the value of the lowest bit of the scalar is 0, then by adding 1 to the scalar k, the scalar k'=k+1 is obtained to ensure that the value of at least one bit in the scalar bit group corresponding to the last cycle is 1, and after completing all operations, the final result is subtracted from point P to obtain the correct result.
[0062] In some embodiments, based on the fact that the lowest bit of an even number is 0 and the lowest bit of an odd number is 1, the method further comprises making the calculation process independent of the parity of the scalar by performing the following steps: if the lowest bit of the scalar is 1, then subtract 2 from the scalar k. s Get the scalar k'=k-2 s , and add the point [2 s ]P will get the correct result. This makes it so that no matter whether the scalar is odd or even, the operations in all loops are the same, that is, each loop includes a dot addition operation and a dot doubling operation, and after completing all loop operations, a dot addition operation will be performed to get the correct result; in other words, when k is an even number, k+1 is processed, and when k is an odd number, k-2 is processed. s This processing method ensures that no matter whether k is an odd number or an even number, a point addition operation is always required to restore the result.
[0063] To facilitate understanding, the following example uses the scalar k divided into four segments as an example to provide an implementation example of the improved scalar average decomposition method (for other segmentation situations, the implementation method without branch differences (differences in computing time and power consumption) can also be given by referring to Algorithm 3).
[0064] In this document, a repeatedly executed step is referred to as a loop, for example, steps 4.1 to 4.2 are repeatedly executed in Algorithms 1 and 2, and steps 6.1 to 6.2 are repeatedly executed in Algorithm 3.
[0065] Table 1 below shows the points T' and T" used in the improved scalar average decomposition method when the scalar is divided into 4 segments.
[0066] Table 1: Points T' and T" used by the improved scalar average decomposition method when the scalar is divided into 4 segments
[0067] By using the ECC anti-attack method for automotive safety chips provided by the embodiments of the present disclosure, the high efficiency of the scalar average decomposition method for ECC implementation is maintained, while simultaneously resisting SPA attacks and safe-error fault injection attacks. In addition, it can also support engineering to achieve a high circuit fault detection rate by checking the correctness of the final execution results, so as to meet the requirements of the ISO26262 functional safety standard for automotive chips.
[0068] Table 2 below shows a comparison between the embodiment of the present disclosure and the traditional method. As shown in Table 2, in the scalar multiplication operation, the scalar length is t, the number of segments is r, the doubling operation amount is PD, and the dot addition operation amount is PA.
[0069] Table 2: Comparison between the present disclosure and traditional methods
[0070] The comparison in Table 2 shows that the implementation method disclosed herein can address the vulnerability of traditional algorithms to SPA attacks. Based on the commonly used prime-domain 256-bit elliptic curve, the increased computation time and storage requirements for a four-segment key (scalar) are shown in Table 3. This significantly improves security while minimizing the increase in computation time and pre-storage requirements, and the increased storage requirements are also sufficient to cover the internal memory resources of automotive chips.
[0071] Table 3: Comparison between the improved algorithm disclosed in this paper and the traditional algorithm under the prime field 256-bit elliptic curve
[0072] 2 shows a schematic diagram of the structure of an ECC attack resistance device for automotive safety chips in an embodiment of the present disclosure. The ECC attack resistance device 200 in the embodiment of the present disclosure mainly includes a point operation decomposition module 201 and a scalar preprocessing module 202.
[0073] The point operation decomposition module 201 is used to, in the process of calculating scalar multiplication using the scalar average decomposition method, when the values of all bits in the scalar bit group corresponding to the current cycle are 0, decompose the next cycle into point operations based on the principle that the final calculation result remains unchanged, so as to obtain the first point operation part decomposed into the current cycle and the second point operation part decomposed into the next cycle.
[0074] In some examples, the point operation decomposition module 201 decomposes the point operation of the next cycle based on the principle that the final calculation result remains unchanged, including: denoting the points accumulated in the next cycle before decomposition as T, the first point operation part after decomposition as T', and the second point operation part after decomposition as T"; by performing point operation decomposition on the accumulated point T, T, T', and T" satisfy the following formula: [2] T'+T"=T.
[0075] In some examples, performing point operation decomposition on the accumulated point T includes: when the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] are all 0, the accumulated point T is disassembled into the first point operation part of the current cycle: T'=[2 s-1 ]P, the accumulated point T is disassembled into the second point operation part of the next cycle: T" = -[2 s ]P; wherein m represents the number of segments into which the scalar is divided in the scalar average decomposition method, s represents the length of the segment, and P represents any point on the elliptic curve.
[0076] In some examples, performing point operation decomposition on the accumulated point T includes: when the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] has only one bit l i When the value of is 1, the accumulated point T is decomposed into the first point operation part of the current loop: T'=[2 i*s ]P, the accumulated point T is disassembled into the second point operation part of the next cycle: T" = -[2 i*s ]P; wherein, m represents the number of segments into which the scalar is divided in the scalar average decomposition method, 0≤i≤m-1, P represents any point on the elliptic curve, and s represents the length of the segment.
[0077] In some examples, the decomposition of the accumulated point T by point operations includes: when two or more bits in the scalar bit group [l m-1 , …, l1, l0] corresponding to the next loop have a value of 1, and l i(0) = … = l i(x-1) = l i(x) = 1, the accumulated point is decomposed into the first point operation part of the current loop as: T’ = [2 i(x)*s-1 P, and the accumulated point is decomposed into the second point operation part of the next loop as: T” = [2 i(0)*s ·P + … + [2 i(x-1)*s P; where m represents the number of segments into which the scalar is divided in the scalar average decomposition method, 0 ≤ i(0) < … < i(x - 1) < i(x) ≤ m - 1, P represents any point on the elliptic curve, and s represents the length of the segment.
[0078] The scalar preprocessing module 202 is used to determine whether the last loop in the scalar multiplication calculation process can still perform point operation decomposition according to the value of each bit in the scalar bit group corresponding to the last loop, and preprocess the scalar bit group corresponding to the last loop when it is determined that the last loop cannot perform point operation decomposition, so that the last loop can perform point operation decomposition.
[0079] In some examples, the scalar preprocessing module 202 preprocesses the scalar bit group corresponding to the last loop so that the last loop can perform point operation decomposition, including: if the value of the lowest bit of the scalar is 1, and at least one bit in the scalar bit group corresponding to the last loop has a value of 1, it is determined that there is no need to perform point operation decomposition; if the value of the lowest bit of the scalar is 0, the scalar k is incremented by 1 to obtain the scalar k’ = k + 1 to ensure that at least one bit in the last loop has a value of 1, and after all operations are completed, the final calculation result is subtracted by the point P to correct the deviation of the calculation result caused by the preprocessing of the scalar, where P represents any point on the elliptic curve.
[0080] Further, the scalar preprocessing module 202 performs the following steps to make the scalar multiplication calculation process independent of the parity of the scalar: if the value of the lowest bit of the scalar is 1, the scalar k is subtracted by 2 s to obtain the scalar k’ = k - 2 s , and after all operations are completed, the final calculation result is added by the point [2 s P to correct the deviation of the calculation result caused by the preprocessing of the scalar, where P represents any point on the elliptic curve.
[0081] It should be noted that the ECC anti-attack device for automotive safety chips provided in the above embodiment is only illustrated by the division of the above-mentioned program modules when performing ECC anti-attack for automotive safety chips. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the ECC anti-attack device for automotive safety chips provided in the above embodiment and the ECC anti-attack method embodiment for automotive safety chips are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0082] As shown in Figure 3, a schematic diagram of the structure of an automotive safety chip in an embodiment of the present disclosure is shown. An optional hardware structure diagram of the automotive safety chip 300 in an embodiment of the present disclosure is shown in Figure 3, which includes: at least one processor 301, a memory 302, at least one network interface 304, and a user interface 306. The various components in the device are coupled together via a bus system 305. It will be understood that the bus system 305 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 305 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the various buses are labeled as bus systems in Figure 3.
[0083] The user interface 306 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.
[0084] It will be appreciated that the memory 302 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM) or a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memory described in the embodiments of the present disclosure is intended to include, but is not limited to, these and any other suitable categories of memory.
[0085] The memory 302 in the embodiment of the present disclosure is used to store various categories of data to support the operation of the ECC anti-attack terminal 300 applicable to the automotive safety chip. Examples of these data include: any executable program for operating on the ECC anti-attack terminal 300 applicable to the automotive safety chip, such as an operating system 3021 and an application 3022; the operating system 3021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 3022 can include various applications, such as a media player (MediaPlayer), a browser (Browser), etc., for implementing various application services. The ECC anti-attack method for automotive safety chips provided by the embodiment of the present disclosure can be included in the application 3022.
[0086] The method disclosed in the above-mentioned embodiment of the present disclosure can be applied to the processor 301 or implemented by the processor 301. The processor 301 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above-mentioned method can be completed by the hardware integrated logic circuit in the processor 301 or by instructions in the form of software. The above-mentioned processor 301 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 301 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present disclosure. The general-purpose processor 301 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in conjunction with the embodiment of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory. The processor reads the information in the memory and completes the steps of the above-mentioned method in combination with its hardware.
[0087] In an exemplary embodiment, the ECC anti-attack terminal 300 suitable for an automotive safety chip can be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), and complex programmable logic devices (CPLDs) to execute the aforementioned method.
[0088] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with a computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0089] In the embodiments provided by the present disclosure, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a magnetic disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store desired program code in the form of instructions or data structures and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, server or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
[0090] In summary, the present disclosure provides an ECC anti-attack method, device, terminal and medium applicable to automotive safety chips. The present disclosure adjusts the accumulated points in the scalar average decomposition method so that the calculation operations in each cycle are the same, that is, each cycle performs doubling operations and point addition operations. In this way, the differences in branch operation time and power consumption between each cycle in the calculation process can be eliminated, making it impossible to identify sensitive information through power consumption attacks. At the same time, it also avoids the problem of failing to meet the high fault detection rate required by the ISO 26262 functional safety standard for automotive chips due to the use of false operations. With a smaller amount of calculation and pre-stored points, the present disclosure can achieve the beneficial effects described above. Therefore, the present disclosure effectively overcomes the various shortcomings of the existing technology and has a high industrial utilization value.
[0091] The above embodiments are merely illustrative of the principles and effects of this disclosure and are not intended to limit this disclosure. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this disclosure. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed herein shall be covered by the claims of this disclosure.
Claims
1. An ECC anti-attack method applicable to automotive safety chips, comprising: In the process of calculating scalar multiplication using the scalar average decomposition method, when the values of all bits in the scalar bit group corresponding to the current loop are 0, the next loop is decomposed by point operation based on the principle that the final calculation result remains unchanged, so as to obtain the first point operation part decomposed into the current loop and the second point operation part decomposed into the next loop.
2. The ECC anti-attack method for automotive safety chips according to claim 1, characterized in that: The method further comprises: According to the value of each bit in the scalar bit group corresponding to the last cycle in the scalar multiplication calculation process, determine whether the last cycle can still perform point operation decomposition, and When it is determined that the last loop cannot be decomposed by point operation, the scalar bit group corresponding to the last loop is preprocessed so that the last loop can be decomposed by point operation.
3. The ECC anti-attack method for automotive safety chips according to claim 1, characterized in that: The point operation decomposition of the next cycle based on the principle that the final calculation result remains unchanged includes: The accumulated points of the next cycle before decomposition are recorded as T, the first point operation part after decomposition is recorded as T', and the second point operation part after decomposition is recorded as T". By performing point operation decomposition on the accumulated point T, T, T', and T" satisfy the following formula: [2]T'+T"=T.
4. The ECC anti-attack method for automotive safety chips according to claim 3, characterized in that: The step of performing point operation decomposition on the accumulated points T includes: When the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] are all 0, the accumulated point T is decomposed into the first point operation part of the current loop: T’=[2 s-1 ]P, The accumulated point T is disassembled into the second point operation part of the next cycle as follows: T”=-[2 s ]P; Wherein, m represents the number of segments into which the scalar is divided in the scalar average decomposition method, s represents the length of the segment, P represents any point on the elliptic curve.
5. The ECC anti-attack method for automotive safety chips according to claim 3, characterized in that: The step of performing point operation decomposition on the accumulated points T includes: When the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0] has only one bit l i The value of When , the accumulated point T is decomposed into the first point operation part of the current loop: T’=[2 i*s ]P, The accumulated point T is disassembled into the second point operation part of the next cycle as follows: T”=-[2 i*s ]P; Wherein, m represents the number of segments into which the scalar is divided in the scalar average decomposition method, 0≤i≤m-1, P represents any point on the elliptic curve. s represents the length of the segment.
6. The ECC anti-attack method for automotive safety chips according to claim 3, characterized in that: The step of performing point operation decomposition on the accumulated points T includes: When the scalar bit group corresponding to the next cycle [l m-1 ,…,l1,l0], two or more bits have the value 1, l i(0) =…=l i(x-1) = l i(x) =1, the accumulated points are decomposed into the first point operation part of the current loop: T’=[2 i(x)*s-1 ]P, The accumulated points are broken down into the second point calculation part of the next cycle: T”=[2 i(0)*s ] · P+…+[2 i(x-1)*s ]P; Wherein, m represents the number of segments into which the scalar is divided in the scalar average decomposition method, 0≤i(0)<… <i(x-1)<i(x)≤m-1, P represents any point on the elliptic curve. s represents the length of the segment.
7. The ECC anti-attack method for automotive safety chips according to claim 2, characterized in that: The preprocessing of the scalar bit group corresponding to the last cycle so that the last cycle can be decomposed by point operation includes: If the value of the lowest bit of the scalar is 1, then the value of at least one bit in the scalar bit group corresponding to the last cycle is 1, and it is determined that there is no need to perform point operation decomposition; If the value of the lowest bit of the scalar is 0, the scalar k is obtained by adding 1 to the scalar k to ensure that the value of at least one bit in the last cycle is 1, and after completing all operations, the final calculation result is subtracted from point P to correct the calculation result deviation caused by the scalar preprocessing, where P represents any point on the elliptic curve.
8. The ECC anti-attack method for automotive safety chips according to claim 1 or 6, characterized in that: The method further comprises: if the value of the lowest bit of the scalar is 1, subtracting 2 from the scalar k s We get the scalar k'=k-2 s , and after completing all operations, add the point [2 s ]P is used to correct the deviation of the calculation result caused by the preprocessing of the scalar, so that the process of calculating the scalar multiplication is independent of the parity of the scalar, where P represents any point on the elliptic curve.
9. The ECC anti-attack method for automotive safety chips according to claim 2, characterized in that: In the case [2]T'+T"=T, the final calculation result remains unchanged.
10. The ECC anti-attack method for automotive safety chips according to claim 1, characterized in that: The method further includes: based on the scalar average decomposition method, dividing the scalar into m segments on average, wherein the length of each segment is represented by s, and m and s are both integers.
11. The ECC anti-attack method for automotive safety chips according to claim 10, characterized in that: Before evenly dividing the scalar into m segments, the method further comprises pre-calculating points on the elliptic curve.
12. An ECC anti-attack device suitable for an automotive safety chip, comprising: A point operation decomposition module is used to, in the process of calculating scalar multiplication using the scalar average decomposition method, when the values of all bits in the scalar bit group corresponding to the current cycle are 0, decompose the next cycle by point operation based on the principle that the final calculation result remains unchanged, so as to obtain a first point operation part decomposed into the current cycle and a second point operation part decomposed into the next cycle.
13. The ECC anti-attack device for automotive safety chip according to claim 12, characterized in that: Also includes: A scalar preprocessing module is used to determine whether the last loop in the scalar multiplication calculation process can still perform point operation decomposition based on the value of each bit in the scalar bit group corresponding to the last loop, and if it is determined that the last loop cannot perform point operation decomposition, preprocess the scalar bit group corresponding to the last loop so that the last loop can perform point operation decomposition.
14. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the ECC anti-attack method applicable to an automotive safety chip as claimed in any one of claims 1 to 11 is implemented.
15. An automotive safety chip, comprising: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the terminal executes the ECC anti-attack method applicable to an automotive safety chip as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Realization method of elliptic curve cryptosystem for preventing side-channel attack
CN101562522A
Method and apparatus for parallel scalar multiplication
US20160149704A1
