mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-04 00:02:01 -04:00
Update SLH-DSA template to fix addrnd sizes [extended tests]
Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
This commit is contained in:
parent
034dec9122
commit
22527713f5
@ -56,8 +56,8 @@ OQS_API OQS_STATUS OQS_SIG_slh_dsa_pure_{{hashAlg}}_{{paramSet}}_sign(uint8_t *s
|
||||
const slh_param_t *prm = &slh_dsa_{{hashAlg}}_{{paramSet}};
|
||||
const uint8_t *ctx = NULL;
|
||||
const size_t ctxlen = 0;
|
||||
uint8_t addrnd[32];
|
||||
OQS_randombytes(addrnd, 32);
|
||||
uint8_t addrnd[{{pkSize // 2}}];
|
||||
OQS_randombytes(addrnd, {{pkSize // 2}});
|
||||
|
||||
*signature_len = slh_sign(signature, message, message_len, ctx, ctxlen,
|
||||
secret_key, addrnd, prm);
|
||||
@ -90,8 +90,8 @@ OQS_API OQS_STATUS OQS_SIG_slh_dsa_pure_{{hashAlg}}_{{paramSet}}_sign_with_ctx_s
|
||||
size_t ctx_str_len, const uint8_t *secret_key) {
|
||||
|
||||
const slh_param_t *prm = &slh_dsa_{{hashAlg}}_{{paramSet}};
|
||||
uint8_t addrnd[32];
|
||||
OQS_randombytes(addrnd, 32);
|
||||
uint8_t addrnd[{{pkSize // 2}}];
|
||||
OQS_randombytes(addrnd, {{pkSize // 2}});
|
||||
|
||||
*signature_len = slh_sign(signature, message, message_len, ctx_str, ctx_str_len,
|
||||
secret_key, addrnd, prm);
|
||||
@ -165,8 +165,8 @@ OQS_API OQS_STATUS OQS_SIG_slh_dsa_{{prehashHashAlg}}_prehash_{{hashAlg}}_{{para
|
||||
const char *ph = "{{ prehashString|replace('_', '-')|upper }}";
|
||||
const uint8_t *ctx_str = NULL;
|
||||
const size_t ctx_str_len = 0;
|
||||
uint8_t addrnd[32];
|
||||
OQS_randombytes(addrnd, 32);
|
||||
uint8_t addrnd[{{pkSize // 2}}];
|
||||
OQS_randombytes(addrnd, {{pkSize // 2}});
|
||||
|
||||
*signature_len = hash_slh_sign(signature, message, message_len, ctx_str,
|
||||
ctx_str_len, ph, secret_key, addrnd, prm);
|
||||
@ -200,8 +200,8 @@ OQS_API OQS_STATUS OQS_SIG_slh_dsa_{{prehashHashAlg}}_prehash_{{hashAlg}}_{{para
|
||||
|
||||
const slh_param_t *prm = &slh_dsa_{{hashAlg}}_{{paramSet}};
|
||||
const char *ph = "{{ prehashString|replace('_', '-')|upper }}";
|
||||
uint8_t addrnd[32];
|
||||
OQS_randombytes(addrnd, 32);
|
||||
uint8_t addrnd[{{pkSize // 2}}];
|
||||
OQS_randombytes(addrnd, {{pkSize // 2}});
|
||||
|
||||
*signature_len = hash_slh_sign(signature, message, message_len, ctx_str,
|
||||
ctx_str_len, ph, secret_key, addrnd, prm);
|
||||
|
@ -92,8 +92,8 @@ OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha2_512_224_prehash_shake_192f_sign_with_ctx
|
||||
|
||||
const slh_param_t *prm = &slh_dsa_shake_192f;
|
||||
const char *ph = "SHA2-512/224";
|
||||
uint8_t addrnd[32];
|
||||
OQS_randombytes(addrnd, 32);
|
||||
uint8_t addrnd[24];
|
||||
OQS_randombytes(addrnd, 24);
|
||||
|
||||
*signature_len = hash_slh_sign(signature, message, message_len, ctx_str,
|
||||
ctx_str_len, ph, secret_key, addrnd, prm);
|
||||
|
@ -92,8 +92,8 @@ OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha2_512_224_prehash_shake_192s_sign_with_ctx
|
||||
|
||||
const slh_param_t *prm = &slh_dsa_shake_192s;
|
||||
const char *ph = "SHA2-512/224";
|
||||
uint8_t addrnd[32];
|
||||
OQS_randombytes(addrnd, 32);
|
||||
uint8_t addrnd[24];
|
||||
OQS_randombytes(addrnd, 24);
|
||||
|
||||
*signature_len = hash_slh_sign(signature, message, message_len, ctx_str,
|
||||
ctx_str_len, ph, secret_key, addrnd, prm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user