Class ECCurve

    • Constructor Detail

    • Method Detail

      • getAllCoordinateSystems

        public static int[] getAllCoordinateSystems()
      • getFieldSize

        public abstract int getFieldSize()
      • fromBigInteger

        public abstract ECFieldElement fromBigInteger​(java.math.BigInteger x)
      • isValidFieldElement

        public abstract boolean isValidFieldElement​(java.math.BigInteger x)
      • randomFieldElement

        public abstract ECFieldElement randomFieldElement​(java.security.SecureRandom r)
      • randomFieldElementMult

        public abstract ECFieldElement randomFieldElementMult​(java.security.SecureRandom r)
      • validatePoint

        public ECPoint validatePoint​(java.math.BigInteger x,
                                     java.math.BigInteger y)
      • createPoint

        public ECPoint createPoint​(java.math.BigInteger x,
                                   java.math.BigInteger y)
      • cloneCurve

        protected abstract ECCurve cloneCurve()
      • createDefaultMultiplier

        protected ECMultiplier createDefaultMultiplier()
      • supportsCoordinateSystem

        public boolean supportsCoordinateSystem​(int coord)
      • getPreCompInfo

        public PreCompInfo getPreCompInfo​(ECPoint point,
                                          java.lang.String name)
      • precompute

        public PreCompInfo precompute​(ECPoint point,
                                      java.lang.String name,
                                      PreCompCallback callback)
        Compute a 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.
        callback - Called to calculate the PreCompInfo.
      • 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()
      • getOrder

        public java.math.BigInteger getOrder()
      • getCofactor

        public java.math.BigInteger getCofactor()
      • getCoordinateSystem

        public int getCoordinateSystem()
      • decompressPoint

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

        public ECMultiplier getMultiplier()
        Sets the default ECMultiplier, unless already set. We avoid synchronizing for performance reasons, so there is no uniqueness guarantee.
      • 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.
      • createCacheSafeLookupTable

        public ECLookupTable createCacheSafeLookupTable​(ECPoint[] points,
                                                        int off,
                                                        int len)
        Create a cache-safe lookup table for the specified sequence of points. All the points MUST belong to this ECCurve instance, and MUST already be normalized.
      • 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​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object