Skip to content

Commit

Permalink
add composite OIDs to getenv logic (#419)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Baentsch <[email protected]>
  • Loading branch information
baentsch authored May 28, 2024
1 parent 67ad183 commit e784ed1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 25 deletions.
4 changes: 4 additions & 0 deletions oqs-template/oqsprov/oqsprov.c/oid_patching.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
{%- set cnt.val = cnt.val + 2 %}
if ((envval = getenv("OQS_OID_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}"))) oqs_oid_alg_list[{{ cnt.val }}+OQS_KEMOID_CNT] = envval;
{%- endfor %}
{%- for composite_alg in variant['composite'] %}
{%- set cnt.val = cnt.val + 2 %}
if ((envval = getenv("OQS_OID_{{ variant['name']|upper }}_{{ composite_alg['name']|upper }}"))) oqs_oid_alg_list[{{ cnt.val }}+OQS_KEMOID_CNT] = envval;
{%- endfor %}
{%- endfor %}
{%- endfor %}
}
76 changes: 51 additions & 25 deletions oqsprov/oqsprov.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,56 +423,82 @@ int oqs_patch_oids(void)
oqs_oid_alg_list[16 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_MLDSA44")))
oqs_oid_alg_list[18 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_MLDSA65")))
if ((envval = getenv("OQS_OID_MLDSA44_PSS2048")))
oqs_oid_alg_list[20 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P384_MLDSA65")))
if ((envval = getenv("OQS_OID_MLDSA44_RSA2048")))
oqs_oid_alg_list[22 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_MLDSA87")))
if ((envval = getenv("OQS_OID_MLDSA44_ED25519")))
oqs_oid_alg_list[24 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P521_MLDSA87")))
if ((envval = getenv("OQS_OID_MLDSA44_P256")))
oqs_oid_alg_list[26 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_FALCON512")))
if ((envval = getenv("OQS_OID_MLDSA44_BP256")))
oqs_oid_alg_list[28 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_FALCON512")))
if ((envval = getenv("OQS_OID_MLDSA65")))
oqs_oid_alg_list[30 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_FALCON512")))
if ((envval = getenv("OQS_OID_P384_MLDSA65")))
oqs_oid_alg_list[32 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_FALCONPADDED512")))
if ((envval = getenv("OQS_OID_MLDSA65_PSS3072")))
oqs_oid_alg_list[34 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_FALCONPADDED512")))
if ((envval = getenv("OQS_OID_MLDSA65_RSA3072")))
oqs_oid_alg_list[36 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_FALCONPADDED512")))
if ((envval = getenv("OQS_OID_MLDSA65_P256")))
oqs_oid_alg_list[38 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_FALCON1024")))
if ((envval = getenv("OQS_OID_MLDSA65_BP256")))
oqs_oid_alg_list[40 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P521_FALCON1024")))
if ((envval = getenv("OQS_OID_MLDSA65_ED25519")))
oqs_oid_alg_list[42 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_FALCONPADDED1024")))
if ((envval = getenv("OQS_OID_MLDSA87")))
oqs_oid_alg_list[44 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P521_FALCONPADDED1024")))
if ((envval = getenv("OQS_OID_P521_MLDSA87")))
oqs_oid_alg_list[46 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHA2128FSIMPLE")))
if ((envval = getenv("OQS_OID_MLDSA87_P384")))
oqs_oid_alg_list[48 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE")))
if ((envval = getenv("OQS_OID_MLDSA87_BP384")))
oqs_oid_alg_list[50 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE")))
if ((envval = getenv("OQS_OID_MLDSA87_ED448")))
oqs_oid_alg_list[52 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHA2128SSIMPLE")))
if ((envval = getenv("OQS_OID_FALCON512")))
oqs_oid_alg_list[54 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE")))
if ((envval = getenv("OQS_OID_P256_FALCON512")))
oqs_oid_alg_list[56 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE")))
if ((envval = getenv("OQS_OID_RSA3072_FALCON512")))
oqs_oid_alg_list[58 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHA2192FSIMPLE")))
if ((envval = getenv("OQS_OID_FALCONPADDED512")))
oqs_oid_alg_list[60 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE")))
if ((envval = getenv("OQS_OID_P256_FALCONPADDED512")))
oqs_oid_alg_list[62 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE")))
if ((envval = getenv("OQS_OID_RSA3072_FALCONPADDED512")))
oqs_oid_alg_list[64 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE")))
if ((envval = getenv("OQS_OID_FALCON1024")))
oqs_oid_alg_list[66 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE")))
if ((envval = getenv("OQS_OID_P521_FALCON1024")))
oqs_oid_alg_list[68 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_FALCONPADDED1024")))
oqs_oid_alg_list[70 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P521_FALCONPADDED1024")))
oqs_oid_alg_list[72 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHA2128FSIMPLE")))
oqs_oid_alg_list[74 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128FSIMPLE")))
oqs_oid_alg_list[76 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128FSIMPLE")))
oqs_oid_alg_list[78 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHA2128SSIMPLE")))
oqs_oid_alg_list[80 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_SPHINCSSHA2128SSIMPLE")))
oqs_oid_alg_list[82 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHA2128SSIMPLE")))
oqs_oid_alg_list[84 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHA2192FSIMPLE")))
oqs_oid_alg_list[86 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P384_SPHINCSSHA2192FSIMPLE")))
oqs_oid_alg_list[88 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_SPHINCSSHAKE128FSIMPLE")))
oqs_oid_alg_list[90 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_P256_SPHINCSSHAKE128FSIMPLE")))
oqs_oid_alg_list[92 + OQS_KEMOID_CNT] = envval;
if ((envval = getenv("OQS_OID_RSA3072_SPHINCSSHAKE128FSIMPLE")))
oqs_oid_alg_list[94 + OQS_KEMOID_CNT] = envval;
} ///// OQS_TEMPLATE_FRAGMENT_OID_PATCHING_END
return 1;
}
Expand Down

0 comments on commit e784ed1

Please sign in to comment.