summary refs log tree commit diff
path: root/crypto/src/security/PrivateKeyFactory.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-08-04 18:10:17 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-08-04 18:10:17 +0700
commit66586c5998d313d37817b486a11115497b30fe40 (patch)
tree5c63bd438c7fef772ee91c1390cb9c0bf917c390 /crypto/src/security/PrivateKeyFactory.cs
parentUse GetInstance instead of cast (diff)
downloadBouncyCastle.NET-ed25519-66586c5998d313d37817b486a11115497b30fe40.tar.xz
Use Arrays.Reverse utility method in several places
Diffstat (limited to 'crypto/src/security/PrivateKeyFactory.cs')
-rw-r--r--crypto/src/security/PrivateKeyFactory.cs11
1 files changed, 1 insertions, 10 deletions
diff --git a/crypto/src/security/PrivateKeyFactory.cs b/crypto/src/security/PrivateKeyFactory.cs
index f7709160d..ddcb88992 100644
--- a/crypto/src/security/PrivateKeyFactory.cs
+++ b/crypto/src/security/PrivateKeyFactory.cs
@@ -213,18 +213,9 @@ namespace Org.BouncyCastle.Security
                     }
                     else
                     {
-                        byte[] encVal = Asn1OctetString.GetInstance(privKey).GetOctets();
-                        byte[] dVal = new byte[encVal.Length];
-
-                        for (int i = 0; i != encVal.Length; i++)
-                        {
-                            dVal[i] = encVal[encVal.Length - 1 - i];
-                        }
-
+                        byte[] dVal = Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets());
                         d = new BigInteger(1, dVal);
                     }
-
-
                 }
                 else
                 {