public abstract ToBigInteger ( ) : BigInteger | ||
Результат | BigInteger |
public virtual bool Equals(ECFieldElement other) { if (this == other) return true; if (null == other) return false; return ToBigInteger().Equals(other.ToBigInteger()); }
public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) { BigInteger ax = this.x, xx = x.ToBigInteger(), yx = y.ToBigInteger(); BigInteger aa = ax.Multiply(ax); BigInteger xy = xx.Multiply(yx); BigInteger sum = aa.Add(xy); if (r != null && r.SignValue < 0 && sum.BitLength > (q.BitLength << 1)) { sum = sum.Subtract(q.ShiftLeft(q.BitLength)); } return(new FpFieldElement(q, r, ModReduce(sum))); }
public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) { BigInteger ax = this.x, bx = b.ToBigInteger(), xx = x.ToBigInteger(), yx = y.ToBigInteger(); BigInteger ab = ax.Multiply(bx); BigInteger xy = xx.Multiply(yx); BigInteger sum = ab.Add(xy); if (this.r != null && this.r.SignValue < 0 && sum.BitLength > (this.q.BitLength << 1)) { sum = sum.Subtract(this.q.ShiftLeft(this.q.BitLength)); } return(new FpFieldElement(this.q, this.r, ModReduce(sum))); }
public override ECFieldElement Divide( ECFieldElement b) { return(new FpFieldElement(q, r, ModMult(x, ModInverse(b.ToBigInteger())))); }
public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) { BigInteger ax = this.x, bx = b.ToBigInteger(), xx = x.ToBigInteger(), yx = y.ToBigInteger(); BigInteger ab = ax.Multiply(bx); BigInteger xy = xx.Multiply(yx); return(new FpFieldElement(q, r, ModReduce(ab.Subtract(xy)))); }
public override ECFieldElement Multiply( ECFieldElement b) { return(new FpFieldElement(q, r, ModMult(x, b.ToBigInteger()))); }
public override ECFieldElement Subtract( ECFieldElement b) { return(new FpFieldElement(q, r, ModSubtract(x, b.ToBigInteger()))); }
public override ECFieldElement Add( ECFieldElement b) { return(new FpFieldElement(q, r, ModAdd(x, b.ToBigInteger()))); }
public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) { BigInteger ax = this.x, xx = x.ToBigInteger(), yx = y.ToBigInteger(); BigInteger aa = ax.Multiply(ax); BigInteger xy = xx.Multiply(yx); BigInteger sum = aa.Add(xy); if(r != null && r.SignValue < 0 && sum.BitLength > (q.BitLength << 1)) { sum = sum.Subtract(q.ShiftLeft(q.BitLength)); } return new FpFieldElement(q, r, ModReduce(sum)); }
public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) { BigInteger ax = this.x, xx = x.ToBigInteger(), yx = y.ToBigInteger(); BigInteger aa = ax.Multiply(ax); BigInteger xy = xx.Multiply(yx); return new FpFieldElement(q, r, ModReduce(aa.Subtract(xy))); }
public override ECFieldElement Divide( ECFieldElement b) { return new FpFieldElement(q, r, ModMult(x, ModInverse(b.ToBigInteger()))); }
public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) { BigInteger ax = this.x, bx = b.ToBigInteger(), xx = x.ToBigInteger(), yx = y.ToBigInteger(); BigInteger ab = ax.Multiply(bx); BigInteger xy = xx.Multiply(yx); return new FpFieldElement(q, r, ModReduce(ab.Subtract(xy))); }
public override ECFieldElement Multiply( ECFieldElement b) { return new FpFieldElement(q, r, ModMult(x, b.ToBigInteger())); }
public override ECFieldElement Subtract( ECFieldElement b) { return new FpFieldElement(q, r, ModSubtract(x, b.ToBigInteger())); }
public override ECFieldElement Add( ECFieldElement b) { return new FpFieldElement(q, r, ModAdd(x, b.ToBigInteger())); }
public override ECFieldElement Add( ECFieldElement b) { return(new FpFieldElement(this.q, this.r, ModAdd(this.x, b.ToBigInteger()))); }