summary refs log tree commit diff
path: root/crypto/src/math
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
parentUpdate copyright (diff)
downloadBouncyCastle.NET-ed25519-84a1abd2bb12af82623c136243240e52a88e0bf4.tar.xz
ObsoleteAttribute cleanup
Diffstat (limited to 'crypto/src/math')
-rw-r--r--crypto/src/math/ec/ECPoint.cs27
-rw-r--r--crypto/src/math/ec/endo/GlvTypeBParameters.cs39
-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
-rw-r--r--crypto/src/math/raw/Nat.cs31
12 files changed, 0 insertions, 386 deletions
diff --git a/crypto/src/math/ec/ECPoint.cs b/crypto/src/math/ec/ECPoint.cs
index efec49c63..2a9d0832a 100644
--- a/crypto/src/math/ec/ECPoint.cs
+++ b/crypto/src/math/ec/ECPoint.cs
@@ -662,19 +662,6 @@ namespace Org.BouncyCastle.Math.EC
         : AbstractFpPoint
     {
         /**
-         * Create a point which encodes without point compression.
-         *
-         * @param curve the curve to use
-         * @param x affine x co-ordinate
-         * @param y affine y co-ordinate
-         */
-        [Obsolete("Use ECCurve.CreatePoint to construct points")]
-        public FpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y)
-            : this(curve, x, y, false)
-        {
-        }
-
-        /**
          * Create a point that encodes with or without point compression.
          *
          * @param curve the curve to use
@@ -1650,20 +1637,6 @@ namespace Org.BouncyCastle.Math.EC
          * @param curve base curve
          * @param x x point
          * @param y y point
-         */
-        [Obsolete("Use ECCurve.CreatePoint to construct points")]
-        public F2mPoint(
-            ECCurve			curve,
-            ECFieldElement	x,
-            ECFieldElement	y)
-            :  this(curve, x, y, false)
-        {
-        }
-
-        /**
-         * @param curve base curve
-         * @param x x point
-         * @param y y point
          * @param withCompression true if encode with point compression.
          */
         [Obsolete("Per-point compression property will be removed, see GetEncoded(bool)")]
diff --git a/crypto/src/math/ec/endo/GlvTypeBParameters.cs b/crypto/src/math/ec/endo/GlvTypeBParameters.cs
index 5e2937be8..fa2fd4c45 100644
--- a/crypto/src/math/ec/endo/GlvTypeBParameters.cs
+++ b/crypto/src/math/ec/endo/GlvTypeBParameters.cs
@@ -7,15 +7,6 @@ namespace Org.BouncyCastle.Math.EC.Endo
         protected readonly BigInteger m_beta, m_lambda;
         protected readonly ScalarSplitParameters m_splitParams;
 
-        [Obsolete("Use constructor taking a ScalarSplitParameters instead")]
-        public GlvTypeBParameters(BigInteger beta, BigInteger lambda, BigInteger[] v1, BigInteger[] v2,
-            BigInteger g1, BigInteger g2, int bits)
-        {
-            this.m_beta = beta;
-            this.m_lambda = lambda;
-            this.m_splitParams = new ScalarSplitParameters(v1, v2, g1, g2, bits);
-        }
-
         public GlvTypeBParameters(BigInteger beta, BigInteger lambda, ScalarSplitParameters splitParams)
         {
             this.m_beta = beta;
@@ -37,35 +28,5 @@ namespace Org.BouncyCastle.Math.EC.Endo
         {
             get { return m_splitParams; }
         }
-
-        [Obsolete("Access via SplitParams instead")]
-        public virtual BigInteger[] V1
-        {
-            get { return new BigInteger[] { m_splitParams.V1A, m_splitParams.V1B }; }
-        }
-
-        [Obsolete("Access via SplitParams instead")]
-        public virtual BigInteger[] V2
-        {
-            get { return new BigInteger[] { m_splitParams.V2A, m_splitParams.V2B }; }
-        }
-
-        [Obsolete("Access via SplitParams instead")]
-        public virtual BigInteger G1
-        {
-            get { return m_splitParams.G1; }
-        }
-
-        [Obsolete("Access via SplitParams instead")]
-        public virtual BigInteger G2
-        {
-            get { return m_splitParams.G2; }
-        }
-
-        [Obsolete("Access via SplitParams instead")]
-        public virtual int Bits
-        {
-            get { return m_splitParams.Bits; }
-        }
     }
 }
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;
-        }
-    }
-}
diff --git a/crypto/src/math/raw/Nat.cs b/crypto/src/math/raw/Nat.cs
index effe46454..8e5b7a04c 100644
--- a/crypto/src/math/raw/Nat.cs
+++ b/crypto/src/math/raw/Nat.cs
@@ -1128,37 +1128,6 @@ namespace Org.BouncyCastle.Math.Raw
             ShiftUpBit(extLen, zz, zzOff, x[xOff] << 31);
         }
 
-        [Obsolete("Use 'SquareWordAddTo' instead")]
-        public static uint SquareWordAdd(uint[] x, int xPos, uint[] z)
-        {
-            ulong c = 0, xVal = (ulong)x[xPos];
-            int i = 0;
-            do
-            {
-                c += xVal * x[i] + z[xPos + i];
-                z[xPos + i] = (uint)c;
-                c >>= 32;
-            }
-            while (++i < xPos);
-            return (uint)c;
-        }
-
-        [Obsolete("Use 'SquareWordAddTo' instead")]
-        public static uint SquareWordAdd(uint[] x, int xOff, int xPos, uint[] z, int zOff)
-        {
-            ulong c = 0, xVal = (ulong)x[xOff + xPos];
-            int i = 0;
-            do
-            {
-                c += xVal * (x[xOff + i] & M) + (z[xPos + zOff] & M);
-                z[xPos + zOff] = (uint)c;
-                c >>= 32;
-                ++zOff;
-            }
-            while (++i < xPos);
-            return (uint)c;
-        }
-
         public static uint SquareWordAddTo(uint[] x, int xPos, uint[] z)
         {
             ulong c = 0, xVal = (ulong)x[xPos];