summary refs log tree commit diff
path: root/crypto/src/crmf
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-08-02 15:02:15 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-08-02 15:02:15 +0700
commitffd9f8fde126859cd9441baef7899e5645047dae (patch)
tree08a125229bae874c58ae7b2a1348423eb144ad41 /crypto/src/crmf
parentUse intrinsics in custom binary curves (diff)
downloadBouncyCastle.NET-ed25519-ffd9f8fde126859cd9441baef7899e5645047dae.tar.xz
Add span variant for Collect
Diffstat (limited to 'crypto/src/crmf')
-rw-r--r--crypto/src/crmf/PKMacBuilder.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/src/crmf/PKMacBuilder.cs b/crypto/src/crmf/PKMacBuilder.cs
index 156936eac..8093eab44 100644
--- a/crypto/src/crmf/PKMacBuilder.cs
+++ b/crypto/src/crmf/PKMacBuilder.cs
@@ -83,6 +83,15 @@ namespace Org.BouncyCastle.Crmf
             signature.CopyTo(sig, sigOff);
             return signature.Length;
         }
+
+#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
+        public int Collect(Span<byte> destination)
+        {
+            byte[] result = Collect();
+            result.AsSpan().CopyTo(destination);
+            return result.Length;
+        }
+#endif
     }
 
     public class PKMacBuilder