Skip to content

Commit 5e10c3d

Browse files
authored
Merge pull request #37 from PandaTechAM/development
On empty Aes256 Siv return null instead of throwing
2 parents 69ddc33 + a52f324 commit 5e10c3d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Pandatech.Crypto/Helpers/Aes256Siv.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public static string Decrypt(byte[] ciphertext, string? key) =>
4747

4848
public static byte[] DecryptToBytes(byte[] ciphertext, string? key)
4949
{
50+
if (ciphertext.Length < 16)
51+
{
52+
return [];
53+
}
54+
5055
var keyBytes = GetKeyBytes(key);
51-
if (ciphertext.Length < 16) throw new ArgumentException("At least 16 bytes are required for the SIV.");
5256

5357
var macKey = keyBytes.AsSpan(0, 16);
5458
var encKey = keyBytes.AsSpan(16, 16);

src/Pandatech.Crypto/Pandatech.Crypto.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<Copyright>MIT</Copyright>
99
<PackageIcon>pandatech.png</PackageIcon>
1010
<PackageReadmeFile>Readme.md</PackageReadmeFile>
11-
<Version>6.1.0</Version>
11+
<Version>6.1.1</Version>
1212
<Title>Pandatech.Crypto</Title>
1313
<PackageTags>Pandatech, library, encryption, hash, algorythms, security</PackageTags>
1414
<Description>PandaTech.Crypto is a .NET library simplifying common cryptograhic functions.</Description>
1515
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-pandatech-crypto</RepositoryUrl>
16-
<PackageReleaseNotes>Easy Jose interface added. Refer to readme.md for changes</PackageReleaseNotes>
16+
<PackageReleaseNotes>On empty Aes256 Siv return null instead of throwing</PackageReleaseNotes>
1717
</PropertyGroup>
1818

1919
<ItemGroup>

0 commit comments

Comments
 (0)