This repository was archived by the owner on Dec 2, 2025. It is now read-only.
FIPS 203 FINAL - Candidate new KAT inputs and results#15
Merged
kriskwiatkowski merged 1 commit intopost-quantum-cryptography:mainfrom Aug 25, 2024
Merged
Conversation
Signed-off-by: Rod Chapman <rodchap@amazon.com>
|
I can confirm that AWS-LC's ML-KEM implementation successfully passes the KATs. To check this I did the following:
I pushed the test to my fork of AWS-LC for posterity: aws/aws-lc@81cb021. Note1: this is just a quick test in my fork of AWS-LC, I'll soon push a change to update AWS-LC itself. Note2: that the implementation in AWS-LC was originally copied from the official Kyber repository (https://github.com/pq-crystals/kyber). |
dkostic
added a commit
to dkostic/aws-lc
that referenced
this pull request
Aug 16, 2024
Added domain separation in keygen and new KATs. The KATs were sourced from post-quantum-cryptography/KAT#15.
dkostic
added a commit
to dkostic/aws-lc
that referenced
this pull request
Aug 23, 2024
Added domain separation in keygen and new KATs. The KATs were sourced from post-quantum-cryptography/KAT#15.
dkostic
added a commit
to aws/aws-lc
that referenced
this pull request
Aug 23, 2024
In this PR we made a small change that transitions the ML-KEM implementation from the Initial Public Draft (IPD) to the final ML-KEM as defined in FIPS 203: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf. The only change needed was the domain separation in key generation. This required updated KATs as well. The new KATs were obtained from: post-quantum-cryptography/KAT#15, and converted to the form AWS-LC expects. In as subsequent PR we'll rename all functions/folders/identifiers to drop the "ipd" suffix. p.s. Python script used for KATs conversion: ``` import sys if len(sys.argv) != 2: print("Usage: python convert.py <filename>") sys.exit(1) filename = sys.argv[1] # PARSE THE INPUT FILE all_groups = [] try: with open(filename, 'r') as file: group = {} for line in file: key = line.strip().split(" ")[0] value = line.strip().split(" ")[2] if key == "count": if (len(group) != 0): all_groups.append(group) group = {} group[key] = value except FileNotFoundError: print(f"Error: The file '{filename}' was not found.") try: with open(filename + "_out.txt", 'w') as file: for group in all_groups: file.write("\n") file.write("count = " + group["count"] + "\n") file.write("keypair_coins = " + group["d"] + group["z"] + "\n") file.write("pk = " + group["pk"] + "\n") file.write("sk = " + group["sk"] + "\n") file.write("encap_coins = " + group["msg"] + "\n") file.write("ct = " + group["ct"] + "\n") file.write("ss = " + group["ss"] + "\n") except FileNotFoundError: print(f"Error: The file '{filename}' was not found.") ```
Member
|
@rod-chapman I can confirm it works on one of my implementations. I've one more to update and check. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contributes candidate KAT files for FIPS 203 FINAL (MLKEM), updated for the 13th August 2024 issue of FIPS 203.
The same random inputs, seeds, and messages are used as before.
New results were produced by the AWS LibMLKEM implementation. I hope verification of these results with other implementations will follow.