|
PQ-WB-KEM: White-Box ML-KEM-768 1.0
PQ-WB-KEM: Toward a White-Box Construction of ML-KEM-768 with Arithmetic Masking for M2M Communications - Mathematics (MDPI)
|
DCA attack simulation against unmasked and n-share masked ML-KEM. More...
Go to the source code of this file.
Namespaces | |
| namespace | dca_simulation |
Functions | |
| dca_simulation._bitrev7 (k) | |
| Bit-reversal of a 7-bit index (FIPS-203 NTT twiddle order). | |
| Tuple[float, int] | dca_simulation.dca_attack (np.ndarray traces, np.ndarray hypotheses) |
| Correlation-based DCA key-recovery attack. | |
| np.ndarray | dca_simulation.generate_secret_key () |
| Generate secret key via centered binomial distribution CBD(eta=2). | |
| np.ndarray | dca_simulation.hamming_weight (np.ndarray x) |
| Hamming weight of each element treated as a 12-bit value (q=3329). | |
| dca_simulation.main () | |
| Entry point; runs the suite and writes results/dca_simulation.json. | |
| np.ndarray | dca_simulation.ntt_forward (np.ndarray poly) |
| Forward NTT: coefficient domain to NTT domain (full-range image). | |
| np.ndarray | dca_simulation.ntt_secret () |
| Full-range NTT-domain secret shat = NTT(s), the operand the base multiply actually processes (coefficient-domain smallness does not carry into the NTT domain). | |
| float | dca_simulation.pearson_correlation (np.ndarray x, np.ndarray y) |
| Pearson correlation coefficient; 0.0 if either input has zero variance. | |
| Dict | dca_simulation.run_dca_simulation (int num_traces=10000, bool masked=True, int num_shares=3) |
| Run one DCA simulation and report correct-vs-random key correlation. | |
| Dict | dca_simulation.run_full_simulation (List[int] num_traces_list=[1000, 10000, 100000, 500000]) |
| Run the full DCA suite comparing masked vs unmasked implementations. | |
| np.ndarray | dca_simulation.simulate_masked_trace (np.ndarray secret, np.ndarray ciphertext, int num_shares=3) |
| Simulated power trace for n-share arithmetic-masked implementation. | |
| np.ndarray | dca_simulation.simulate_unmasked_trace (np.ndarray secret, np.ndarray ciphertext) |
| Simulated power trace for unmasked implementation. | |
Variables | |
| dca_simulation._ZP = np.zeros(256, dtype=np.int64) | |
| int | dca_simulation.ETA = 2 |
| int | dca_simulation.N = 256 |
| int | dca_simulation.Q = 3329 |
| int | dca_simulation.ZETA = 17 |
DCA attack simulation against unmasked and n-share masked ML-KEM.
Writes results/dca_simulation.json.
Example: from dca_simulation import run_dca_simulation results = run_dca_simulation(num_traces=10000, masked=True, num_shares=3)
results/dca_simulation.json - Differential computation analysis (DCA) resistance simulationDefinition in file dca_simulation.py.