Negate() public abstract method

public abstract Negate ( ) : ECPoint
return ECPoint
コード例 #1
0
 public override ECPoint Subtract(ECPoint b)
 {
     if (b.IsInfinity)
     {
         return(this);
     }
     return(Add(b.Negate()));
 }
コード例 #2
0
ファイル: ECPoint.cs プロジェクト: MBrekhof/pleiobox-clients
        public override ECPoint Subtract(
            ECPoint b)
        {
            if (b.IsInfinity)
                return this;

            // Add -b
            return Add(b.Negate());
        }
コード例 #3
0
 // D.3.2 pg 102 (see Note:)
 public override ECPoint Subtract(ECPoint b)
 {
     return b.IsInfinity ? this : Add(b.Negate());
 }
コード例 #4
0
ファイル: ECPointTest.cs プロジェクト: jesusgarza/bc-csharp
 /**
  * Tests <code>ECPoint.add()</code> and <code>ECPoint.subtract()</code>
  * for the given point and the given point at infinity.
  *
  * @param p
  *            The point on which the tests are performed.
  * @param infinity
  *            The point at infinity on the same curve as <code>p</code>.
  */
 private void ImplTestAddSubtract(ECPoint p, ECPoint infinity)
 {
     AssertPointsEqual("Twice and Add inconsistent", p.Twice(), p.Add(p));
     AssertPointsEqual("Twice p - p is not p", p, p.Twice().Subtract(p));
     AssertPointsEqual("TwicePlus(p, -p) is not p", p, p.TwicePlus(p.Negate()));
     AssertPointsEqual("p - p is not infinity", infinity, p.Subtract(p));
     AssertPointsEqual("p plus infinity is not p", p, p.Add(infinity));
     AssertPointsEqual("infinity plus p is not p", p, infinity.Add(p));
     AssertPointsEqual("infinity plus infinity is not infinity ", infinity, infinity.Add(infinity));
     AssertPointsEqual("Twice infinity is not infinity ", infinity, infinity.Twice());
 }
コード例 #5
0
 // D.3.2 pg 102 (see Note:)
 public override ECPoint Subtract(ECPoint b)
 {
     return(b.IsInfinity ? this : Add(b.Negate()));
 }