diff options
Diffstat (limited to 'crypto/src/security/PrivateKeyFactory.cs')
-rw-r--r-- | crypto/src/security/PrivateKeyFactory.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/src/security/PrivateKeyFactory.cs b/crypto/src/security/PrivateKeyFactory.cs index 38e571cd6..d6fa87943 100644 --- a/crypto/src/security/PrivateKeyFactory.cs +++ b/crypto/src/security/PrivateKeyFactory.cs @@ -151,7 +151,7 @@ namespace Org.BouncyCastle.Security Asn1OctetString privEnc = keyInfo.PrivateKeyData; if (privEnc.GetOctets().Length == 32 || privEnc.GetOctets().Length == 64) { - d = new BigInteger(1, Arrays.Reverse(privEnc.GetOctets())); + d = new BigInteger(1, privEnc.GetOctets(), bigEndian: false); } else { @@ -162,8 +162,8 @@ namespace Org.BouncyCastle.Security } else { - byte[] dVal = Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets()); - d = new BigInteger(1, dVal); + byte[] dVal = Asn1OctetString.GetInstance(privKey).GetOctets(); + d = new BigInteger(1, dVal, bigEndian: false); } } } @@ -233,7 +233,7 @@ namespace Org.BouncyCastle.Security } else { - x = new BigInteger(1, Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets())); + x = new BigInteger(1, Asn1OctetString.GetInstance(privKey).GetOctets(), bigEndian: false); } return new Gost3410PrivateKeyParameters(x, gostParams.PublicKeyParamSet); @@ -280,8 +280,7 @@ namespace Org.BouncyCastle.Security Asn1OctetString privEnc = keyInfo.PrivateKeyData; if (privEnc.GetOctets().Length == 32 || privEnc.GetOctets().Length == 64) { - byte[] dVal = Arrays.Reverse(privEnc.GetOctets()); - d = new BigInteger(1, dVal); + d = new BigInteger(1, privEnc.GetOctets(), bigEndian: false); } else { @@ -292,8 +291,8 @@ namespace Org.BouncyCastle.Security } else { - byte[] dVal = Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets()); - d = new BigInteger(1, dVal); + byte[] dVal = Asn1OctetString.GetInstance(privKey).GetOctets(); + d = new BigInteger(1, dVal, bigEndian: false); } } } |