Refactor mlk_polymat_permute_bitrev_to_custom#1336
Refactor mlk_polymat_permute_bitrev_to_custom#1336mkannwischer wants to merge 2 commits intomainfrom
Conversation
18ed177 to
28046a2
Compare
|
This proves fine in a couple of seconds for MLKEM_K=3, but spins forever for MLKEM_K=2 and MLKEM_K=4: Makes no sense to me. |
|
Since we introduced struct wrappers around mlk_polyvec and mlk_polymat, the latter is now a struct that contains a K-element array of structs, each of which contains a single K-element array of mlk_poly. This new code is trying to treat that as a single-dimensional array of K*K mlk_poly's by the look of it. That's bound to cause serious complications for CBMC. Try a nested loop, so the code structure matches the data structure. |
cc0d751 to
782e470
Compare
|
@mkannwischer Can you comment on state/plans for this? |
See pq-code-package/mldsa-native#770 - we are waiting for diffblue/cbmc#8705 to be merged. @willieyz, could you rebase this PR and also include the experimental branch of CBMC so we can confirm that the proofs pass with that version. |
Yes, I can do it. |
6ce031c to
1745ecc
Compare
This commit refactors mlk_polymat_permute_bitrev_to_custom to not require the helper function mlk_polyvec_permute_bitrev_to_custom. The function was only needed due CBMC limitations. Also updates CBMC to trial new build (CBMC PR[#8705](https://github.com/pq-code-package/mlkem-native/issues/8705)) that solves performance problem for this proof. Simplify polymat_permite_bitrev_to_customer() (native version) The code structure now mimics the data structure to make proof tractable. Also updates Makefile for this proof in line with the similar function in mldsa-native. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu> Signed-off-by: Rod Chapman <rodchap@amazon.com> Signed-off-by: willieyz <willie.zhao@chelpis.com>
Signed-off-by: willieyz <willie.zhao@chelpis.com>
1745ecc to
d5b04b1
Compare
|
This seems no longer relevant; closing. @mkannwischer reopen if you disagree and foresee time to work on this. |
Why is this no longer relevant? I still want to do this refactoring as soon as the CBMC fix has been merged. |
|
Agree. We will return to this when we get a new release of CBMC. The helper function could be removed if and when CBMC can handle a nested loop efficiently. |
mlk_polymat_permute_bitrev_to_customand prove monolithically #1375This commit refactors mlk_polymat_permute_bitrev_to_custom to not require the helper function mlk_polyvec_permute_bitrev_to_custom. The function was only needed due CBMC limitations.