summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-02-15 13:42:05 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-02-15 13:42:05 +0700
commit17f8aa5b019a1898e23b1bc8f1d30d518305fa05 (patch)
treed20fdf57e95635acb3636c89f50e7448c20f7bf5
parentRefactor AsconEngine AAD phase (diff)
downloadBouncyCastle.NET-ed25519-17f8aa5b019a1898e23b1bc8f1d30d518305fa05.tar.xz
Use spans
-rw-r--r--crypto/src/crypto/modes/GCMBlockCipher.cs3
1 files changed, 2 insertions, 1 deletions
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;