Class ECCurve

    • Constructor Detail

    • Method Detail

      • getAllCoordinateSystems

        public static int[] getAllCoordinateSystems()
      • getFieldSize

        public abstract int getFieldSize()
      • cloneCurve

        protected abstract ECCurve cloneCurve()
      • createDefaultMultiplier

        protected ECMultiplier createDefaultMultiplier()
      • supportsCoordinateSystem

        public boolean supportsCoordinateSystem​(int coord)
      • setPreCompInfo

        public void setPreCompInfo​(ECPoint point,
                                   String name,
                                   PreCompInfo preCompInfo)
        Adds PreCompInfo for a point on this curve, under a given name. Used by ECMultipliers to save the precomputation for this ECPoint for use by subsequent multiplication.
        Parameters:
        point - The ECPoint to store precomputations for.
        name - A String used to index precomputations of different types.
        preCompInfo - The values precomputed by the ECMultiplier.
      • normalizeAll

        public void normalizeAll​(ECPoint[] points)
        Normalization ensures that any projective coordinate is 1, and therefore that the x, y coordinates reflect those of the equivalent point in an affine coordinate system. Where more than one point is to be normalized, this method will generally be more efficient than normalizing each point separately.
        Parameters:
        points - An array of points that will be updated in place with their normalized versions, where necessary
      • normalizeAll

        public void normalizeAll​(ECPoint[] points,
                                 int off,
                                 int len,
                                 ECFieldElement iso)
        Normalization ensures that any projective coordinate is 1, and therefore that the x, y coordinates reflect those of the equivalent point in an affine coordinate system. Where more than one point is to be normalized, this method will generally be more efficient than normalizing each point separately. An (optional) z-scaling factor can be applied; effectively each z coordinate is scaled by this value prior to normalization (but only one actual multiplication is needed).
        Parameters:
        points - An array of points that will be updated in place with their normalized versions, where necessary
        off - The start of the range of points to normalize
        len - The length of the range of points to normalize
        iso - The (optional) z-scaling factor - can be null
      • getInfinity

        public abstract ECPoint getInfinity()
      • getCoordinateSystem

        public int getCoordinateSystem()
      • decompressPoint

        protected abstract ECPoint decompressPoint​(int yTilde,
                                                   BigInteger X1)
      • getMultiplier

        public ECMultiplier getMultiplier()
        Sets the default ECMultiplier, unless already set.
      • decodePoint

        public ECPoint decodePoint​(byte[] encoded)
        Decode a point on this curve from its ASN.1 encoding. The different encodings are taken account of, including point compression for Fp (X9.62 s 4.2.1 pg 17).
        Returns:
        The decoded point.
      • checkPoint

        protected void checkPoint​(ECPoint point)
      • checkPoints

        protected void checkPoints​(ECPoint[] points)
      • checkPoints

        protected void checkPoints​(ECPoint[] points,
                                   int off,
                                   int len)
      • equals

        public boolean equals​(ECCurve other)
      • equals

        public boolean equals​(Object obj)
        Description copied from class: Object
        Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

        The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

        The general contract for the equals and Object.hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare this instance with.
        Returns:
        true if the specified object is equal to this Object; false otherwise.
        See Also:
        Object.hashCode()
      • hashCode

        public int hashCode()
        Description copied from class: Object
        Returns an integer hash code for this object. By contract, any two objects for which Object.equals(java.lang.Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

        Note that hash values must not change over time unless information used in equals comparisons also changes.

        See Writing a correct hashCode method if you intend implementing your own hashCode method.

        Overrides:
        hashCode in class Object
        Returns:
        this object's hash code.
        See Also:
        Object.equals(java.lang.Object)