-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from tomato42/standard-names-for-mlkem
use the same names for ML-KEM parameters as the FIPS 203 document
- Loading branch information
Showing
5 changed files
with
49 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .default_parameters import ML_KEM128, ML_KEM192, ML_KEM256 | ||
from .default_parameters import ML_KEM_512, ML_KEM_768, ML_KEM_1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
""" | ||
The parameters defined in the FIPS 203 IPD document. | ||
Includes the ML-KEM-512, ML-KEM-768, and ML-KEM-1024 parameters | ||
and initialised objects with them. | ||
""" | ||
|
||
from .ml_kem import ML_KEM | ||
|
||
# TODO: we can only allow a user to select one of the following three | ||
# we should maybe put these into the class and only allow a user to | ||
# select 128, 192 or 256 bit security. | ||
DEFAULT_PARAMETERS = { | ||
"ML128": {"k": 2, "eta_1": 3, "eta_2": 2, "du": 10, "dv": 4}, | ||
"ML192": {"k": 3, "eta_1": 2, "eta_2": 2, "du": 10, "dv": 4}, | ||
"ML256": {"k": 4, "eta_1": 2, "eta_2": 2, "du": 11, "dv": 5}, | ||
"ML512": {"k": 2, "eta_1": 3, "eta_2": 2, "du": 10, "dv": 4}, | ||
"ML768": {"k": 3, "eta_1": 2, "eta_2": 2, "du": 10, "dv": 4}, | ||
"ML1024": {"k": 4, "eta_1": 2, "eta_2": 2, "du": 11, "dv": 5}, | ||
} | ||
"""Parameters for the :py:obj:`.ML_KEM` objects.""" | ||
|
||
ML_KEM_512 = ML_KEM(DEFAULT_PARAMETERS["ML512"]) | ||
""" | ||
Key exchange object that uses ML-KEM-512 parameters internally. | ||
Provides about 128 bit level of security. | ||
""" | ||
|
||
ML_KEM_768 = ML_KEM(DEFAULT_PARAMETERS["ML768"]) | ||
""" | ||
Key exchange object that uses ML-KEM-768 parameters internally. | ||
Provides about 192 bit level of security. | ||
""" | ||
|
||
ML_KEM_1024 = ML_KEM(DEFAULT_PARAMETERS["ML1024"]) | ||
""" | ||
Key exchange object that uses ML-KEM-1024 parameters internally. | ||
ML_KEM128 = ML_KEM(DEFAULT_PARAMETERS["ML128"]) | ||
ML_KEM192 = ML_KEM(DEFAULT_PARAMETERS["ML192"]) | ||
ML_KEM256 = ML_KEM(DEFAULT_PARAMETERS["ML256"]) | ||
Provides about 256 bit level of security. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters