- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit74cafe7
authored
Fix over-zeroing of destination buffer with PaddingMode.Zeros
This addresses two issues with how zero padding is handled.The first is performance. When applying zero padding, we were clearingthe entire destination, then copying the plaintext over it. We werezeroing more data than required, the only data that needed to be zeroedis where the zero padding is applied.The second is in the case of overlapping buffers for the plaintextand ciphertext. However, this cannot happen currently since we alwaysensure the destination buffer does not overlap the input buffer.If overlapping is permitted in a future change, this would clear theplaintext, not just where padding is required.1 parent28cff50 commit74cafe7
File tree
1 file changed
+1
-1
lines changed- src/libraries/Common/src/Internal/Cryptography
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | 171 | | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
0 commit comments
Comments
(0)