Skip to content

Commit

Permalink
Add key-type specific en- / decoder
Browse files Browse the repository at this point in the history
Signed-off-by: Wolfgang Beck <[email protected]>
  • Loading branch information
wbeck10 committed Dec 20, 2024
1 parent 92c5639 commit d459963
Show file tree
Hide file tree
Showing 12 changed files with 2,277 additions and 4,314 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ MAKE_DECODER({% if hybrid['hybrid_group'].startswith('x') %}_ecx{% else %}_ecp{%

{% for sig in config['sigs'] %}
{%- for variant in sig['variants'] %}
MAKE_DECODER(, "{{ variant['name'] }}", {{ variant['name'] }}, oqsx, type_specific_keypair);
MAKE_DECODER(, "{{ variant['name'] }}", {{ variant['name'] }}, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "{{ variant['name'] }}", {{ variant['name'] }}, oqsx, SubjectPublicKeyInfo);
{%- for classical_alg in variant['mix_with'] %}
MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, type_specific_keypair);
MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectPublicKeyInfo);
{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, type_specific_keypair);
MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo);
{%- endfor -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ MAKE_TEXT_ENCODER({% if hybrid['hybrid_group'].startswith('x') %}_ecx{% else %}_
#endif /* OQS_KEM_ENCODERS */
{% for sig in config['sigs'] %}
{%- for variant in sig['variants'] %}
MAKE_ENCODER(, {{ variant['name'] }}, oqsx, type_specific_keypair, der);
MAKE_ENCODER(, {{ variant['name'] }}, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, {{ variant['name'] }}, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, {{ variant['name'] }}, oqsx, PrivateKeyInfo, der);
Expand All @@ -30,6 +31,7 @@ MAKE_ENCODER(, {{ variant['name'] }}, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, {{ variant['name'] }}, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, {{ variant['name'] }});
{%- for classical_alg in variant['mix_with'] %}
MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, type_specific_keypair, der);
MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, PrivateKeyInfo, der);
Expand All @@ -39,6 +41,7 @@ MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectP
MAKE_TEXT_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }});
{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, type_specific_keypair, der);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo, der);
Expand Down
224 changes: 76 additions & 148 deletions oqsprov/oqs_decode_der2key.c

Large diffs are not rendered by default.

Loading

0 comments on commit d459963

Please sign in to comment.