Commit e1f5468
committed
SLH-DSA Wconversion: review fixes
Address review findings from the previous commit:
- wc_slhdsa.c:1681: replace the (incorrect) mask comment with a comment
on the actual word16 cast. baseb is word16* and FORS values reach 14
bits (parameter a), so the original (byte) cast silently truncated.
- wc_slhdsa.c:57-59: revert SLHDSA_W / SLHDSA_WM1 to plain int. The U
suffix forced cascaded (int)SLHDSA_WM1, (sword8)SLHDSA_WM1 and
(byte)(SLHDSA_WM1 - x) casts at every signed-comparison site without
saving anything. The (word16) cast at the WOTS+ csum / mask
assignment is sufficient.
- wc_slhdsa.c: drop (int)SLHDSA_WM1 at three call sites in
slhdsakey_chain_idx_to_max_{16,24,32}, made redundant by the WM1
revert.
- wc_slhdsa.c: unify (word32)1U shift form across all eight call
sites; the previous commit changed only four of them.
- wc_slhdsa.c:8305, 8340: switch ExportPrivate / ExportPublic n back
to byte to match every other internal use of params->n.
- wc_slhdsa.c:127: add wc_static_assert(SLHDSA_MAX_MSG_SZ <= 255) to
document the invariant that the WOTS+ chain helpers' (byte)i and
(byte)j casts depend on (max len for current parameter sets is
2*32+3 = 67).
- wc_slhdsa.c:4315-4320: deduplicate the csum-word16 explanatory
comment; the second copy now defers to the first.
- wolfCrypt-Wconversion.yml: bump build_library and
test_slhdsa_runtime timeout-minutes from 6 to 10. SLH-DSA adds
~9 kLoC to every row and the 32-bit multilib + smallstack rows
need headroom.
All five representative build rows still compile clean
(default, intelasm, smallstack, sha2, small-mem, verify-only-32bit).
All five test_slhdsa_runtime configs still pass slhdsa_test().
https://claude.ai/code/session_01EJmy1bKDgHseTwZ5Qqpu1g1 parent b9a192b commit e1f5468
2 files changed
Lines changed: 34 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
| |||
1666 | 1671 | | |
1667 | 1672 | | |
1668 | 1673 | | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
| 1674 | + | |
1673 | 1675 | | |
1674 | 1676 | | |
1675 | 1677 | | |
1676 | 1678 | | |
1677 | 1679 | | |
1678 | 1680 | | |
1679 | 1681 | | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1680 | 1686 | | |
1681 | 1687 | | |
1682 | 1688 | | |
| |||
3800 | 3806 | | |
3801 | 3807 | | |
3802 | 3808 | | |
3803 | | - | |
3804 | | - | |
| 3809 | + | |
| 3810 | + | |
3805 | 3811 | | |
3806 | 3812 | | |
3807 | 3813 | | |
| |||
3874 | 3880 | | |
3875 | 3881 | | |
3876 | 3882 | | |
3877 | | - | |
3878 | | - | |
| 3883 | + | |
| 3884 | + | |
3879 | 3885 | | |
3880 | 3886 | | |
3881 | 3887 | | |
| |||
3948 | 3954 | | |
3949 | 3955 | | |
3950 | 3956 | | |
3951 | | - | |
3952 | | - | |
| 3957 | + | |
| 3958 | + | |
3953 | 3959 | | |
3954 | 3960 | | |
3955 | 3961 | | |
| |||
4311 | 4317 | | |
4312 | 4318 | | |
4313 | 4319 | | |
4314 | | - | |
4315 | | - | |
4316 | | - | |
4317 | | - | |
4318 | | - | |
| 4320 | + | |
| 4321 | + | |
4319 | 4322 | | |
4320 | 4323 | | |
4321 | 4324 | | |
| |||
4746 | 4749 | | |
4747 | 4750 | | |
4748 | 4751 | | |
4749 | | - | |
| 4752 | + | |
4750 | 4753 | | |
4751 | 4754 | | |
4752 | 4755 | | |
| |||
4846 | 4849 | | |
4847 | 4850 | | |
4848 | 4851 | | |
4849 | | - | |
| 4852 | + | |
4850 | 4853 | | |
4851 | 4854 | | |
4852 | 4855 | | |
| |||
6663 | 6666 | | |
6664 | 6667 | | |
6665 | 6668 | | |
6666 | | - | |
| 6669 | + | |
6667 | 6670 | | |
6668 | 6671 | | |
6669 | 6672 | | |
| |||
6672 | 6675 | | |
6673 | 6676 | | |
6674 | 6677 | | |
6675 | | - | |
| 6678 | + | |
6676 | 6679 | | |
6677 | 6680 | | |
6678 | 6681 | | |
| |||
8301 | 8304 | | |
8302 | 8305 | | |
8303 | 8306 | | |
8304 | | - | |
| 8307 | + | |
8305 | 8308 | | |
8306 | 8309 | | |
8307 | | - | |
8308 | | - | |
| 8310 | + | |
| 8311 | + | |
8309 | 8312 | | |
8310 | 8313 | | |
8311 | 8314 | | |
| |||
8336 | 8339 | | |
8337 | 8340 | | |
8338 | 8341 | | |
8339 | | - | |
| 8342 | + | |
8340 | 8343 | | |
8341 | 8344 | | |
8342 | | - | |
8343 | | - | |
| 8345 | + | |
| 8346 | + | |
8344 | 8347 | | |
8345 | 8348 | | |
8346 | 8349 | | |
| |||
0 commit comments