|
11 | 11 | applications.** :warning:
|
12 | 12 | >
|
13 | 13 | > This is an educational resource and has not been designed to be secure
|
14 |
| -> against any form of side-channel attack. The indended use of this project |
| 14 | +> against any form of side-channel attack. The intended use of this project |
15 | 15 | > is for learning and experimenting with ML-KEM and Kyber
|
16 | 16 |
|
17 | 17 | This repository contains a pure python implementation of both:
|
|
72 | 72 |
|
73 | 73 | Originally this project was planned to have zero dependencies, however to make this work
|
74 | 74 | pass the KATs, we needed a deterministic CSRNG. The reference implementation uses
|
75 |
| -AES256 CTR DRBG. I have implemented this in [`aes256_ctr_drbg.py`](aes256_ctr_drbg.py). |
| 75 | +AES256 CTR DRBG. I have implemented this in [`aes256_ctr_drbg.py`](src/kyber_py/drbg/aes256_ctr_drbg.py). |
76 | 76 | However, I have not implemented AES itself, instead I import this from `pycryptodome`. If this dependency is too annoying, then please make an issue and we can have a pure-python AES included into the repo.
|
77 | 77 |
|
78 | 78 | To install dependencies, run `pip -r install requirements`.
|
@@ -167,11 +167,11 @@ the cryptographic assurance of the protocol.
|
167 | 167 | For those who don't know, a module is a generalisation of a vector space, where
|
168 | 168 | elements of a matrix are not selected from a field (such as the rationals, or
|
169 | 169 | element of a finite field $\mathbb{F}\_{p^k}$), but rather in a ring (we do not
|
170 |
| -require each element in a ring to have a multiplicative inverse). The ring in question for Kyber/ML-KEM is a polynomial ring where polynomials have coefficents in $\mathbb{F}\_{q}$ with $q = 3329$ and the polynomial ring has a modulus $X^n + 1$ with $n = 256$ (and so every element of the polynomial ring has at most 256 coefficients). |
| 170 | +require each element in a ring to have a multiplicative inverse). The ring in question for Kyber/ML-KEM is a polynomial ring where polynomials have coefficients in $\mathbb{F}\_{q}$ with $q = 3329$ and the polynomial ring has a modulus $X^n + 1$ with $n = 256$ (and so every element of the polynomial ring has at most 256 coefficients). |
171 | 171 |
|
172 | 172 | ### Polynomials
|
173 | 173 |
|
174 |
| -To help with experimenting with these polynomial rings themselves, the file [`polynomials_generic.py`](polynomials/polynomials_generic.py) has an implementation of the univariate polynomial ring |
| 174 | +To help with experimenting with these polynomial rings themselves, the file [`polynomials_generic.py`](src/kyber_py/polynomials/polynomials_generic.py) has an implementation of the univariate polynomial ring |
175 | 175 |
|
176 | 176 | $$
|
177 | 177 | R_q = \mathbb{F}_q[X] /(X^n + 1)
|
@@ -245,8 +245,8 @@ specification for more information.
|
245 | 245 | ### Modules
|
246 | 246 |
|
247 | 247 | Building on `polynomials_generic.py` we also include a file
|
248 |
| -[`modules_generic.py`](modules/modules_generic.py) which has all of the |
249 |
| -functions needed to perform linear algebra given a ring. |
| 248 | +[`modules_generic.py`](src/kyber_py/modules/modules_generic.py) which has all of |
| 249 | +the functions needed to perform linear algebra given a ring. |
250 | 250 |
|
251 | 251 | Note that `Matrix` allows elements of the module to be of size $m \times n$ but
|
252 | 252 | for Kyber, we only need vectors of length $k$ and square matrices of size $k
|
|
0 commit comments