示例#1
0
文件: Fp.cs 项目: tagoro9/nfc
        public override bool Equals(Object obj) //This could fail
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is Fp))
            {
                return(false);
            }
            Fp other = (Fp)obj;

            if (r == null)
            {
                if (other.r != null)
                {
                    return(false);
                }
            }
            else if (!r.Equals(other.r))
            {
                return(false);
            }
            return(true);
        }
示例#2
0
 public Complex(Fp field, BigInt real)
 {
     this.field = field;
     if (!this.field.IsValidElement(real))
     {
         throw new ArgumentException("The input values are not in the field.");
     }
     this.real = real;
     this.imag = BigInt.ZERO;
 }
示例#3
0
 public ComplexField(Fp baseField)
 {
     this.field = baseField;
 }
示例#4
0
 public HalfComplex(Fp field, BigInt real)
 {
     this.field = field;
     this.real  = real;
 }
示例#5
0
 public Complex(Fp field, BigInt real, BigInt imag)
 {
     this.field = field;
     this.real  = real;
     this.imag  = imag;
 }