mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-08-20 09:21:57 +08:00
Use simplified DecryptCbc method on .NET 6+
This commit is contained in:
parent
fd3c6dd444
commit
7c36e203d0
@ -26,6 +26,9 @@
|
||||
aes.Key = finalKey;
|
||||
aes.IV = iv;
|
||||
|
||||
#if NET8_0_OR_GREATER
|
||||
return aes.DecryptCbc(data.AsSpan(iv.Length), iv, PaddingMode.PKCS7);
|
||||
#else
|
||||
var buffer = new byte[256];
|
||||
|
||||
using (var decryptor = aes.CreateDecryptor(aes.Key, aes.IV))
|
||||
@ -49,6 +52,7 @@
|
||||
return output.ToArray();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user