๐ข The MLWE Equation
The Official Problem Statementโ
๐ฏ The Simple Storyโ
Here's the formal problem statement (in plain terms!):
Given:
- A multiplication table (matrix )
- A result vector ()
Find:
- A secret vector ()
- An error vector ()
Such that:
Where:
Problem: Two unknowns ( and ), one equation! Too many solutions!
Secret: Choose just one pair (, ) that produces . That's the MLWE problem.
๐ง Mental Modelโ
Hold this picture in your head:
The MLWE Problem:
Given:
โโโโโฌโโโโฌโโโโ
โ A โ B โ C โ โ Matrix ๐
โโโโโผโโโโผโโโโค
โ D โ E โ F โ
โโโโโผโโโโผโโโโค
โ G โ H โ I โ
โโโโโดโโโโดโโโโ
And vector:
โโโโโ
โ J โ โ Vector ๐ญ
โโโโโ
Find:
โโโโโ
โ s โ โ Vector ๐ฌ (secret)
โโโโโค
โ e โ โ Vector ๐ (error)
โโโโโ
Such that:
๐ยท๐ฌ + ๐ = ๐ญ
In other words:
What secret and error multiply with to produce ?
This is exactly "Finding the Closest Point on a Lattice"! (SVP - Shortest Vector Problem)
๐ See It Happenโ
Let's see what Eve and Bob do:
๐ฎ Try It Yourselfโ
Question 1: Given , , find all (, ) pairs such that
Show Answer
Equation:
Try different values:
| Reasonable? | ||
|---|---|---|
| 0 | 10 | โ Too large |
| 1 | 7 | โ Too large |
| 2 | 4 | โ Too large |
| 3 | 1 | โ Reasonable! |
| 4 | -2 | โ Reasonable! |
But we don't know what "reasonable" means! Could be (, ) = (5, -5), (6, -8), etc.
Many possibilities!
Question 2: If error must be between -2 and +2, which values of work with , ?
Show Answer
Equation:
Error
Try each:
- : โ
- : โ (not integer)
- : โ (not integer)
- : โ
- : โ (not integer)
Valid solutions: (, ) or (, )
Which one is the "true" secret? We don't know!
Question 3: Why does this become much harder with multiple equations? (ML-KEM has equations)
Show Answer
With 3 equations:
Now we must find:
- - 3 unknowns
- - 3 unknowns
Total: 6 unknowns! But we still only know and !
Each unknown can take ~5 possible values (error -2 to +2)
Total possibilities: ~5^6 = 15,625
Much harder! (In real ML-KEM: 5^256 โ 10^178)
๐ข The Mathโ
MLWE Problem Statementโ
Module-Learning With Errors (MLWE): Given and , find such that:
Where:
- (polynomial ring, coefficients 0 to 3328)
- for ML-KEM768 (matrix size)
- (secret from small error distribution)
- (error from small error distribution)
In words:
Find a polynomial vector that, when multiplied by matrix , and added to a small error polynomial vector , produces result
Security Reductionโ
The beauty of MLWE is its security reduction to SVP:
Theorem: If you can solve MLWE efficiently โ You can solve SVP โ Break lattice problems
Since SVP has no known efficient algorithm (40+ years of research), MLWE is believed hard!
Quantum resistance: No known quantum algorithm better than Grover's speedup (square root)
MLWE Parameters (ML-KEM768)โ
| Parameter | Symbol | Value | Meaning |
|---|---|---|---|
| Polynomial degree | 256 | Each polynomial: 256 coefficients | |
| Coefficient modulus | 3329 | Coefficients: 0 to 3328 | |
| Matrix size | 3 | Matrix: 3ร3 = 9 polynomials | |
| Error param 1 | 2 | Key generation error (-2 to +2) | |
| Error param 2 | 2 | Encapsulation error (-2 to +2) |
Result:
- Each entry = polynomial with 256 coefficients
- Matrix = 9 polynomials = 2,304 coefficients total
- Each coefficient values: 0, 1, 2, ..., 3328
Total possibilities:
- Each coefficient: 3,329 values
- Matrix: 3,329^2,304 โ 10^10,000 astronomically large!
- Even with error distribution: Still huge search space!
๐ก Why We Careโ
MLWE in ML-KEM Key Generationโ
Bob's key generation algorithm:
Alice receives: (public key)
Alice's encapsulation:
- Uses and
- Derives shared secret
- Sends ciphertext
Bob's decapsulation:
- Has (private key)
- Can recover from
- Derives same shared secret!
Eve's problem: Find given โ Equivalent to MLWE โ Hard!
MLWE vs LWEโ
LWE (Learning With Errors):
With:
- (regular matrix)
- (vector of integers)
- (error vector)
MLWE (Module-LWE):
With:
- (matrix of polynomials)
- (vector of polynomials)
- (error of polynomials)
Why MLWE: Faster operations, smaller keys, NTT enabled!
โ Quick Checkโ
Can you state the MLWE problem?
Try saying this out loud:
"MLWE is: Given matrix ๐ and result ๐ญ, find secret vector ๐ฌ and error vector ๐ such that ๐ยท๐ฌ + ๐ = ๐ญ. The problem is there are too many (๐ฌ, ๐) pairs possible, making it hard to find the true secret!"
Can you work with polynomial MLWE?
Try this simplified examples:
Given:
- Matrix
- Matrix
Goal: Find and such that
Let (single entry) Then
We want this plus to equal
So must satisfy:
Thus:
One solution: ,
But there are many more!
๐ Key Takeawaysโ
โ MLWE equation = (two unknowns!) โ Given to attacker = and (public key) โ Eve's problem = Find and โ Too many possibilities โ Bob's advantage = Has (secret) โ Can recover โ Security reduction = MLWE solves SVP โ SVP is hard โ MLWE is hard โ MLWE for ML-KEM = in polynomial ring โ Parameters = , , , (256-bit security)
๐ What You'll Learn Nextโ
Now you understand the MLWE problem! Next, we'll see how ML-KEM actually works. The complete process is covered in the algorithm chapters that follow.
For the KEM concept overview, continue to: