-
I means that the plaintext and ciphertext buffer are same buffer. Use case: using var aes = new AesGcm(...);
var buffer = new byte[64];
var tag = new byte[16];
aes.Encrypt(
nonce: ...,
plaintext: buffer,
ciphertext: buffer,
tag: tag
); And how can I determine if an algorithm is supports in-place operation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@dotnet/area-System-Security |
Beta Was this translation helpful? Give feedback.
-
Yes, it's a thing we explicitly test for. runtime/src/libraries/System.Security.Cryptography/tests/AesGcmTests.cs Lines 337 to 354 in 0c513d9 I believe that all of our cryptographic routines allow the plaintext and ciphertext to be the same buffer. My recollection was that we made "overlapping, but with an offset fail", but it has already been pointed out to me that sometimes we make that work. |
Beta Was this translation helpful? Give feedback.
Yes, it's a thing we explicitly test for.
runtime/src/libraries/System.Security.Cryptography/tests/AesGcmTests.cs
Lines 337 to 354 in 0c513d9