summary refs log tree commit diff
path: root/crypto/src/asn1/anssi
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/anssi')
-rw-r--r--crypto/src/asn1/anssi/ANSSINamedCurves.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/crypto/src/asn1/anssi/ANSSINamedCurves.cs b/crypto/src/asn1/anssi/ANSSINamedCurves.cs
index d0c90ebf1..ce941709f 100644
--- a/crypto/src/asn1/anssi/ANSSINamedCurves.cs
+++ b/crypto/src/asn1/anssi/ANSSINamedCurves.cs
@@ -4,6 +4,7 @@ using System.Collections;
 using Org.BouncyCastle.Asn1.X9;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Math.EC;
+using Org.BouncyCastle.Math.EC.Multiplier;
 using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.Utilities.Collections;
 using Org.BouncyCastle.Utilities.Encoders;
@@ -12,6 +13,13 @@ namespace Org.BouncyCastle.Asn1.Anssi
 {
     public class AnssiNamedCurves
     {
+        private static X9ECPoint ConfigureBasepoint(ECCurve curve, string encoding)
+        {
+            X9ECPoint G = new X9ECPoint(curve, Hex.Decode(encoding));
+            WNafUtilities.ConfigureBasepoint(G.Point);
+            return G;
+        }
+
         private static ECCurve ConfigureCurve(ECCurve curve)
         {
             return curve;
@@ -42,9 +50,8 @@ namespace Org.BouncyCastle.Asn1.Anssi
                 BigInteger h = BigInteger.One;
 
                 ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h));
-                X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04"
-                    + "B6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF"
-                    + "6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB"));
+                X9ECPoint G = ConfigureBasepoint(curve,
+                    "04B6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB");
 
                 return new X9ECParameters(curve, G, n, h, S);
             }