File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313#include "wrap_mldsa_native.h"
1414#include <mbedtls/platform_util.h>
1515
16+ /* The size of an ML-DSA seed in bytes.
17+ * The PSA API uses the seed as the private key.
18+ * (Some other ML-DSA interfaces use the "expanded secret", which is
19+ * derived from the seed, as the private key.)
20+ */
21+ #define SEED_SIZE 32
22+
1623/* For now, hard-coded values for MLDSA-87 */
1724#define TF_PSA_CRYPTO_MLDSA_EXPANDED_SECRET_MAX_SIZE MLDSA87_SECRETKEYBYTES
1825#define TF_PSA_CRYPTO_MLDSA_PUBLIC_KEY_MAX_SIZE MLDSA87_PUBLICKEYBYTES
@@ -39,7 +46,7 @@ static psa_status_t seed_to_public_key(
3946 const uint8_t * key_buffer , size_t key_buffer_size ,
4047 uint8_t * data , size_t data_size , size_t * data_length )
4148{
42- if (key_buffer_size != 32 ) {
49+ if (key_buffer_size != SEED_SIZE ) {
4350 return PSA_ERROR_INVALID_ARGUMENT ;
4451 }
4552
@@ -108,7 +115,7 @@ psa_status_t tf_psa_crypto_mldsa_sign_message(
108115 }
109116 size_t actual_signature_length = MLDSA87_BYTES ;
110117
111- if (key_buffer_size != 32 ) {
118+ if (key_buffer_size != SEED_SIZE ) {
112119 return PSA_ERROR_INVALID_ARGUMENT ;
113120 }
114121
You can’t perform that action at this time.
0 commit comments