diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-15 13:42:05 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-15 13:42:05 +0700 |
commit | 17f8aa5b019a1898e23b1bc8f1d30d518305fa05 (patch) | |
tree | d20fdf57e95635acb3636c89f50e7448c20f7bf5 | |
parent | Refactor AsconEngine AAD phase (diff) | |
download | BouncyCastle.NET-ed25519-17f8aa5b019a1898e23b1bc8f1d30d518305fa05.tar.xz |
Use spans
-rw-r--r-- | crypto/src/crypto/modes/GCMBlockCipher.cs | 3 |
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; |