Skip to content

Commit 746f107

Browse files
committed
Fix XMSSMT typo to XMSS^MT.
Signed-off-by: Guiliano99 <[email protected]>
1 parent c2922d9 commit 746f107

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

scripts/pipeline_gen_stfl_keys.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
XMSS/XMSSMT Stateful Signature Key Pre-Generation Script.
2+
XMSS/XMSS^MT Stateful Signature Key Pre-Generation Script.
33
4-
This module provides functionality to pre-generate expensive XMSS and XMSSMT
4+
This module provides functionality to pre-generate expensive XMSS and XMSS^MT
55
stateful signature keys for use in CI/CD pipelines and testing environments.
66
77
Background
88
----------
9-
XMSS (eXtended Merkle Signature Scheme) and XMSSMT (XMSS Multi-Tree) are
9+
XMSS (eXtended Merkle Signature Scheme) and XMSS^MT (XMSS Multi-Tree) are
1010
post-quantum stateful signature schemes that can be computationally expensive
1111
to generate, especially for larger tree heights. Pre-generating these keys
1212
significantly reduces test execution time in CI pipelines.
@@ -34,15 +34,15 @@ def _mech_to_filename(name: str) -> str:
3434
Map mechanism name to key filename (keep in sync with CI pipeline).
3535
3636
Example:
37-
"XMSSMT-SHA2_20/4_256" -> "xmssmt-sha2_20_layers_4_256.der"
37+
"XMSS^MT-SHA2_20/4_256" -> "xmssmt-sha2_20_layers_4_256.der"
3838
"XMSS-SHA2_10_256" -> "xmss-sha2_10_256.der"
3939
4040
"""
4141
return f"{name.replace('/', '_layers_', 1).lower()}.der"
4242

4343

4444
def _collect_mechanism_names() -> list[str]:
45-
"""Return all enabled XMSS/XMSSMT stateful signature mechanisms."""
45+
"""Return all enabled XMSS/XMSS^MT stateful signature mechanisms."""
4646
return [
4747
name
4848
for name in oqs.get_enabled_stateful_sig_mechanisms()
@@ -52,7 +52,7 @@ def _collect_mechanism_names() -> list[str]:
5252

5353
def _check_is_expensive(name: str) -> bool:
5454
"""
55-
Check if the given XMSS/XMSSMT mechanism is considered expensive to generate.
55+
Check if the given XMSS/XMSS^MT mechanism is considered expensive to generate.
5656
5757
Currently, we consider mechanisms with height > 16 as expensive.
5858
"""
@@ -70,13 +70,13 @@ def _check_is_expensive(name: str) -> bool:
7070

7171

7272
def get_all_keys_to_generate() -> list[str]:
73-
"""Get a list of all XMSS/XMSSMT keys that are considered expensive to generate."""
73+
"""Get a list of all XMSS/XMSS^MT keys that are considered expensive to generate."""
7474
all_keys: list[str] = _collect_mechanism_names()
7575
return [name for name in all_keys if _check_is_expensive(name)]
7676

7777

7878
def check_generated_all_keys(out_dir: Path) -> bool:
79-
"""Check if all XMSS/XMSSMT keys are present in *out_dir*."""
79+
"""Check if all XMSS/XMSS^MT keys are present in *out_dir*."""
8080
all_keys: list[str] = get_all_keys_to_generate()
8181

8282
for name in all_keys:
@@ -89,7 +89,7 @@ def check_generated_all_keys(out_dir: Path) -> bool:
8989

9090
def generate_keys(out_dir: Path) -> dict[str, Any]:
9191
"""
92-
Generate all XMSS/XMSSMT keys into *out_dir* if they are missing.
92+
Generate all XMSS/XMSS^MT keys into *out_dir* if they are missing.
9393
9494
Returns a small stats dict useful for tests:
9595
{"generated": int, "skipped": int, "total": int, "missing": list[str]}
@@ -141,7 +141,7 @@ def generate_keys(out_dir: Path) -> dict[str, Any]:
141141
for name in missing:
142142
logger.debug(" - %s", name)
143143

144-
logger.debug("\nAll %d XMSS/XMSSMT keys are available in %s.", total, out_dir)
144+
logger.debug("\nAll %d XMSS/XMSS^MT keys are available in %s.", total, out_dir)
145145
logger.debug("\nFiles in %s:", out_dir)
146146

147147
return {
@@ -174,7 +174,7 @@ def _resolve_out_dir(cli_dir: str | None) -> Path:
174174

175175
def main(argv: Iterable[str] | None = None) -> int:
176176
parser = argparse.ArgumentParser(
177-
description="Generate XMSS/XMSSMT stateful signature keys.",
177+
description="Generate XMSS/XMSS^MT stateful signature keys.",
178178
)
179179
parser.add_argument(
180180
"key_dir",
@@ -189,7 +189,7 @@ def main(argv: Iterable[str] | None = None) -> int:
189189
action="store_true",
190190
help=(
191191
"If set, do not generate keys; only check whether all required "
192-
"XMSS/XMSSMT keys exist in the output directory. Returns 0 if all "
192+
"XMSS/XMSS^MT keys exist in the output directory. Returns 0 if all "
193193
"keys are present, 1 if any are missing."
194194
),
195195
)
@@ -201,10 +201,10 @@ def main(argv: Iterable[str] | None = None) -> int:
201201
# Only check whether all required keys are present; do not generate.
202202
all_present = check_generated_all_keys(out_dir)
203203
if all_present:
204-
logger.debug("All required XMSS/XMSSMT keys are present in %s", out_dir)
204+
logger.debug("All required XMSS/XMSS^MT keys are present in %s", out_dir)
205205
return 0
206206
else:
207-
logger.debug("Some required XMSS/XMSSMT keys are missing in %s", out_dir)
207+
logger.debug("Some required XMSS/XMSS^MT keys are missing in %s", out_dir)
208208
return 1
209209

210210
_ = generate_keys(out_dir)

0 commit comments

Comments
 (0)