summary refs log tree commit diff
path: root/crypto/src/asn1/BERBitString.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-04-11 18:55:01 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-04-11 18:55:01 +0700
commit767f1c498d07d59c1f98940c0e45db9206a33c30 (patch)
tree1bbf95c542d4f12e8b648dd3e770236dd44de94d /crypto/src/asn1/BERBitString.cs
parentReduce allocations in hex encoding (diff)
downloadBouncyCastle.NET-ed25519-767f1c498d07d59c1f98940c0e45db9206a33c30.tar.xz
Support BitString construction from ReadOnlySpan
Diffstat (limited to 'crypto/src/asn1/BERBitString.cs')
-rw-r--r--crypto/src/asn1/BERBitString.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/src/asn1/BERBitString.cs b/crypto/src/asn1/BERBitString.cs
index e69e7a35f..98159e1eb 100644
--- a/crypto/src/asn1/BERBitString.cs
+++ b/crypto/src/asn1/BERBitString.cs
@@ -81,6 +81,19 @@ namespace Org.BouncyCastle.Asn1
         {
         }
 
+#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
+        public BerBitString(ReadOnlySpan<byte> data)
+            : this(data, 0)
+        {
+        }
+
+        public BerBitString(ReadOnlySpan<byte> data, int padBits)
+            : base(data, padBits)
+        {
+            this.elements = null;
+        }
+#endif
+
         public BerBitString(int namedBits)
             : base(namedBits)
         {