summary refs log tree commit diff
path: root/crypto/src/math/ec/multiplier
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@gmail.com>2022-06-21 18:57:52 +0700
committerPeter Dettman <peter.dettman@gmail.com>2022-06-21 18:57:52 +0700
commit84a1abd2bb12af82623c136243240e52a88e0bf4 (patch)
tree5a9828c8785a54c5b293ba484bdd0e2f2431600f /crypto/src/math/ec/multiplier
parentUpdate copyright (diff)
downloadBouncyCastle.NET-ed25519-84a1abd2bb12af82623c136243240e52a88e0bf4.tar.xz
ObsoleteAttribute cleanup
Diffstat (limited to 'crypto/src/math/ec/multiplier')
-rw-r--r--crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs27
-rw-r--r--crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs76
-rw-r--r--crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs28
-rw-r--r--crypto/src/math/ec/multiplier/NafL2RMultiplier.cs33
-rw-r--r--crypto/src/math/ec/multiplier/NafR2LMultiplier.cs34
-rw-r--r--crypto/src/math/ec/multiplier/ReferenceMultiplier.cs14
-rw-r--r--crypto/src/math/ec/multiplier/WNafUtilities.cs12
-rw-r--r--crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs32
-rw-r--r--crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs33
9 files changed, 0 insertions, 289 deletions
diff --git a/crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs b/crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs
deleted file mode 100644
index 6648727f9..000000000
--- a/crypto/src/math/ec/multiplier/DoubleAddMultiplier.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    [Obsolete("Will be removed")]
-    public class DoubleAddMultiplier
-        : AbstractECMultiplier
-    {
-        /**
-         * Joye's double-add algorithm.
-         */
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            ECPoint[] R = new ECPoint[]{ p.Curve.Infinity, p };
-
-            int n = k.BitLength;
-            for (int i = 0; i < n; ++i)
-            {
-                int b = k.TestBit(i) ? 1 : 0;
-                int bp = 1 - b;
-                R[bp] = R[bp].TwicePlus(R[b]);
-            }
-
-            return R[0];
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs b/crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs
deleted file mode 100644
index 2bed8920c..000000000
--- a/crypto/src/math/ec/multiplier/MixedNafR2LMultiplier.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    /**
-     * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left) using
-     * mixed coordinates.
-     */
-    [Obsolete("Will be removed")]
-    public class MixedNafR2LMultiplier 
-        : AbstractECMultiplier
-    {
-        protected readonly int additionCoord, doublingCoord;
-
-        /**
-         * By default, addition will be done in Jacobian coordinates, and doubling will be done in
-         * Modified Jacobian coordinates (independent of the original coordinate system of each point).
-         */
-        public MixedNafR2LMultiplier()
-            : this(ECCurve.COORD_JACOBIAN, ECCurve.COORD_JACOBIAN_MODIFIED)
-        {
-        }
-
-        public MixedNafR2LMultiplier(int additionCoord, int doublingCoord)
-        {
-            this.additionCoord = additionCoord;
-            this.doublingCoord = doublingCoord;
-        }
-
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            ECCurve curveOrig = p.Curve;
-
-            ECCurve curveAdd = ConfigureCurve(curveOrig, additionCoord);
-            ECCurve curveDouble = ConfigureCurve(curveOrig, doublingCoord);
-
-            int[] naf = WNafUtilities.GenerateCompactNaf(k);
-
-            ECPoint Ra = curveAdd.Infinity;
-            ECPoint Td = curveDouble.ImportPoint(p);
-
-            int zeroes = 0;
-            for (int i = 0; i < naf.Length; ++i)
-            {
-                int ni = naf[i];
-                int digit = ni >> 16;
-                zeroes += ni & 0xFFFF;
-
-                Td = Td.TimesPow2(zeroes);
-
-                ECPoint Tj = curveAdd.ImportPoint(Td);
-                if (digit < 0)
-                {
-                    Tj = Tj.Negate();
-                }
-
-                Ra = Ra.Add(Tj);
-
-                zeroes = 1;
-            }
-
-            return curveOrig.ImportPoint(Ra);
-        }
-
-        protected virtual ECCurve ConfigureCurve(ECCurve c, int coord)
-        {
-            if (c.CoordinateSystem == coord)
-                return c;
-
-            if (!c.SupportsCoordinateSystem(coord))
-                throw new ArgumentException("Coordinate system " + coord + " not supported by this curve", "coord");
-
-            return c.Configure().SetCoordinateSystem(coord).Create();
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs b/crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs
deleted file mode 100644
index 45df2fdae..000000000
--- a/crypto/src/math/ec/multiplier/MontgomeryLadderMultiplier.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    [Obsolete("Will be removed")]
-    public class MontgomeryLadderMultiplier 
-        : AbstractECMultiplier
-    {
-        /**
-         * Montgomery ladder.
-         */
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            ECPoint[] R = new ECPoint[]{ p.Curve.Infinity, p };
-
-            int n = k.BitLength;
-            int i = n;
-            while (--i >= 0)
-            {
-                int b = k.TestBit(i) ? 1 : 0;
-                int bp = 1 - b;
-                R[bp] = R[bp].Add(R[b]);
-                R[b] = R[b].Twice();
-            }
-            return R[0];
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/NafL2RMultiplier.cs b/crypto/src/math/ec/multiplier/NafL2RMultiplier.cs
deleted file mode 100644
index d41a0d651..000000000
--- a/crypto/src/math/ec/multiplier/NafL2RMultiplier.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    /**
-     * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (left-to-right).
-     */
-    [Obsolete("Will be removed")]
-    public class NafL2RMultiplier
-        : AbstractECMultiplier
-    {
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            int[] naf = WNafUtilities.GenerateCompactNaf(k);
-
-            ECPoint addP = p.Normalize(), subP = addP.Negate();
-
-            ECPoint R = p.Curve.Infinity;
-
-            int i = naf.Length;
-            while (--i >= 0)
-            {
-                int ni = naf[i];
-                int digit = ni >> 16, zeroes = ni & 0xFFFF;
-
-                R = R.TwicePlus(digit < 0 ? subP : addP);
-                R = R.TimesPow2(zeroes);
-            }
-
-            return R;
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/NafR2LMultiplier.cs b/crypto/src/math/ec/multiplier/NafR2LMultiplier.cs
deleted file mode 100644
index 8157cf05e..000000000
--- a/crypto/src/math/ec/multiplier/NafR2LMultiplier.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    /**
-     * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left).
-     */
-    [Obsolete("Will be removed")]
-    public class NafR2LMultiplier 
-        : AbstractECMultiplier
-    {
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            int[] naf = WNafUtilities.GenerateCompactNaf(k);
-
-            ECPoint R0 = p.Curve.Infinity, R1 = p;
-
-            int zeroes = 0;
-            for (int i = 0; i < naf.Length; ++i)
-            {
-                int ni = naf[i];
-                int digit = ni >> 16;
-                zeroes += ni & 0xFFFF;
-
-                R1 = R1.TimesPow2(zeroes);
-                R0 = R0.Add(digit < 0 ? R1.Negate() : R1);
-
-                zeroes = 1;
-            }
-
-            return R0;
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/ReferenceMultiplier.cs b/crypto/src/math/ec/multiplier/ReferenceMultiplier.cs
deleted file mode 100644
index 40563cdc7..000000000
--- a/crypto/src/math/ec/multiplier/ReferenceMultiplier.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    [Obsolete("Will be removed")]
-    public class ReferenceMultiplier
-        : AbstractECMultiplier
-    {
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            return ECAlgorithms.ReferenceMultiply(p, k);
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/WNafUtilities.cs b/crypto/src/math/ec/multiplier/WNafUtilities.cs
index 42265b2d6..0e69c2785 100644
--- a/crypto/src/math/ec/multiplier/WNafUtilities.cs
+++ b/crypto/src/math/ec/multiplier/WNafUtilities.cs
@@ -361,18 +361,6 @@ namespace Org.BouncyCastle.Math.EC.Multiplier
             return System.Math.Max(2, System.Math.Min(maxWidth, w + 2));
         }
 
-        [Obsolete]
-        public static ECPoint MapPointWithPrecomp(ECPoint p, int minWidth, bool includeNegated,
-            ECPointMap pointMap)
-        {
-            ECCurve c = p.Curve;
-            WNafPreCompInfo infoP = Precompute(p, minWidth, includeNegated);
-
-            ECPoint q = pointMap.Map(p);
-            c.Precompute(q, PRECOMP_NAME, new MapPointCallback(infoP, includeNegated, pointMap));
-            return q;
-        }
-
         public static WNafPreCompInfo Precompute(ECPoint p, int minWidth, bool includeNegated)
         {
             return (WNafPreCompInfo)p.Curve.Precompute(p, PRECOMP_NAME,
diff --git a/crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs b/crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs
deleted file mode 100644
index 1c7a5d104..000000000
--- a/crypto/src/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    [Obsolete("Will be removed")]
-    public class ZSignedDigitL2RMultiplier 
-        : AbstractECMultiplier
-    {
-        /**
-         * 'Zeroless' Signed Digit Left-to-Right.
-         */
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            ECPoint addP = p.Normalize(), subP = addP.Negate();
-
-            ECPoint R0 = addP;
-
-            int n = k.BitLength;
-            int s = k.GetLowestSetBit();
-
-            int i = n;
-            while (--i > s)
-            {
-                R0 = R0.TwicePlus(k.TestBit(i) ? addP : subP);
-            }
-
-            R0 = R0.TimesPow2(s);
-
-            return R0;
-        }
-    }
-}
diff --git a/crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs b/crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs
deleted file mode 100644
index 46d234c37..000000000
--- a/crypto/src/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-
-namespace Org.BouncyCastle.Math.EC.Multiplier
-{
-    [Obsolete("Will be removed")]
-    public class ZSignedDigitR2LMultiplier 
-        : AbstractECMultiplier
-    {
-        /**
-         * 'Zeroless' Signed Digit Right-to-Left.
-         */
-        protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k)
-        {
-            ECPoint R0 = p.Curve.Infinity, R1 = p;
-
-            int n = k.BitLength;
-            int s = k.GetLowestSetBit();
-
-            R1 = R1.TimesPow2(s);
-
-            int i = s;
-            while (++i < n)
-            {
-                R0 = R0.Add(k.TestBit(i) ? R1 : R1.Negate());
-                R1 = R1.Twice();
-            }
-
-            R0 = R0.Add(R1);
-
-            return R0;
-        }
-    }
-}