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)