Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions mldsa/src/sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,10 @@ __contract__(
* Consequently, any value that can be computed from the signature and public
* key is considered public.
* w0 and w1 are public as they can be computed from Az - ct = \alpha w1 + w0.
* h=c*t0 is public as both c and t0 are public.
* For a more detailed discussion, refer to https://eprint.iacr.org/2022/1406.
* h=c*t0 is public as both c and t0 are considered public.
* While t0 is not part of the public key, it can be reconstructed from
* a small number of signatures and need not be regarded as secret
* (see @[FIPS204, Section 6.1]).
*/
MLD_CT_TESTING_DECLASSIFY(w0, sizeof(*w0));
MLD_CT_TESTING_DECLASSIFY(w1, sizeof(*w1));
Expand Down Expand Up @@ -1012,7 +1014,10 @@ int mld_sign(uint8_t *sm, size_t *smlen, const uint8_t *m, size_t mlen,
}
ret = mld_sign_signature(sm, smlen, sm + MLDSA_CRYPTO_BYTES, mlen, ctx,
ctxlen, sk, context);
*smlen += mlen;
if (ret == 0)
Comment thread
mkannwischer marked this conversation as resolved.
{
*smlen += mlen;
}
return ret;
}
#endif /* !MLD_CONFIG_NO_RANDOMIZED_API */
Expand Down
6 changes: 3 additions & 3 deletions mldsa/src/sign.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ __contract__(
assigns(memory_slice(sm, MLDSA_CRYPTO_BYTES + mlen))
assigns(object_whole(smlen))
ensures((return_value == 0 && *smlen == MLDSA_CRYPTO_BYTES + mlen) ||
(return_value == MLD_ERR_FAIL
|| return_value == MLD_ERR_OUT_OF_MEMORY
|| return_value == MLD_ERR_RNG_FAIL))
((return_value == MLD_ERR_FAIL
|| return_value == MLD_ERR_OUT_OF_MEMORY
|| return_value == MLD_ERR_RNG_FAIL) && *smlen == 0))
);
#endif /* !MLD_CONFIG_CORE_API_ONLY */
#endif /* !MLD_CONFIG_NO_SIGN_API */
Expand Down
Loading