Commit d6a3b3b
committed
evp: skip padding propagation for AEAD and stream cipher modes
On the cipher init path EVP_CIPHER_CTX_set_padding(ctx, 0) was issued
whenever the EVP_CIPH_NO_PADDING flag was set, regardless of mode. For
AEAD and stream ciphers padding is meaningless and the provider ignores
the setting, so this is a redundant OSSL_PARAM round-trip on every
init/re-init. Restrict the propagation to the block-oriented ECB and CBC
modes, where padding is meaningful; behaviour for paddable ciphers is
unchanged.
This mainly benefits small-buffer AEAD workloads that reinitialise the
context per operation.1 parent a8b5741 commit d6a3b3b
1 file changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
157 | 159 | | |
158 | | - | |
159 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
160 | 165 | | |
161 | | - | |
| 166 | + | |
| 167 | + | |
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| |||
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
| 333 | + | |
| 334 | + | |
327 | 335 | | |
328 | | - | |
329 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
330 | 341 | | |
331 | | - | |
| 342 | + | |
| 343 | + | |
332 | 344 | | |
333 | 345 | | |
334 | 346 | | |
| |||
0 commit comments