From 17f8aa5b019a1898e23b1bc8f1d30d518305fa05 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 15 Feb 2023 13:42:05 +0700 Subject: Use spans --- crypto/src/crypto/modes/GCMBlockCipher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crypto/src') diff --git a/crypto/src/crypto/modes/GCMBlockCipher.cs b/crypto/src/crypto/modes/GCMBlockCipher.cs index 26b590ef9..41d850b41 100644 --- a/crypto/src/crypto/modes/GCMBlockCipher.cs +++ b/crypto/src/crypto/modes/GCMBlockCipher.cs @@ -566,7 +566,8 @@ namespace Org.BouncyCastle.Crypto.Modes if (bufOff >= BlockSize) { DecryptBlock(bufBlock, output); - Array.Copy(bufBlock, BlockSize, bufBlock, 0, bufOff -= BlockSize); + bufOff -= BlockSize; + bufBlock.AsSpan(0, bufOff).CopyFrom(bufBlock.AsSpan(BlockSize)); resultLen = BlockSize; available += BlockSize; -- cgit 1.4.1