|
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)
|
Functions | |
| assert_bijection (perm, label) | |
| Verify a table is a permutation of Z_q. | |
| log2_factorial (n) | |
| log2(n!) via lgamma, which stays finite where n! overflows. | |
| main () | |
| Measure the encoding layer as built by whitebox_encoded.build_encodings(), split measured from analytic, and write results/encoding_layer_entropy.json. | |
| measure_determinacy_degree (E, rng) | |
| Entry-determinacy degree of a Z_q bijection, measured by reconstruction. | |
| measure_omitted_entry_predictability (E, rng) | |
| Predictability of an omitted entry when q//2 entries of a bijection are retained, i.e. | |
| verify_inverses_derivable (E, Einv) | |
| Reconstruct every inverse from its forward permutation and compare. | |
Variables | |
| float | EXPECTED_ENTROPY_LOG2_BYTES = 20.06 |
| int | EXPECTED_INDEPENDENT = 256 |
| float | EXPECTED_OVERSTATEMENT = 3.12 |
| int | EXPECTED_STORED_BYTES = 3_408_896 |
| int | PRED_GUESSES_PER_TABLE = 1000 |
| int | SEED = 42 |
| encoding_layer_entropy.assert_bijection | ( | perm, | |
| label | |||
| ) |
Verify a table is a permutation of Z_q.
| perm | uint16 table of length q. |
| label | Identifier used in the failure message. |
Definition at line 94 of file encoding_layer_entropy.py.
Referenced by verify_inverses_derivable().
Here is the caller graph for this function:| encoding_layer_entropy.log2_factorial | ( | n | ) |
log2(n!) via lgamma, which stays finite where n! overflows.
| n | Non-negative integer. |
Definition at line 80 of file encoding_layer_entropy.py.
Referenced by main().
Here is the caller graph for this function:| encoding_layer_entropy.main | ( | void | ) |
Measure the encoding layer as built by whitebox_encoded.build_encodings(), split measured from analytic, and write results/encoding_layer_entropy.json.
Definition at line 259 of file encoding_layer_entropy.py.
References whitebox_encoded.build_encodings(), log2_factorial(), main(), measure_determinacy_degree(), measure_omitted_entry_predictability(), and verify_inverses_derivable().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| encoding_layer_entropy.measure_determinacy_degree | ( | E, | |
| rng | |||
| ) |
Entry-determinacy degree of a Z_q bijection, measured by reconstruction.
| E | Forward encodings, shape (components, 2, q). |
| rng | Seeded NumPy generator. |
Two probes bracket the degree. At q-1 retained entries the omitted one is forced: the residues consumed by the RETAINED entries leave exactly one unused, which must be the omitted image. At q-2 retained entries two residues remain for two omitted indices, so the best predictor is a coin flip. The table is therefore pinned at q-1 and not before: d = q-1. Both probes read only retained entries; the withheld image never enters the reconstruction.
Definition at line 196 of file encoding_layer_entropy.py.
Referenced by main().
Here is the caller graph for this function:| encoding_layer_entropy.measure_omitted_entry_predictability | ( | E, | |
| rng | |||
| ) |
Predictability of an omitted entry when q//2 entries of a bijection are retained, i.e.
the M < S_tbl/2 budget regime.
| E | Forward encodings, shape (components, 2, q); only forward tables are probed. |
| rng | Seeded NumPy generator. |
The strongest predictor is bijectivity-aware: an omitted entry must lie in the residues not consumed by the retained ones, so it guesses uniformly over that residual candidate set. Both the empirical hit rate and the mean candidate-set size are measured.
Definition at line 141 of file encoding_layer_entropy.py.
Referenced by main().
Here is the caller graph for this function:| encoding_layer_entropy.verify_inverses_derivable | ( | E, | |
| Einv | |||
| ) |
Reconstruct every inverse from its forward permutation and compare.
| E | Forward encodings, shape (components, 2, q). |
| Einv | Stored inverses, shape (components, 2, q). |
Derivability is what demotes the stored table count to the independent count: an inverse carries no key material of its own.
Definition at line 114 of file encoding_layer_entropy.py.
References assert_bijection().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| float encoding_layer_entropy.EXPECTED_ENTROPY_LOG2_BYTES = 20.06 |
Definition at line 76 of file encoding_layer_entropy.py.
| int encoding_layer_entropy.EXPECTED_INDEPENDENT = 256 |
Definition at line 75 of file encoding_layer_entropy.py.
| float encoding_layer_entropy.EXPECTED_OVERSTATEMENT = 3.12 |
Definition at line 77 of file encoding_layer_entropy.py.
| int encoding_layer_entropy.EXPECTED_STORED_BYTES = 3_408_896 |
Definition at line 74 of file encoding_layer_entropy.py.
| int encoding_layer_entropy.PRED_GUESSES_PER_TABLE = 1000 |
Definition at line 70 of file encoding_layer_entropy.py.
| int encoding_layer_entropy.SEED = 42 |
Definition at line 69 of file encoding_layer_entropy.py.