Pass Span instead of Memory

This commit is contained in:
eelke 2026-02-26 20:39:48 +01:00
parent 650fe99990
commit ccc00d8e80
10 changed files with 45 additions and 38 deletions

View file

@ -31,7 +31,7 @@ public class DataEncryptionService(
return Encryption.Decrypt(input.Value, key);
}
public EncryptedValue Encrypt(ReadOnlyMemory<byte> plain)
public EncryptedValue Encrypt(ReadOnlySpan<byte> plain)
{
var dek = GetActiveDek();
var key = dekCryptor.Decrypt(dek.KeyData);

View file

@ -22,7 +22,7 @@ public class DekEncryptionService : IDekEncryptionService
// throw new Exception("Key must be 256bits (32 bytes) for AES256GCM.");
}
public EncryptedDek Encrypt(ReadOnlyMemory<byte> plaintext)
public EncryptedDek Encrypt(ReadOnlySpan<byte> plaintext)
{
var encryptionKey = ActiveKey;
byte[] cipher = Encryption.Encrypt(plaintext, encryptionKey.Key);