-
Notifications
You must be signed in to change notification settings - Fork 277
Description
CBMC version 6.7.1
Repository: https://github.com/pq-code-package/mldsa-native.git
Branch: cbmc-prove_signature_internal
File: mldsa/sign.c
Function: crypto_sign_signature_internal()
Link to specific source code: https://github.com/pq-code-package/mldsa-native/blob/d5c85f8c6ed0bd04b9f875ca0c3a902458d6b39f/mldsa/sign.c#L265
This function implements the top-level signature generation algorithm of mldsa-native.
It implements a "rejection sampling" loop - various things are calculated, then validity checks are applied. If these fail, then a "continue" statement goes back to the top of the loop to try again.
We have been developing a proof by commenting-out the loop body, then re-introducing the code one line at a time.
Problem: the first instance of a "continue" statement causes the proof complexity/time to blow up.
See the code at the link above. With the final un-commented line as:
z_invalid = polyvecl_chknorm(&z, MLDSA_GAMMA1 - MLDSA_BETA);
and no more, then:
cd proofs/cbmc/crypto_sign_signature_internal
time make result
completes successfully in 56s, which is OK.
If I un-comment the next statement:
if (z_invalid)
{
/* reject */
continue;
}
and try again, then the proof does not terminate in any reasonable time.
In the former case, the SMT2 file is about 13 Megabytes. In the latter, it grows to 21 Megabytes.