예제 #1
0
        private GE rand_point()
        {
            Scalar x      = rand_scalar();
            GEJ    pointj = ECMultGenContext.Instance.MultGen(x);

            return(pointj.ToGroupElement());
        }
예제 #2
0
        // Since GEJ.IsValidVariable, this constructor is private
        private GroupElement(GEJ groupElementJacobian)
        {
            if (groupElementJacobian.IsInfinity)
            {
                LazyGe = new Lazy <GE>(() => GE.Infinity);
                Gej    = Ge.ToGroupElementJacobian();              // eagerly initialize Ge property
            }
            else
            {
                GE ComputeAffineCoordinates()
                {
                    var groupElement = groupElementJacobian.ToGroupElement();

                    return(new GE(groupElement.x.Normalize(), groupElement.y.Normalize()));
                }

                LazyGe = new Lazy <GE>(ComputeAffineCoordinates);                // avoid computing affine coordinates until needed
                Gej    = groupElementJacobian;
            }
        }
예제 #3
0
 public GroupElement(GEJ groupElement)
     : this(groupElement.ToGroupElement())
 {
 }
예제 #4
0
 private GroupElement(GEJ gej)
 {
     this.ge = gej.ToGroupElement();
 }