Ejemplo n.º 1
0
 public T Subtract(BigInteger other)
 {
     return(New(Coefficients.Select(x => (x - other).Mod(Bn128Curve.P))));
 }
Ejemplo n.º 2
0
 public T Negate()
 {
     // Negate all coefficients.
     return(New(Coefficients.Select(x => (-x).Mod(Bn128Curve.P))));
 }
Ejemplo n.º 3
0
 public T Divide(BigInteger other)
 {
     return(New(Coefficients.Select(x => (x * other.ModInverse(Bn128Curve.P)).Mod(Bn128Curve.P))));
 }
Ejemplo n.º 4
0
 public T Multiply(BigInteger other)
 {
     return(New(Coefficients.Select(x => (x * other).Mod(Bn128Curve.P))));
 }
 public Polynomial Negate()
 {
     return(new Polynomial(Coefficients.Select(c => - 1 * c).ToList()));
 }
 public override string ToString()
 {
     return(string.Join(" + ", Coefficients.Select((coefficient, i) => i > 0 ? $"{coefficient} {Indeterminate}^{i}" : $"{coefficient}")));
 }