A method and apparatus for protecting against side channels in ml-kem unencapsulation
By using high-order mask decomposition and angle mapping of sensitive variables, trigonometric function combination operations, combined with security mask circuits and hash commitment verification, the side-channel leakage problem in the depackaging stage of ML-KEM hardware is solved, achieving a highly efficient protection effect, which is suitable for high-security quantum-resistant chips.
Patent Information
- Application Number
- CN202611361531.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-06
AI Technical Summary
Existing ML-KEM hardware implementations suffer from leakage issues due to high-order side-channel attacks during the decapsulation stage. In particular, during the decompression and decryption consistency verification process, traditional Boolean mask protection methods are easily bypassed and cannot effectively resist complex combined high-order attacks.
By employing high-order mask decomposition of sensitive variables, angle mapping, and trigonometric function combination operations, combined with a secure mask multiplication circuit and a random refresh mechanism, the arithmetic operations are converted into a fixed structure. Furthermore, a decryption consistency verification mechanism using hash commitment values and unconditional branches is introduced to avoid explicit reconstruction of sensitive data and control flow leakage.
It improves the hardware circuit's resistance to side-channel attacks, reduces hardware implementation complexity, and achieves lightweight and highly secure depackaging protection, making it suitable for high-security quantum-resistant chips.
Smart Images

Figure CN123055260A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hardware circuit information security technology, and in particular to an ML-KEM decapsulation side-channel protection method and apparatus. Background Technology
[0002] With the rapid development of quantum computing technology and the increasing maturity of large number prime factorization algorithms (such as Shor's algorithm), traditional encryption algorithms based on public-key cryptosystems (such as RSA and ECC) face a serious threat of being completely cracked. To address this challenge, post-quantum cryptography (PQC) has gradually become a research hotspot in recent years. In August 2024, the National Institute of Standards and Technology (NIST) officially released the first batch of PQC standards, among which the ML-KEM algorithm based on modular lattice theory was officially standardized as the only asymmetric key encapsulation mechanism standard due to its extremely high operating efficiency, provable security, and hardware-friendly design.
[0003] However, theoretical security is not equivalent to the security of actual hardware circuits during operation. Cryptographic chips are the hardware carriers of cryptographic algorithms. Side-channel attacks (SCA) exploit the leakage of physical information (such as energy consumption, electromagnetic radiation, and execution timing) generated when the algorithm operates in the hardware device to obtain sensitive key values processed internally by the chip. Since its inception, side-channel attacks have evolved from traditional single-point leakage analysis to complex, combined high-order attack analysis techniques involving multiple time or spatial points (such as high-order differential energy analysis, high-order correlation energy analysis, and template attacks), making single-order Boolean mask protection methods extremely easy for attackers to bypass.
[0004] In the decapsulation stage of ML-KEM hardware implementation, the decompression operation during message decoding and the decryption consistency verification (CCA) are the two core modules most severely affected by side-channel leakage. Traditional decompression and bit-by-bit ciphertext comparison operations heavily involve nonlinear mappings and conditional branching logic. In hardware physical layer implementation, conditional branching can easily lead to significant divergences in power consumption or timing behavior dependent on sensitive data, thus providing obvious leakage points for attackers. Existing lattice cipher masking schemes are often limited by excessively high domain transformation overhead (such as frequent A2B / B2A arithmetic Boolean conversions), drastic hardware area expansion, or inflexibility in scaling to arbitrary higher orders. Therefore, it is necessary to propose a high-order masking protection implementation method for ML-KEM decapsulation that is resistant to high-order side-channel attacks, has efficient hardware implementation, and supports general high-order extensions, to meet the deployment requirements of next-generation high-security quantum-resistant chips. Summary of the Invention
[0005] The present invention aims to at least partially solve one of the technical problems in the related art.
[0006] The main objective of this invention is to provide a side-channel protection method for ML-KEM decapsulation.
[0007] Another objective of this invention is to provide an ML-KEM decapsulation side-channel protection device.
[0008] To achieve the above objectives, a first aspect of the present invention proposes an ML-KEM decapsulation side-channel protection method, comprising: S1. Divide the sensitive variables in the message decoding stage of the ML-KEM decapsulation process into multiple random mask sharing values, and each of the mask sharing values satisfies the modulo addition relationship over a finite field; S2. Map each of the mask sharing values to the corresponding angles, and obtain the corresponding sine and cosine components according to each angle. S3. Using trigonometric functions and angle formulas, perform step-by-step combination operations on each of the sine and cosine components. During the combination process, use a security mask multiplication circuit and a security mask addition circuit to complete the calculation. After each level of combination, perform a random refresh operation until the overall angle cosine value corresponding to all mask sharing values is obtained. Complete message decoding based on the sign of the overall angle cosine value. S4. Calculate the hash commitment value for the original ciphertext and the candidate ciphertext obtained by re-encryption, respectively, and calculate the corresponding message authentication code based on the hash commitment value. Generate a consistency verification constraint flag based on the hash commitment value and the message authentication code. S5. Output the shared key using an arithmetic selection method with unconditional branching based on the consistency verification constraint flag.
[0009] Optionally, in step S1, the sensitive variable is set as follows: It is divided into n independent and uniformly distributed random sharing values. , ... ,satisfy:
[0010] Where q is the finite field modulus used in the ML-KEM algorithm, n=d+1, and d is the mask protection order.
[0011] Optionally, in step S2, each mask sharing value is determined according to... Complete the angle mapping and use the corresponding angle as the input address in the lookup table to obtain the sine and cosine components.
[0012] Optionally, the lookup table output uses signed fixed-point number representation, and each mask sharing value independently accesses the lookup table to obtain the corresponding sine and cosine components respectively.
[0013] Optionally, in step S3, adjacent sets of sine and cosine components are combined according to trigonometric functions and angle formulas. The combination operation is completed step by step using a binary tree structure or a serial pipeline structure until the overall angle cosine value corresponding to all mask sharing values is obtained.
[0014] Optionally, the multiplication in the combination operation is implemented using a secure mask multiplication circuit, and the addition is implemented using a secure mask addition circuit. After each level of combination is completed, a random refresh circuit is called to re-inject random numbers into the intermediate results after combination, so as to maintain the statistical independence between the shared values of each mask.
[0015] Optionally, the lookup table output uses a 12-bit signed fixed-point number representation, where the highest bit is the sign bit and the remaining bits are the value bits; after the fixed-point multiplication operation is completed, it is right-shifted by a predetermined number of bits to restore the data format to the corresponding bit width.
[0016] Optionally, in step S4, the hash commitment values corresponding to the original ciphertext and the candidate ciphertext are calculated respectively, and the implicit rejection seed in the ML-KEM decapsulation process is used as the message authentication code key. The corresponding message authentication code is calculated for each hash commitment value, and the consistency verification constraint flag is generated based on the comparison result of the hash commitment value and the comparison result of the message authentication code.
[0017] Optionally, in step S5, the shared key is selected using the following arithmetic method:
[0018] Where cond is the consistency verification constraint flag. Candidate shared key, This is an alternative shared key generated based on the implicit rejection seed.
[0019] To achieve the above objectives, a second aspect of the present invention provides an ML-KEM decapsulation side-channel protection device, comprising: The first module is used to divide the sensitive variables in the message decoding stage of the ML-KEM decapsulation process into multiple random mask sharing values, and each of the mask sharing values satisfies a modulo-addition relationship over a finite field; The second module is used to map each of the mask sharing values to a corresponding angle, and to obtain the corresponding sine and cosine components according to each angle. The third module is used to perform a step-by-step combination operation on each of the sine and cosine components using trigonometric functions and angle formulas. During the combination process, a security mask multiplication circuit and a security mask addition circuit are used to complete the calculation. After each level of combination, a random refresh operation is performed until the overall angle cosine value corresponding to all mask sharing values is obtained. The message decoding is completed according to the sign of the overall angle cosine value. The fourth module is used to calculate the hash commitment value for the original ciphertext and the candidate ciphertext obtained by re-encryption, respectively, calculate the corresponding message authentication code based on the hash commitment value, and generate a consistency verification constraint flag based on the hash commitment value and the message authentication code. The fifth module is used to output the shared key using an unconditional branching arithmetic selection method based on the consistency verification constraint flag.
[0020] The embodiments of the present invention have the following beneficial effects: This invention performs high-order mask decomposition on sensitive variables during the ML-KEM decapsulation process and uses angle mapping and trigonometric function combination operations to achieve nonlinear message decoding in the mask domain. This avoids explicit reconstruction of sensitive data during the calculation process and improves the hardware circuit's resistance to side-channel attacks such as power consumption and electromagnetic interference.
[0021] This invention combines security masking operations, random refresh mechanisms, and unconditional branch consistency verification structures to transform the nonlinear decoding and ciphertext comparison operations in the traditional decapsulation process into fixed-structure arithmetic operations, thereby reducing the risk of control flow and intermediate data leakage, while also reducing hardware implementation complexity.
[0022] This invention solves the problems of difficulty in performing high-order mask protection during the decoding process and side-channel leakage in the consistency verification in the existing ML-KEM hardware implementation, and realizes a decapsulation protection scheme suitable for lightweight and high-security hardware platforms. Attached Figure Description
[0023] The above-described and additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which: Figure 1 A flowchart of an ML-KEM decapsulation side-channel protection method provided in an embodiment of the present invention. Detailed Implementation
[0024] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] The following description, with reference to the accompanying drawings, describes an ML-KEM decapsulation side-channel protection method and apparatus according to an embodiment of the present invention.
[0027] Example 1 This embodiment provides a side-channel protection method for ML-KEM decapsulation, proposing an ML-KEM decapsulation circuit protection structure with full-process high-order mask coverage, unconditional branch leakage, and extreme suitability for lightweight / high-throughput hardware implementation. For example... Figure 1 As shown, it includes the following steps: S1. Divide the sensitive variables in the message decoding stage of the ML-KEM decapsulation process into multiple random mask sharing values, and each of the mask sharing values satisfies the modulo addition relationship over a finite field; S2. Map each of the mask sharing values to the corresponding angles, and obtain the corresponding sine and cosine components according to each angle. S3. Using trigonometric functions and angle formulas, perform step-by-step combination operations on each of the sine and cosine components. During the combination process, use a security mask multiplication circuit and a security mask addition circuit to complete the calculation. After each level of combination, perform a random refresh operation until the overall angle cosine value corresponding to all mask sharing values is obtained. Complete message decoding based on the sign of the overall angle cosine value. S4. Calculate the hash commitment value for the original ciphertext and the candidate ciphertext obtained by re-encryption, respectively, and calculate the corresponding message authentication code based on the hash commitment value. Generate a consistency verification constraint flag based on the hash commitment value and the message authentication code. S5. Output the shared key using an arithmetic selection method with unconditional branching based on the consistency verification constraint flag.
[0028] This invention mainly includes the following two core protection strategies: a general high-order mask decoding architecture based on trigonometric function angle combination and a decryption consistency verification mechanism based on zero-knowledge proof and hash commitment, which are implemented through steps S1-S3 and S4-S5 respectively.
[0029] The proposed solution in this application will be described in detail below with reference to detailed embodiments.
[0030] 1. A general high-order mask decoding architecture based on trigonometric function angle combinations.
[0031] In the message decoding stage of the ML-KEM algorithm, since the decompression function is essentially a piecewise nonlinear mapping (i.e., implicitly involving interval comparison and rounding), it cannot be directly linearly allocated in the traditional arithmetic mask domain. This invention innovatively proposes an angle mask transformation method based on the periodic characteristics of trigonometric functions (i.e., steps S1, S2, and S3), seamlessly transforming the algebraic superposition of the sensitive data domain into an iterative combination of angles in the nonlinear transcendental function domain. The overall structure avoids explicit reconstruction of the shared values of the sensitive data during the calculation process, severing the energy / electromagnetic side-channel dependency in the intermediate process.
[0032] Specifically, in one embodiment of the present invention, taking a variable r (such as a sensitive intermediate result dependent on the private key) as an example, the high-order masking protection technique splits it into n independent and uniformly distributed random shared values (i.e., protection order d = n - 1), satisfying:
[0033] Where q = 3329 is the prime modulus of the standard ML-KEM algorithm.
[0034] What is understandable is that in the decoding judgment function In the finite ring Periodic behavior and cosine function exist The positive and negative changes on the graph highly overlap, satisfying the following condition:
[0035] The angular relationship satisfies .
[0036] Based on this, in one embodiment of the present invention, the specific implementation unit of the higher-order mask triangulation is as follows: (1) Angle Mapping and Signed 12-bit Fixed-Point Quantization Lookup Table: To eliminate the huge overhead of real-time calculation of trigonometric function transcendental terms in hardware, and to avoid complex floating-point operations in hardware to reduce resource consumption, this application embodiment pre-constructs a signed fixed-point quantization trigonometric function lookup table with 12-bit precision. Each input mask shares a value. The sine and cosine quantized output components are obtained in parallel by inputting each component into a lookup table independently as an address. and ,in Since the output value of the table lookup process also maintains a Boolean mask state, this embodiment of the application adopts a dual-track pipelined access mode to interleave dummy addresses, thereby ensuring that the Hamming weight switching at the hardware level is constant and eliminating the leakage of address line information at the microarchitecture level.
[0037] (2) Nonlinear angle iterative combination circuit: After obtaining the fixed-point sine and cosine components of each individual shared value, the circuit does not... Instead of performing addition and reconstruction, it directly calls the triangular identity logic of sum-to-product to perform pairwise combinations:
[0038]
[0039] In one embodiment of the invention, all paired multiplication operations are performed using masked multipliers based on refresh gadgets (such as ISW-style secure multiplication circuits), and addition uses secure masked addition circuits. Due to the comprehensive adoption of signed 12-bit fixed-point quantization data format, both underlying multiplication and addition operations can be efficiently completed within basic integer fixed-point logic gates, greatly simplifying hardware overhead and increasing clock frequency. After completing one pairing, the intermediate calculated values are processed using a random refresh gadget based on the t-SNI standard, injecting new random numbers to maintain independence. Through this binary tree or serial pipeline iterative reduction method, a combined result from all angles is finally obtained.
[0040] It should be noted that during hardware implementation, the floating-point unit (FPU) consumes a significant amount of lookup table (LUT) resources and introduces uncontrollable timing delays. This invention quantizes the real values of sine and cosine within the interval [-1, 1] into a unified 12-bit signed fixed-point integer format. The quantization transformation relationship is as follows:
[0041] The highest bit is the sign bit, and the remaining 11 bits are the value bits. The range of the quantized integer is: After the trigonometric identity combination multiplication between fixed-point numbers is performed, the data is shifted 11 bits to the right and truncated to maintain the consistency of the sign and bit width of the data format.
[0042] Furthermore, since the ML-KEM decoding decision in this invention depends only on the full-angle cosine combination result... The sign of the integer part is determined by the cumulative approximation error caused by fixed-point quantization. The absolute correctness of the algorithm can be guaranteed if the sign is not flipped.
[0043] It should be noted that the maximum fault tolerance boundary (i.e., the critical margin determining sign flipping) of the ML-KEM algorithm itself on finite rings is known to be... Let the upper limit of the rounding error caused by fixed-point quantization of a single shared value be... After the n mask shares are iteratively merged using the sum-to-product formula, according to the multivariable Taylor expansion and total differential error propagation theory, the total cumulative approximation error is... The following bounded relation is satisfied:
[0044] Because for any angle All have Therefore, the total accumulated error can be further scaled and constrained as follows:
[0045] In mainstream hardware deployment scenarios, the mask shard number n is typically less than 8 (e.g., n = 3 when d = 2 protection). Substituting the data, we can calculate:
[0046] The fault tolerance boundary of the ML-KEM algorithm itself is:
[0047] The proof results show that, under 12-bit signed fixed-point quantization precision, after merging n shares, the total cumulative error is... It is still strictly smaller than the fault tolerance boundary of the ML-KEM algorithm itself. This mathematically ensures that fixed-point numerical approximation does not introduce any additional decoding errors, making the system's decryption failure rate (DFR) completely equivalent to the theoretical limit of the publicly released FIPS 203 standard, achieving the best synergy between computational accuracy and side-channel hardware protection efficiency.
[0048] 2. Decryption consistency verification mechanism based on zero-knowledge proof and hash commitment.
[0049] In the secure transformation of ML-KEM against selected ciphertext attacks (IND-CCA2), traditional solutions compare the original ciphertext c with the re-encryption candidate ciphertext c' by directly using the if c != c' conditional branch instruction in the hardware circuit. This type of design is highly vulnerable to high-order correlation power attacks and template attacks, as the power consumption step during the first misaligned byte can easily leak the private key or sensitive ciphertext bit-level information.
[0050] This invention introduces the idea of non-interactive zero-knowledge proof, replacing the specific ciphertext byte-by-byte explicit comparison logic with a fixed-length hash commitment and a message authentication code (MAC) dual equality constraint judgment. The circuit does not need to directly use the ciphertext string or reconstruct the plaintext to close the entire verification process (i.e. steps S4 and S5).
[0051] The specific logic flow is as follows: (1) Dual commitment calculation: During the ML-KEM decapsulation process, this embodiment of the invention first calculates the commitment hash of the original ciphertext c using a hardware constant-time hash module. and the commitment hash of the candidate ciphertext c' generated by re-encryption To completely eliminate the risk of extreme collisions that may arise from hashing, a layer of signature protection based on Message Authentication Code (MAC) is introduced. This invention innovatively reuses the 32-byte implicit rejection seed Z from the private key decapsulated within ML-KEM as the physical key for the MAC. Calculate the corresponding encrypted authentication tag:
[0052]
[0053] This reuse technology ensures that MAC signatures have extremely high randomness and unpredictability, while eliminating the need for additional random number generation logic and improving hardware simplification.
[0054] (2) Branchless logic / arithmetic joint key selection circuit: After obtaining the commitment result, the verification circuit pulls up two linear energy determination signals in parallel:
[0055]
[0056] The overall consistency verification constraint flags are then generated. .
[0057] Ultimately, the selection of the shared key utilizes hardware multiplexing-based arithmetic logic closure, namely:
[0058] in These are candidate keys obtained from normal repackaging and decryption. This is a random substitution key generated under the implicit rejection path. Because this equality constraint architecture is completely transformed into low-level multiply-accumulate arithmetic gates, it completely eliminates control flow branch jumps in the hardware, exponentially increasing the complexity for attackers to build side-channel characteristic waveform templates.
[0059] Example 2 This invention also provides an ML-KEM decapsulation side-channel protection device, comprising: The first module is used to divide the sensitive variables in the message decoding stage of the ML-KEM decapsulation process into multiple random mask sharing values, and each of the mask sharing values satisfies a modulo-addition relationship over a finite field; The second module is used to map each of the mask sharing values to a corresponding angle, and to obtain the corresponding sine and cosine components according to each angle. The third module is used to perform a step-by-step combination operation on each of the sine and cosine components using trigonometric functions and angle formulas. During the combination process, a security mask multiplication circuit and a security mask addition circuit are used to complete the calculation. After each level of combination, a random refresh operation is performed until the overall angle cosine value corresponding to all mask sharing values is obtained. The message decoding is completed according to the sign of the overall angle cosine value. The fourth module is used to calculate the hash commitment value for the original ciphertext and the candidate ciphertext obtained by re-encryption, respectively, calculate the corresponding message authentication code based on the hash commitment value, and generate a consistency verification constraint flag based on the hash commitment value and the message authentication code. The fifth module is used to output the shared key using an unconditional branching arithmetic selection method based on the consistency verification constraint flag.
[0060] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0061] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0062] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
Claims
1. A side-channel protection method for ML-KEM decapsulation, characterized in that, Includes the following steps: S1. Divide the sensitive variables in the message decoding stage of the ML-KEM decapsulation process into multiple random mask sharing values, and each of the mask sharing values satisfies the modulo addition relationship over a finite field; S2. Map each of the mask sharing values to the corresponding angles, and obtain the corresponding sine and cosine components according to each angle. S3. Using trigonometric functions and angle formulas, perform step-by-step combination operations on each of the sine and cosine components. During the combination process, use a security mask multiplication circuit and a security mask addition circuit to complete the calculation. After each level of combination, perform a random refresh operation until the overall angle cosine value corresponding to all mask sharing values is obtained. Complete message decoding based on the sign of the overall angle cosine value. S4. Calculate the hash commitment value for the original ciphertext and the candidate ciphertext obtained by re-encryption, respectively, and calculate the corresponding message authentication code based on the hash commitment value. Generate a consistency verification constraint flag based on the hash commitment value and the message authentication code. S5. Output the shared key using an arithmetic selection method with unconditional branching based on the consistency verification constraint flag.
2. The ML-KEM decapsulation side-channel protection method according to claim 1, characterized in that, In step S1, the sensitive variable is set as follows: It is divided into n independent and uniformly distributed random sharing values. , ... ,satisfy: Where q is the finite field modulus used in the ML-KEM algorithm, n=d+1, and d is the mask protection order.
3. The ML-KEM decapsulation side-channel protection method according to claim 2, characterized in that, In step S2, each mask sharing value is according to Complete the angle mapping and use the corresponding angle as the input address in the lookup table to obtain the sine and cosine components.
4. The ML-KEM decapsulation side-channel protection method according to claim 3, characterized in that, The lookup table output uses signed fixed-point numbers, and each mask sharing value independently accesses the lookup table to obtain the corresponding sine and cosine components.
5. The ML-KEM decapsulation side-channel protection method according to claim 4, characterized in that, In step S3, adjacent sets of sine and cosine components are combined according to trigonometric functions and angle formulas. The combination operation is completed step by step using a binary tree structure or a serial pipeline structure until the overall angle cosine value corresponding to all mask sharing values is obtained.
6. The ML-KEM decapsulation side-channel protection method according to claim 5, characterized in that, The multiplication in the combined operation is implemented using a secure mask multiplication circuit, and the addition is implemented using a secure mask addition circuit. After each level of combination is completed, a random refresh circuit is called to re-inject random numbers into the intermediate results after combination, so as to maintain the statistical independence between the shared values of each mask.
7. The ML-KEM decapsulation side-channel protection method according to claim 6, characterized in that, The lookup table output uses a 12-bit signed fixed-point number representation, where the highest bit is the sign bit and the remaining bits are the numerical bits; after the fixed-point multiplication operation is completed, it is right-shifted by a predetermined number of bits to restore the data format to the corresponding bit width.
8. The ML-KEM decapsulation side-channel protection method according to claim 1, characterized in that, In step S4, the hash commitment values corresponding to the original ciphertext and the candidate ciphertext are calculated respectively, and the implicit rejection seed in the ML-KEM decapsulation process is used as the message authentication code key. The corresponding message authentication code is calculated for each hash commitment value, and the consistency verification constraint flag is generated based on the comparison result of the hash commitment value and the comparison result of the message authentication code.
9. The ML-KEM decapsulation side-channel protection method according to claim 8, characterized in that, In step S5, the shared key is selected according to the following arithmetic method: Where cond is the consistency verification constraint flag. Candidate shared key, This is an alternative shared key generated based on the implicit rejection seed.
10. An ML-KEM decapsulation side-channel protection device, characterized in that, include: The first module is used to divide the sensitive variables in the message decoding stage of the ML-KEM decapsulation process into multiple random mask sharing values, and each of the mask sharing values satisfies a modulo-addition relationship over a finite field; The second module is used to map each of the mask sharing values to a corresponding angle, and to obtain the corresponding sine and cosine components according to each angle. The third module is used to perform a step-by-step combination operation on each of the sine and cosine components using trigonometric functions and angle formulas. During the combination process, a security mask multiplication circuit and a security mask addition circuit are used to complete the calculation. After each level of combination, a random refresh operation is performed until the overall angle cosine value corresponding to all mask sharing values is obtained. The message decoding is completed according to the sign of the overall angle cosine value. The fourth module is used to calculate the hash commitment value for the original ciphertext and the candidate ciphertext obtained by re-encryption, respectively, calculate the corresponding message authentication code based on the hash commitment value, and generate a consistency verification constraint flag based on the hash commitment value and the message authentication code. The fifth module is used to output the shared key using an unconditional branching arithmetic selection method based on the consistency verification constraint flag.
