Skip to content

Commit

Permalink
Generate machine readable non-experimental OIDs (#118)
Browse files Browse the repository at this point in the history
* Create devcontainer.json

* Add machine readable non-experimental OIDs

* remove devcontainers

---------

Co-authored-by: Petr Muzikant <[email protected]>
  • Loading branch information
Muzosh and Petr Muzikant authored Jun 26, 2024
1 parent fe32cb8 commit d67b70e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/oids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"1.3.6.1.4.1.2.267.12.4.4": "ML-DSA-44-ipd", "1.3.6.1.4.1.2.267.12.6.5": "ML-DSA-65-ipd", "1.3.6.1.4.1.2.267.12.8.7": "ML-DSA-87-ipd", "1.3.9999.3.6": "Falcon-512", "1.3.9999.3.9": "Falcon-1024", "1.3.9999.6.4.16": "SLH-DSA-SHA2-128s-ipd", "1.3.9999.6.7.16": "SLH-DSA-SHAKE-128s-ipd", "1.3.9999.6.4.13": "SLH-DSA-SHA2-128f-ipd", "1.3.9999.6.7.13": "SLH-DSA-SHAKE-128f-ipd", "1.3.9999.6.5.12": "SLH-DSA-SHA2-192s-ipd", "1.3.9999.6.8.12": "SLH-DSA-SHAKE-192s-ipd", "1.3.9999.6.5.10": "SLH-DSA-SHA2-192f-ipd", "1.3.9999.6.8.10": "SLH-DSA-SHAKE-192f-ipd", "1.3.9999.6.6.12": "SLH-DSA-SHA2-256s-ipd", "1.3.9999.6.9.12": "SLH-DSA-SHAKE-256s-ipd", "1.3.9999.6.6.10": "SLH-DSA-SHA2-256f-ipd", "1.3.9999.6.9.10": "SLH-DSA-SHAKE-256f-ipd", "1.3.6.1.4.1.22554.5.6.1": "ML-KEM-512-ipd", "1.3.6.1.4.1.22554.5.6.2": "ML-KEM-768-ipd", "1.3.6.1.4.1.22554.5.6.3": "ML-KEM-1024-ipd", "1.3.6.1.4.1.22554.5.8.1": "bike128", "1.3.6.1.4.1.22554.5.8.2": "bike192", "1.3.6.1.4.1.22554.5.8.3": "bike256", "1.3.6.1.4.1.22554.5.9.1": "hqc128", "1.3.6.1.4.1.22554.5.9.2": "hqc192", "1.3.6.1.4.1.22554.5.9.3": "hqc256", "1.3.6.1.4.1.22554.5.1.1": "mceliece348864", "1.3.6.1.4.1.22554.5.1.3": "mceliece460896", "1.3.6.1.4.1.22554.5.1.5": "mceliece6688128", "1.3.6.1.4.1.22554.5.1.7": "mceliece6960119", "1.3.6.1.4.1.22554.5.1.9": "mceliece8192128", "2.16.840.1.114027.80.8.1.1": "MLDSA44-RSA2048-PSS-SHA256", "2.16.840.1.114027.80.8.1.2": "MLDSA44-RSA2048-PKCS15-SHA256", "2.16.840.1.114027.80.8.1.3": "MLDSA44-Ed25519-SHA512", "2.16.840.1.114027.80.8.1.4": "MLDSA44-ECDSA-P256-SHA256", "2.16.840.1.114027.80.8.1.5": "MLDSA44-ECDSA-brainpoolP256r1-SHA256", "2.16.840.1.114027.80.8.1.6": "MLDSA65-RSA3072-PSS-SHA512", "2.16.840.1.114027.80.8.1.7": "MLDSA65-RSA3072-PKCS15-SHA512", "2.16.840.1.114027.80.8.1.8": "MLDSA65-ECDSA-P256-SHA512", "2.16.840.1.114027.80.8.1.9": "MLDSA65-ECDSA-brainpoolP256r1-SHA512", "2.16.840.1.114027.80.8.1.10": "MLDSA65-Ed25519-SHA512", "2.16.840.1.114027.80.8.1.11": "MLDSA87-ECDSA-P384-SHA512", "2.16.840.1.114027.80.8.1.12": "MLDSA87-ECDSA-brainpoolP384r1-SHA512", "2.16.840.1.114027.80.8.1.13": "MLDSA87-Ed448-SHA512", "2.16.840.1.114027.80.5.2.1": "MLKEM512-ECDH-P256-KMAC128", "2.16.840.1.114027.80.5.2.2": "MLKEM512-ECDH-brainpoolP256r1-KMAC128", "2.16.840.1.114027.80.5.2.3": "MLKEM512-X25519-KMAC128", "2.16.840.1.114027.80.5.2.13": "MLKEM512-RSA2048-KMAC128", "2.16.840.1.114027.80.5.2.4": "MLKEM512-RSA3072-KMAC128", "2.16.840.1.114027.80.5.2.5": "MLKEM768-ECDH-P256-KMAC256", "2.16.840.1.114027.80.5.2.6": "MLKEM768-ECDH-brainpoolP256r1-KMAC256", "2.16.840.1.114027.80.5.2.7": "MLKEM768-X25519-KMAC256", "2.16.840.1.114027.80.5.2.8": "MLKEM1024-ECDH-P384-KMAC256", "2.16.840.1.114027.80.5.2.9": "MLKEM1024-ECDH-brainpoolP384r1-KMAC256", "2.16.840.1.114027.80.5.2.10": "MLKEM1024-X448-KMAC256"}
15 changes: 14 additions & 1 deletion src/pqc_report_writer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import csv
import json
import operator
from os import SEEK_SET
import os.path
import re
import argparse
Expand Down Expand Up @@ -76,12 +78,18 @@ def _format_result_cell(avr) -> str:
return '<br>'.join(result_lines)


def _parse_oid_name_mapping_file(f) -> Mapping[str, str]:
def _parse_oid_name_mapping_file(f, stop_at_experimental=False) -> Mapping[str, str]:
mappings = {}

# set iterator to the start of the file in case this function is called repeatedly
f.seek(0, SEEK_SET)

for line in f.readlines():
line = line.strip()

if stop_at_experimental and line == "# Experimental and Historical OIDs":
break

m = _OID_MAPPING_LINE_REGEX.match(line)

if m is None:
Expand All @@ -107,6 +115,11 @@ def main():

oid_name_mappings = _parse_oid_name_mapping_file(args.oid_mapping_file)

oids_json = _parse_oid_name_mapping_file(args.oid_mapping_file, stop_at_experimental=True)

with open("oids.json", "w") as f:
json.dump(oids_json, f)

avrs = []

for file in args.files:
Expand Down
19 changes: 17 additions & 2 deletions src/pqc_report_writer_common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import csv
import json
import operator
from os import SEEK_SET
import os.path
import re
import argparse
Expand Down Expand Up @@ -29,7 +31,9 @@ def _parse_json_file(generator, verifier, f) -> Sequence[AlgorithmVerificationRe
pass


def _parse_csv_file(generator, verifier, f, oid_name_mappings) -> Sequence[AlgorithmVerificationResult]:
def _parse_csv_file(
generator, verifier, f, oid_name_mappings
) -> Sequence[AlgorithmVerificationResult]:
c = csv.DictReader(f)

avrs = []
Expand Down Expand Up @@ -83,12 +87,18 @@ def _format_result_cell(avr) -> str:
return '<br>'.join(result_lines)


def _parse_oid_name_mapping_file(f) -> Mapping[str, str]:
def _parse_oid_name_mapping_file(f, stop_at_experimental=False) -> Mapping[str, str]:
mappings = {}

# set iterator to the start of the file in case this function is called repeatedly
f.seek(0, SEEK_SET)

for line in f.readlines():
line = line.strip()

if stop_at_experimental and line == "# Experimental and Historical OIDs":
break

m = _OID_MAPPING_LINE_REGEX.match(line)

if m is None:
Expand Down Expand Up @@ -128,6 +138,11 @@ def main():

oid_name_mappings = _parse_oid_name_mapping_file(args.oid_mapping_file)

oids_json = _parse_oid_name_mapping_file(args.oid_mapping_file, stop_at_experimental=True)

with open("oids.json", "w") as f:
json.dump(oids_json, f)

avrs = []

for file in args.files:
Expand Down
2 changes: 1 addition & 1 deletion src/rebuild_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ python3 pqc_report_writer.py ../docs/oid_mapping.md $files

# convert to html
pandoc -f markdown pqc_hackathon_results.md > pqc_hackathon_results.html
mv pqc_hackathon_results.md pqc_hackathon_results.html ../docs
mv pqc_hackathon_results.md pqc_hackathon_results.html oids.json ../docs
2 changes: 1 addition & 1 deletion src/rebuild_results_certs_r3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ python3 pqc_report_writer_common.py ../docs/oid_mapping.md pqc_hackathon_results

# convert to html
pandoc -f markdown pqc_hackathon_results_certs_r3.md > pqc_hackathon_results_certs_r3.html
mv pqc_hackathon_results_certs_r3.md pqc_hackathon_results_certs_r3.html ../docs
mv pqc_hackathon_results_certs_r3.md pqc_hackathon_results_certs_r3.html oids.json ../docs
2 changes: 1 addition & 1 deletion src/rebuild_results_cms_v1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ python3 pqc_report_writer_common.py ../docs/oid_mapping.md pqc_hackathon_results

# convert to html
pandoc -f markdown pqc_hackathon_results_cms_v1.md > pqc_hackathon_results_cms_v1.html
mv pqc_hackathon_results_cms_v1.md pqc_hackathon_results_cms_v1.html ../docs
mv pqc_hackathon_results_cms_v1.md pqc_hackathon_results_cms_v1.html oids.json ../docs

0 comments on commit d67b70e

Please sign in to comment.