@@ -34,7 +34,25 @@ public interface IAuthenticatedEncryptor
3434 byte [ ] Encrypt ( ArraySegment < byte > plaintext , ArraySegment < byte > additionalAuthenticatedData ) ;
3535
3636#if NET10_0_OR_GREATER
37- int GetEncryptedSize ( int plainTextLength ) ;
38- bool TryEncrypt ( ReadOnlySpan < byte > plaintext , ReadOnlySpan < byte > additionalAuthenticatedData , Span < byte > destination , out int bytesWritten ) ;
37+ /// <summary>
38+ /// Returns the size of the encrypted data for a given plaintext length.
39+ /// </summary>
40+ /// <param name="plainTextLength">Length of the plain text that will be encrypted later</param>
41+ /// <returns>The length of the encrypted data</returns>
42+ internal int GetEncryptedSize ( int plainTextLength ) ;
43+
44+ /// <summary>
45+ /// Attempts to encrypt and tamper-proof a piece of data.
46+ /// </summary>
47+ /// <param name="plaintext">The input to encrypt.</param>
48+ /// <param name="additionalAuthenticatedData">
49+ /// A piece of data which will not be included in
50+ /// the returned ciphertext but which will still be covered by the authentication tag.
51+ /// This input may be zero bytes in length. The same AAD must be specified in the corresponding decryption call.
52+ /// </param>
53+ /// <param name="destination">The ciphertext blob, including authentication tag.</param>
54+ /// <param name="bytesWritten">When this method returns, the total number of bytes written into destination</param>
55+ /// <returns>true if destination is long enough to receive the encrypted data; otherwise, false.</returns>
56+ internal bool TryEncrypt ( ReadOnlySpan < byte > plaintext , ReadOnlySpan < byte > additionalAuthenticatedData , Span < byte > destination , out int bytesWritten ) ;
3957#endif
4058}
0 commit comments