Commit f72d82f
committed
Constant-time: Make signature declassifications explicit in verification
Previously, the signature would be declassified in the end of
signing (which is the most common threat model).
However, for rare use cases the signature may be secret in which
case it is useful to know which part of the code has to be
adapted.
This commit removes the declassification from the end of signing,
explicitly marks the signature as secret in the constant time tests
(to also classify the previously declassified challenge c), and
then adds necessary declassifications in verifiation.
We may consider eliminating some of those declassifications later.
In particular, the data dependencies in use_hint are not hard to
eliminate (in fact, the native implementations are already constant
time). The final comparison of the challenges can also easily
be turned into a constant-time comparison.
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>1 parent 40ff385 commit f72d82f
2 files changed
+67
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | 619 | | |
624 | 620 | | |
625 | 621 | | |
| |||
874 | 870 | | |
875 | 871 | | |
876 | 872 | | |
| 873 | + | |
877 | 874 | | |
878 | 875 | | |
879 | 876 | | |
| |||
908 | 905 | | |
909 | 906 | | |
910 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
911 | 916 | | |
912 | 917 | | |
913 | 918 | | |
914 | 919 | | |
915 | 920 | | |
916 | | - | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
917 | 926 | | |
918 | 927 | | |
919 | 928 | | |
| |||
937 | 946 | | |
938 | 947 | | |
939 | 948 | | |
| 949 | + | |
| 950 | + | |
940 | 951 | | |
941 | 952 | | |
942 | 953 | | |
| |||
955 | 966 | | |
956 | 967 | | |
957 | 968 | | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
958 | 972 | | |
959 | 973 | | |
960 | 974 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
55 | | - | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
120 | 132 | | |
121 | 133 | | |
122 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
123 | 141 | | |
124 | 142 | | |
125 | 143 | | |
| |||
147 | 165 | | |
148 | 166 | | |
149 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
150 | 174 | | |
151 | 175 | | |
152 | 176 | | |
| |||
234 | 258 | | |
235 | 259 | | |
236 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
237 | 268 | | |
238 | 269 | | |
239 | 270 | | |
| |||
285 | 316 | | |
286 | 317 | | |
287 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
288 | 326 | | |
289 | 327 | | |
290 | 328 | | |
| |||
294 | 332 | | |
295 | 333 | | |
296 | 334 | | |
297 | | - | |
| 335 | + | |
298 | 336 | | |
299 | 337 | | |
300 | 338 | | |
| |||
337 | 375 | | |
338 | 376 | | |
339 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
340 | 385 | | |
341 | 386 | | |
342 | 387 | | |
| |||
346 | 391 | | |
347 | 392 | | |
348 | 393 | | |
349 | | - | |
| 394 | + | |
350 | 395 | | |
351 | 396 | | |
352 | 397 | | |
| |||
0 commit comments