Change stackalloc size in Security
This commit is contained in:
@@ -87,7 +87,7 @@ namespace Akari.Prototype.Server.Utils
|
||||
|
||||
// We write everything into one big array for easier encoding
|
||||
int encryptedDataLength = 4 + nonceSize + 4 + tagSize + cipherSize;
|
||||
Span<byte> encryptedData = encryptedDataLength < 1024
|
||||
Span<byte> encryptedData = encryptedDataLength <= 1024
|
||||
? stackalloc byte[encryptedDataLength]
|
||||
: new byte[encryptedDataLength];
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Akari.Prototype.Server.Utils
|
||||
var cipherBytes = encryptedData.Slice(4 + nonceSize + 4 + tagSize, cipherSize);
|
||||
|
||||
// Decrypt
|
||||
Span<byte> plainBytes = cipherSize < 1024
|
||||
Span<byte> plainBytes = cipherSize <= 1024
|
||||
? stackalloc byte[cipherSize]
|
||||
: new byte[cipherSize];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user