Commit 3f282aa
authored
AES-XTS on AArch64: Set w19 earlier before cipher-stealing of 1 block + tail. (#2785)
w19 was set to its fixed value 0x87 after the code jumps to the case of
cipher stealing of 1 block and a tail.
- This bug was introduced in
[v1.62](https://github.com/aws/aws-lc/releases/tag/v1.62.0) in "Move
udiv and sencond tweak calculations to when needed" by
[@nebeid](https://github.com/nebeid) in
[#2726](#2726) where the setting of
w19 was moved past the branch to `.Lxts_enc_tail1x`.
- Also the 3 test vectors that tested 1 block + tail were not lucky
enough to exercise this issue which happens when the encrypted tweak,
when shifted left by 1, results in a bit of 1, which, in turn, results
in XORing the value 0x87 with the tweak.
Testing:
Added test vectors that failed with this bug (exercise the key/iv combination causing the failure) and now pass with the fix.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.1 parent 2a84d5b commit 3f282aa
File tree
2 files changed
+25
-1
lines changed- crypto/fipsmodule/modes
- third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes
2 files changed
+25
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
241 | 253 | | |
242 | 254 | | |
243 | 255 | | |
| |||
290 | 302 | | |
291 | 303 | | |
292 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
293 | 317 | | |
294 | 318 | | |
295 | 319 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments