summary refs log tree commit diff
path: root/crypto/src/math/raw/Nat.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/math/raw/Nat.cs')
-rw-r--r--crypto/src/math/raw/Nat.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/src/math/raw/Nat.cs b/crypto/src/math/raw/Nat.cs
index 61d060b4e..f4d91b180 100644
--- a/crypto/src/math/raw/Nat.cs
+++ b/crypto/src/math/raw/Nat.cs
@@ -2747,14 +2747,9 @@ namespace Org.BouncyCastle.Math.Raw
                 ? stackalloc byte[bsLen]
                 : new byte[bsLen];
 
-            int xPos = len;
-            Span<byte> t = bs;
-            while (--xPos >= 0)
-            {
-                Pack.UInt32_To_BE(x[xPos], t);
-                t = t[4..];
-            }
-            return new BigInteger(1, bs);
+            Pack.UInt32_To_LE(x, bs);
+
+            return new BigInteger(1, bs, bigEndian: false);
         }
 #endif