|
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 | |
| bijection_determinacy (perm) | |
| Entry-determinacy of a Z_q bijection by completion: with one entry omitted the missing image is the unique unused value; with two omitted the completions can be swapped. | |
| build_encoding_sublayer (rng) | |
| Output-encoding sublayer: per factor two secret Z_q bijections plus their inverses (only the two forward maps are independent). | |
| build_prf_table (key) | |
| SPACE-style control: q-entry table whose entries are AES-128(key, index) truncated into Z_q. | |
| linear_attack (table, M, inv) | |
| Read one entry at each candidate index, invert the linear model s = T[x0]*x0^-1, regenerate the whole table and score it. | |
| main () | |
| Build both constructions plus the encoding sublayer and the AES-128 PRF control, measure entry-determinacy degrees, M* budgets and the key-determinism separator, and write JSON. | |
| modular_inverses () | |
| Multiplicative inverses of 1..q-1 mod q (Fermat; q is prime). | |
Variables | |
| int | AES_BLOCK_BYTES = 16 |
| int | AES_KEY_BITS = 128 |
| int | EXPECTED_D_BAKED = 1 |
| int | EXPECTED_D_BIJECTION = Q - 1 |
| int | EXPECTED_D_SHARED = 0 |
| int | EXPECTED_M_STAR_BAKED_BYTES = 1536 |
| int | EXPECTED_M_STAR_SHARED_BYTES = 0 |
| int | EXPECTED_PRF_LINEAR_REGENERATIONS = 0 |
| str | PRIOR_FOOTPRINT_RANGE_TEXT = "7.59 MB to 17.02 GB" |
| tuple | REJECTION_BOUND = (1 << 16) // Q * Q |
| int | REJECTION_RETRY_LIMIT = 64 |
| entry_determinacy.bijection_determinacy | ( | perm | ) |
Entry-determinacy of a Z_q bijection by completion: with one entry omitted the missing image is the unique unused value; with two omitted the completions can be swapped.
| perm | q-entry uint16 permutation table. |
Definition at line 203 of file entry_determinacy.py.
Referenced by main().
Here is the caller graph for this function:| entry_determinacy.build_encoding_sublayer | ( | rng | ) |
Output-encoding sublayer: per factor two secret Z_q bijections plus their inverses (only the two forward maps are independent).
| rng | Seeded NumPy generator. |
Definition at line 107 of file entry_determinacy.py.
Referenced by main().
Here is the caller graph for this function:| entry_determinacy.build_prf_table | ( | key | ) |
SPACE-style control: q-entry table whose entries are AES-128(key, index) truncated into Z_q.
Same shape and dtype as a Construction-B h-table.
| key | 16-byte AES key. |
Definition at line 126 of file entry_determinacy.py.
Referenced by main().
Here is the caller graph for this function:| entry_determinacy.linear_attack | ( | table, | |
| M, | |||
| inv | |||
| ) |
Read one entry at each candidate index, invert the linear model s = T[x0]*x0^-1, regenerate the whole table and score it.
Row s of the shared table M is exactly the candidate model x -> s*x, so M enumerates every linear hypothesis without recomputing one.
| table | q-entry uint16 table under attack. |
| M | Shared multiply table from build_shared_table(). |
| inv | Modular inverse array. |
Definition at line 167 of file entry_determinacy.py.
Referenced by main().
Here is the caller graph for this function:| entry_determinacy.main | ( | void | ) |
Build both constructions plus the encoding sublayer and the AES-128 PRF control, measure entry-determinacy degrees, M* budgets and the key-determinism separator, and write JSON.
Definition at line 243 of file entry_determinacy.py.
References bijection_determinacy(), build_encoding_sublayer(), build_prf_table(), linear_attack(), main(), and modular_inverses().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| entry_determinacy.modular_inverses | ( | ) |
Multiplicative inverses of 1..q-1 mod q (Fermat; q is prime).
Definition at line 88 of file entry_determinacy.py.
Referenced by main().
Here is the caller graph for this function:| int entry_determinacy.AES_BLOCK_BYTES = 16 |
Definition at line 77 of file entry_determinacy.py.
| int entry_determinacy.AES_KEY_BITS = 128 |
Definition at line 76 of file entry_determinacy.py.
| int entry_determinacy.EXPECTED_D_BAKED = 1 |
Definition at line 69 of file entry_determinacy.py.
| int entry_determinacy.EXPECTED_D_BIJECTION = Q - 1 |
Definition at line 71 of file entry_determinacy.py.
| int entry_determinacy.EXPECTED_D_SHARED = 0 |
Definition at line 70 of file entry_determinacy.py.
| int entry_determinacy.EXPECTED_M_STAR_BAKED_BYTES = 1536 |
Definition at line 72 of file entry_determinacy.py.
| int entry_determinacy.EXPECTED_M_STAR_SHARED_BYTES = 0 |
Definition at line 73 of file entry_determinacy.py.
| int entry_determinacy.EXPECTED_PRF_LINEAR_REGENERATIONS = 0 |
Definition at line 74 of file entry_determinacy.py.
| str entry_determinacy.PRIOR_FOOTPRINT_RANGE_TEXT = "7.59 MB to 17.02 GB" |
Definition at line 85 of file entry_determinacy.py.
| tuple entry_determinacy.REJECTION_BOUND = (1 << 16) // Q * Q |
Definition at line 81 of file entry_determinacy.py.
| int entry_determinacy.REJECTION_RETRY_LIMIT = 64 |
Definition at line 82 of file entry_determinacy.py.