Skip to content

Commit

Permalink
Adding _with_ctx_str APIs, templating
Browse files Browse the repository at this point in the history
Signed-off-by: Basil Hess <[email protected]>
  • Loading branch information
bhess committed Nov 4, 2024
1 parent e5541da commit de46572
Show file tree
Hide file tree
Showing 51 changed files with 458 additions and 595 deletions.
3 changes: 1 addition & 2 deletions scripts/copy_from_upstream/copy_from_upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ upstreams:
git_commit: 444cdcc84eb36b66fe27b3a2529ee48f6d8150c2
sig_meta_path: '{pretty_name_full}_META.yml'
sig_scheme_path: '.'
patches: [pqcrystals-ml_dsa-internal4.patch]
#patches: [pqcrystals-ml_dsa.patch]
patches: [pqcrystals-ml_dsa.patch]
-
name: pqmayo
git_url: https://github.com/PQCMayo/MAYO-C.git
Expand Down
604 changes: 96 additions & 508 deletions scripts/copy_from_upstream/patches/pqcrystals-ml_dsa.patch

Large diffs are not rendered by default.

9 changes: 9 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 @@ -6,6 +6,7 @@
#include <oqs/oqs.h>

{% for scheme in schemes -%}
{%- set default_impl = scheme['metadata']['implementations'] | selectattr("name", "equalto", scheme['default_implementation']) | first -%}
#if defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}){%- endif %}
#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'] }}
Expand All @@ -15,6 +16,10 @@ 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);
OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key);
OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key);
{%- if 'api-with-context-string' in default_impl and default_impl['api-with-context-string'] %}
OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign_with_ctx_str(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *ctx, size_t ctxlen, const uint8_t *secret_key);
OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify_with_ctx_str(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *ctx, size_t ctxlen, const uint8_t *public_key);
{%- endif %}
{% if 'alias_scheme' in scheme %}
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_length_public_key OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_length_public_key
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_length_secret_key OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_length_secret_key
Expand All @@ -23,6 +28,10 @@ OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_new(void);
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_keypair OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_keypair
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_sign OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_verify OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify
{%- if 'api-with-context-string' in default_impl and default_impl['api-with-context-string'] %}
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_sign_with_ctx_str OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign
#define OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_verify_with_ctx_str OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify
{%- endif %}
{% endif -%}
#endif

Expand Down
87 changes: 87 additions & 0 deletions scripts/copy_from_upstream/src/sig/family/sig_scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{% if 'alias_scheme' in scheme %}
#if defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }})
{% endif %}
{%- set default_impl = scheme['metadata']['implementations'] | selectattr("name", "equalto", scheme['default_implementation']) | first -%}
OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -28,6 +29,13 @@ OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_new(void) {
sig->keypair = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_keypair;
sig->sign = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign;
sig->verify = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify;
{%- if 'api-with-context-string' in default_impl and default_impl['api-with-context-string'] %}
sig->sign_with_ctx_str = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign_with_ctx_str;
sig->verify_with_ctx_str = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify_with_ctx_str;
{%- else %}
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;
{%- endif %}

return sig;
}
Expand Down Expand Up @@ -58,6 +66,13 @@ OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_new(void) {
sig->keypair = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_keypair;
sig->sign = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign;
sig->verify = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify;
{%- if 'api-with-context-string' in default_impl and default_impl['api-with-context-string'] %}
sig->sign_with_ctx_str = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign_with_ctx_str;
sig->verify_with_ctx_str = OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify_with_ctx_str;
{%- else %}
sig->sign_with_ctx_str = NULL
sig->verify_with_ctx_str = NULL;
{%- endif %}

return sig;
}
Expand Down Expand Up @@ -257,5 +272,77 @@ OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify(const uint
{%- endif %}
}

{%- set default_impl = scheme['metadata']['implementations'] | selectattr("name", "equalto", scheme['default_implementation']) | first %}
{%- if 'api-with-context-string' in default_impl and default_impl['api-with-context-string'] %}
OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_sign_with_ctx_str(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *secret_key) {
{%- for impl in scheme['metadata']['implementations'] if impl['name'] != scheme['default_implementation'] %}
{%- if loop.first %}
#if defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
{%- else %}
#elif defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
{%- endif %}
{%- if 'required_flags' in impl and impl['required_flags'] %}
#if defined(OQS_DIST_BUILD)
if ({%- for flag in impl['required_flags'] -%}OQS_CPU_has_extension(OQS_CPU_EXT_{{ flag|upper }}){%- if not loop.last %} && {% endif -%}{%- endfor -%}) {
#endif /* OQS_DIST_BUILD */
{%- endif %}
{%- if impl['signature_signature'] %}
return (OQS_STATUS) {{ impl['signature_signature'] }}(signature, signature_len, message, message_len, ctx_str, ctx_str_len, secret_key);
{%- else %}
return (OQS_STATUS) PQCLEAN_{{ scheme['pqclean_scheme_c']|upper }}_{{ impl['name']|upper }}_crypto_sign_signature(signature, signature_len, message, message_len, ctx_str, ctx_str_len, secret_key);
{%- endif %}
{%- if 'required_flags' in impl and impl['required_flags'] %}
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) {{ scheme['metadata']['default_signature_signature'] }}(signature, signature_len, message, message_len, ctx_str, ctx_str_len, secret_key);
}
#endif /* OQS_DIST_BUILD */
{%- endif %}
{%- endfor %}
{%- if scheme['metadata']['implementations']|rejectattr('name', 'equalto', scheme['default_implementation'])|list %}
#else
{%- endif %}
{%- set default_impl = scheme['metadata']['implementations'] | selectattr("name", "equalto", scheme['default_implementation']) | first %}
return (OQS_STATUS) {{ scheme['metadata']['default_signature_signature'] }}(signature, signature_len, message, message_len, ctx_str, ctx_str_len, secret_key);
{%- if scheme['metadata']['implementations']|rejectattr('name', 'equalto', scheme['default_implementation'])|list %}
#endif
{%- endif %}
}

OQS_API OQS_STATUS OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_verify_with_ctx_str(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *public_key) {
{%- for impl in scheme['metadata']['implementations'] if impl['name'] != scheme['default_implementation'] %}
{%- if loop.first %}
#if defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
{%- else %}
#elif defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}_{{ impl['name'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}_{{ impl['name'] }}){%- endif %}
{%- endif %}
{%- if 'required_flags' in impl and impl['required_flags'] %}
#if defined(OQS_DIST_BUILD)
if ({%- for flag in impl['required_flags'] -%}OQS_CPU_has_extension(OQS_CPU_EXT_{{ flag|upper }}){%- if not loop.last %} && {% endif -%}{%- endfor -%}) {
#endif /* OQS_DIST_BUILD */
{%- endif %}
{%- if impl['signature_verify'] %}
return (OQS_STATUS) {{ impl['signature_verify'] }}(signature, signature_len, message, message_len, ctx_str, ctx_str_len, public_key);
{%- else %}
return (OQS_STATUS) PQCLEAN_{{ scheme['pqclean_scheme_c']|upper }}_{{ impl['name']|upper }}_crypto_sign_verify(signature, signature_len, message, message_len, ctx_str, ctx_str_len, public_key);
{%- endif %}
{%- if 'required_flags' in impl and impl['required_flags'] %}
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) {{ scheme['metadata']['default_verify_signature'] }}(signature, signature_len, message, message_len, ctx_str, ctx_str_len, public_key);
}
#endif /* OQS_DIST_BUILD */
{%- endif %}
{%- endfor %}
{%- if scheme['metadata']['implementations']|rejectattr('name', 'equalto', scheme['default_implementation'])|list %}
#else
{%- endif %}
{%- set default_impl = scheme['metadata']['implementations'] | selectattr("name", "equalto", scheme['default_implementation']) | first %}
return (OQS_STATUS) {{ scheme['metadata']['default_verify_signature'] }}(signature, signature_len, message, message_len, ctx_str, ctx_str_len, public_key);
{%- if scheme['metadata']['implementations']|rejectattr('name', 'equalto', scheme['default_implementation'])|list %}
#endif
{%- endif %}
}
{%- endif %}
#endif
{% endfor -%}
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_128_balanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_128_balanced)

OQS_SIG *OQS_SIG_cross_rsdp_128_balanced_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_balanced_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_128_balanced_keypair;
sig->sign = OQS_SIG_cross_rsdp_128_balanced_sign;
sig->verify = OQS_SIG_cross_rsdp_128_balanced_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_balanced_verify(const uint8_t *message
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_128_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_128_fast)

OQS_SIG *OQS_SIG_cross_rsdp_128_fast_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_fast_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_128_fast_keypair;
sig->sign = OQS_SIG_cross_rsdp_128_fast_sign;
sig->verify = OQS_SIG_cross_rsdp_128_fast_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_fast_verify(const uint8_t *message, si
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_128_small.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_128_small)

OQS_SIG *OQS_SIG_cross_rsdp_128_small_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_small_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_128_small_keypair;
sig->sign = OQS_SIG_cross_rsdp_128_small_sign;
sig->verify = OQS_SIG_cross_rsdp_128_small_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_small_verify(const uint8_t *message, s
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_192_balanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_192_balanced)

OQS_SIG *OQS_SIG_cross_rsdp_192_balanced_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_balanced_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_192_balanced_keypair;
sig->sign = OQS_SIG_cross_rsdp_192_balanced_sign;
sig->verify = OQS_SIG_cross_rsdp_192_balanced_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_balanced_verify(const uint8_t *message
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_192_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_192_fast)

OQS_SIG *OQS_SIG_cross_rsdp_192_fast_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_fast_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_192_fast_keypair;
sig->sign = OQS_SIG_cross_rsdp_192_fast_sign;
sig->verify = OQS_SIG_cross_rsdp_192_fast_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_fast_verify(const uint8_t *message, si
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_192_small.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_192_small)

OQS_SIG *OQS_SIG_cross_rsdp_192_small_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_small_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_192_small_keypair;
sig->sign = OQS_SIG_cross_rsdp_192_small_sign;
sig->verify = OQS_SIG_cross_rsdp_192_small_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_small_verify(const uint8_t *message, s
return (OQS_STATUS) PQCLEAN_CROSSRSDP192SMALL_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_256_balanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_256_balanced)

OQS_SIG *OQS_SIG_cross_rsdp_256_balanced_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_256_balanced_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_256_balanced_keypair;
sig->sign = OQS_SIG_cross_rsdp_256_balanced_sign;
sig->verify = OQS_SIG_cross_rsdp_256_balanced_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_256_balanced_verify(const uint8_t *message
return (OQS_STATUS) PQCLEAN_CROSSRSDP256BALANCED_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_256_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_256_fast)

OQS_SIG *OQS_SIG_cross_rsdp_256_fast_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_256_fast_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_256_fast_keypair;
sig->sign = OQS_SIG_cross_rsdp_256_fast_sign;
sig->verify = OQS_SIG_cross_rsdp_256_fast_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_256_fast_verify(const uint8_t *message, si
return (OQS_STATUS) PQCLEAN_CROSSRSDP256FAST_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdp_256_small.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdp_256_small)

OQS_SIG *OQS_SIG_cross_rsdp_256_small_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_256_small_new(void) {
sig->keypair = OQS_SIG_cross_rsdp_256_small_keypair;
sig->sign = OQS_SIG_cross_rsdp_256_small_sign;
sig->verify = OQS_SIG_cross_rsdp_256_small_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_256_small_verify(const uint8_t *message, s
return (OQS_STATUS) PQCLEAN_CROSSRSDP256SMALL_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
4 changes: 2 additions & 2 deletions src/sig/cross/sig_cross_rsdpg_128_balanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <oqs/sig_cross.h>

#if defined(OQS_ENABLE_SIG_cross_rsdpg_128_balanced)

OQS_SIG *OQS_SIG_cross_rsdpg_128_balanced_new(void) {

OQS_SIG *sig = malloc(sizeof(OQS_SIG));
Expand All @@ -25,6 +24,8 @@ OQS_SIG *OQS_SIG_cross_rsdpg_128_balanced_new(void) {
sig->keypair = OQS_SIG_cross_rsdpg_128_balanced_keypair;
sig->sign = OQS_SIG_cross_rsdpg_128_balanced_sign;
sig->verify = OQS_SIG_cross_rsdpg_128_balanced_verify;
sig->sign_with_ctx_str = NULL;
sig->verify_with_ctx_str = NULL;

return sig;
}
Expand Down Expand Up @@ -86,5 +87,4 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdpg_128_balanced_verify(const uint8_t *messag
return (OQS_STATUS) PQCLEAN_CROSSRSDPG128BALANCED_CLEAN_crypto_sign_verify(signature, signature_len, message, message_len, public_key);
#endif
}

#endif
Loading

0 comments on commit de46572

Please sign in to comment.