Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6d1aeea
add API for external-MU signing (ML_DSA)
abhi-dev-engg Feb 14, 2026
0a76d38
code formatting
abhi-dev-engg Feb 14, 2026
0cb70a3
fix issues
abhi-dev-engg Feb 18, 2026
1f2dce4
add upstream changes to support extmu variant
abhi-dev-engg Feb 21, 2026
63fd0eb
fix verify functions for x86
abhi-dev-engg Feb 21, 2026
16a4a1b
avoid duplication of src compilation for mu variants
abhi-dev-engg Feb 21, 2026
1852afd
fix multiple definition error
abhi-dev-engg Feb 21, 2026
1048b1d
add missed upstream changes
abhi-dev-engg Feb 21, 2026
83dcd4c
fix CMake indentation issues
abhi-dev-engg Feb 21, 2026
3da8d2f
add check for msglen for mu variants
abhi-dev-engg Feb 21, 2026
7881c95
upstream sig fixes
abhi-dev-engg Feb 22, 2026
7e8b7e9
skip mem tests for extmu variants
abhi-dev-engg Feb 22, 2026
ec685fe
fix msg length issues for mu variant
abhi-dev-engg Feb 22, 2026
55a647c
remove un-needed changes
abhi-dev-engg Feb 23, 2026
7a5f741
Merge branch 'main' into extmu
abhi-dev-engg Feb 23, 2026
b23a039
review fixes & change mu tests from internal APIs to external
abhi-dev-engg Feb 24, 2026
1ad115c
code formatting
abhi-dev-engg Feb 24, 2026
628cc0c
fix build issues
abhi-dev-engg Feb 24, 2026
ec5d00a
remove unused param
abhi-dev-engg Feb 24, 2026
b45df7a
code formatting fix
abhi-dev-engg Feb 24, 2026
4aa5c22
remove hardcoding of 64 as mu length
abhi-dev-engg Feb 24, 2026
e414a02
address more review comments
abhi-dev-engg Feb 25, 2026
0d49427
remove kat changes for ext-mu variants
abhi-dev-engg Feb 26, 2026
61223d9
Merge branch 'main' into extmu
abhi-dev-engg Feb 26, 2026
257831c
dummy commit to restart tests
abhi-dev-engg Feb 27, 2026
9a58b4b
dummy commit to trigger build
abhi-dev-engg Feb 28, 2026
b551830
fix more review comments
abhi-dev-engg Mar 4, 2026
d2ddedc
Merge branch 'main' into extmu
abhi-dev-engg Mar 6, 2026
351a9c9
upstream fixes
abhi-dev-engg Mar 6, 2026
a9121db
fix code formatting
abhi-dev-engg Mar 6, 2026
244a8e5
tabs instead of spaces
abhi-dev-engg Mar 6, 2026
c191438
upstream changes
abhi-dev-engg Mar 6, 2026
577a812
code formatting
abhi-dev-engg Mar 6, 2026
d517d70
fix more code formatting
abhi-dev-engg Mar 6, 2026
007b3db
Merge branch 'main' into extmu
abhi-dev-engg Mar 16, 2026
eda34f5
Merge branch 'main' into extmu
abhi-dev-engg Mar 20, 2026
ed4a65d
adapt latest wycheproof
abhi-dev-engg Mar 22, 2026
b562608
code formatting
abhi-dev-engg Mar 22, 2026
2cc25db
check mslgen before hex conversion
abhi-dev-engg Mar 22, 2026
1438786
code formatting
abhi-dev-engg Mar 22, 2026
5369c59
step 1 : update latest yaml
abhi-dev-engg Jun 16, 2026
6f5e8d7
merge main branch & resolve conflicts
abhi-dev-engg Jun 18, 2026
a858f14
add checks for extmu apis
abhi-dev-engg Jun 18, 2026
5fa72e2
correct macro for sig-dsa
abhi-dev-engg Jun 18, 2026
f933a3e
Merge branch 'main' into extmu
abhi-dev-engg Jun 19, 2026
1ac8d5c
add new line at end of cmake
abhi-dev-engg Jun 20, 2026
07e1f02
minor cosmetic fix
abhi-dev-engg Jun 21, 2026
1895f08
revert changes
abhi-dev-engg Jun 21, 2026
b2acd7a
Merge branch 'main' into extmu
abhi-dev-engg Jun 26, 2026
c640e64
Merge branch 'main' into extmu
xuganyu96 Jul 2, 2026
8e67a08
Merge branch 'main' into extmu
abhi-dev-engg Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .CMake/alg_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ option(OQS_ENABLE_SIG_ML_DSA "Enable ml_dsa algorithm family" ON)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44 "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65 "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87 "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_extmu "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_extmu "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_extmu "" ON "OQS_ENABLE_SIG_ML_DSA" OFF)

option(OQS_ENABLE_SIG_FALCON "Enable falcon algorithm family" ON)
cmake_dependent_option(OQS_ENABLE_SIG_falcon_512 "" ON "OQS_ENABLE_SIG_FALCON" OFF)
Expand Down Expand Up @@ -672,6 +675,42 @@ if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEO
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_extmu_x86_64 "" ON "OQS_ENABLE_SIG_ml_dsa_44_extmu" OFF)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEON_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_extmu_aarch64 "" ON "OQS_ENABLE_SIG_ml_dsa_44_extmu" OFF)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_extmu_x86_64 "" ON "OQS_ENABLE_SIG_ml_dsa_65_extmu" OFF)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEON_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_extmu_aarch64 "" ON "OQS_ENABLE_SIG_ml_dsa_65_extmu" OFF)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_extmu_x86_64 "" ON "OQS_ENABLE_SIG_ml_dsa_87_extmu" OFF)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEON_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_extmu_aarch64 "" ON "OQS_ENABLE_SIG_ml_dsa_87_extmu" OFF)
endif()
endif()


if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS))
cmake_dependent_option(OQS_ENABLE_SIG_falcon_512_avx2 "" ON "OQS_ENABLE_SIG_falcon_512" OFF)
Expand Down
20 changes: 18 additions & 2 deletions scripts/copy_from_upstream/copy_from_upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,23 @@ def handle_implementation(impl, family, scheme, dst_basedir):

def process_families(instructions, basedir, with_kat, with_generator, with_libjade=False):
for family in instructions['kems'] + instructions['sigs']:
extmu_variants = []
for s in family['schemes']:
if 'metadata' in s and any('signature_signature_extmu' in imp for imp in s['metadata']['implementations']):
ext_s = copy.deepcopy(s)
ext_s['scheme'] += "_extmu"
ext_s['scheme_c'] += "_extmu"
ext_s['pretty_name_full'] += "-extmu"
ext_s['is_extmu'] = True
for imp in ext_s['metadata']['implementations']:
if 'signature_signature_extmu' in imp:
imp['signature_signature'] = imp['signature_signature_extmu']
if 'signature_verify_extmu' in imp:
imp['signature_verify'] = imp['signature_verify_extmu']
imp['api-with-context-string'] = False
extmu_variants.append(ext_s)
family['schemes'].extend(extmu_variants)

try:
os.makedirs(os.path.join(basedir, 'src', family['type'], family['name']))
except:
Expand Down Expand Up @@ -699,8 +716,7 @@ def process_families(instructions, basedir, with_kat, with_generator, with_libja
scheme['scheme'], str(ke), impl['name']))
pass


if with_kat:
if with_kat and not scheme.get('is_extmu', False):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t fully understand why is_extmu is excluded here. Couldn’t the KAT hash for externalMu also be defined in the upstream YAML file?

@abhi-dev-engg abhi-dev-engg Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bhess ,

I disabled KAT tests for mu variants as kat_sig.c tests varying message lengths, but extmu strictly requires exactly 64 bytes for the message.

Since NIST KATs expect varying lengths, I disabled them as msglen is constant here.

how would you prefer to handle this for external-mu APIs?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I suppose known-answer tests for externalMu are covered by the ACVP tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, correct. ACVP tests cover external-mu

if family in instructions['kems']:
try:
if kats['kem'][scheme['pretty_name_full']]['single'] != scheme['metadata']['nistkat-sha256']:
Expand Down
18 changes: 15 additions & 3 deletions scripts/copy_from_upstream/src/sig/family/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ endif()
{%- endif %}

{%- for scheme in schemes -%}
{%- if not scheme.is_extmu %}
{%- set has_extmu = (schemes | selectattr("scheme_c", "equalto", scheme['scheme_c'] ~ "_extmu") | list | length > 0) %}
{%- for impl in scheme['metadata']['implementations'] -%}
{%- if impl['name'] == scheme['default_implementation'] %}

if(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}{%- endif %})
if(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}{%- endif %}{%- if has_extmu %} OR OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}_extmu{%- endif %})
add_library({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} OBJECT sig_{{ family }}_{{ scheme['scheme'] }}.c {% for source_file in impl['sources']|sort -%}{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }}/{{ source_file }}{%- if not loop.last %} {% endif -%}{%- endfor -%}{%- if common_deps is defined %}{%- for cdep in common_deps %}{%- if cdep['include_only'] and 'common_dep' in impl and cdep['name'] in impl['common_dep'] %} {% for sf in cdep['sources_addl']|sort -%}{{ upstream_location }}_{{ cdep['name'] }}/{{ sf }}{%- if not loop.last %} {% endif -%}{%- endfor %}{%- endif %}{%- endfor %}{%- endif -%})
{%- if impl['compile_opts'] %}
target_compile_options({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PUBLIC {{ impl['compile_opts'] }})
{%- endif -%}

{%- else %}

if(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}_{{ impl['name'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}{%- endif %})
if(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}_{{ impl['name'] }}{%- if 'alias_scheme' in scheme %} OR OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}{%- endif %}{%- if has_extmu %} OR OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}_extmu_{{ impl['name'] }}{%- endif %})
add_library({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} OBJECT {% for source_file in impl['sources']|sort -%}{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }}/{{ source_file }}{%- if not loop.last %} {% endif -%}{%- endfor -%}{%- if common_deps is defined %}{%- for cdep in common_deps %}{%- if cdep['include_only'] and 'common_dep' in impl and cdep['name'] in impl['common_dep'] %} {% for sf in cdep['sources_addl']|sort -%}{{ upstream_location }}_{{ cdep['name'] }}/{{ sf }}{%- if not loop.last %} {% endif -%}{%- endfor %}{%- endif %}{%- endfor %}{%- endif -%})
{%- endif %}
target_include_directories({{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/{{ impl['upstream']['name'] }}_{{ scheme['pqclean_scheme'] }}_{{ impl['name'] }})
Expand All @@ -57,7 +59,17 @@ if(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }}_{{ impl['name'] }}{%- if
{%- endif %}
set(_{{ family|upper }}_OBJS ${_{{ family|upper }}_OBJS} $<TARGET_OBJECTS:{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}>)
endif()
{%- endfor -%}
{%- endfor %}
{%- else %}

if(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme_c'] }})
add_library({{ family }}_{{ scheme['scheme'] }} OBJECT sig_{{ family }}_{{ scheme['scheme'] }}.c)
{%- set base_pqclean = scheme['pqclean_scheme'] | replace('-extmu', '') %}
target_include_directories({{ family }}_{{ scheme['scheme'] }} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/{{ scheme['metadata']['implementations'][0]['upstream']['name'] }}_{{ base_pqclean }}_{{ scheme['default_implementation'] }})
target_include_directories({{ family }}_{{ scheme['scheme'] }} PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
set(_{{ family|upper }}_OBJS ${_{{ family|upper }}_OBJS} $<TARGET_OBJECTS:{{ family }}_{{ scheme['scheme'] }}>)
endif()
{%- endif %}
{%- endfor %}

set({{ family|upper }}_OBJS ${_{{ family|upper }}_OBJS} PARENT_SCOPE)
Expand Down
3 changes: 3 additions & 0 deletions scripts/copy_from_upstream/src/sig/family/sig_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#define OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_length_public_key {{ scheme['metadata']['length-public-key'] }}
#define OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_length_secret_key {{ scheme['metadata']['length-secret-key'] }}
#define OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_length_signature {{ scheme['metadata']['length-signature'] }}
{%- if scheme.is_extmu and 'length-mu' in scheme['metadata'] %}
#define OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_length_mu {{ scheme['metadata']['length-mu'] }}
{%- endif %}

OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_new(void);
OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_keypair(uint8_t *public_key, uint8_t *secret_key);
Expand Down
Loading
Loading