Fix ArgumentException usage in BlockCipher (#818)

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
This commit is contained in:
Igor Milavec
2024-04-27 20:52:34 +02:00
committed by GitHub
parent c8b527397a
commit 4e1e2436af
@@ -78,7 +78,7 @@ namespace Renci.SshNet.Security.Cryptography
{
if (_padding is null)
{
throw new ArgumentException("data");
throw new ArgumentException(string.Format("The data block size is incorrect for {0}.", GetType().Name), "data");
}
var paddingLength = _blockSize - (length % _blockSize);
@@ -125,7 +125,7 @@ namespace Renci.SshNet.Security.Cryptography
{
if (_padding is null)
{
throw new ArgumentException("data");
throw new ArgumentException(string.Format("The data block size is incorrect for {0}.", GetType().Name), "data");
}
input = _padding.Pad(_blockSize, input, offset, length);