Enum HashToCurveProfile

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<HashToCurveProfile>

    public enum HashToCurveProfile
    extends java.lang.Enum<HashToCurveProfile>
    Supported profiles for instantiating an instance of HashToEllipticCurve. Each profile supports both hash_to_curve and encode_to_curve operations, according to RFC 9380

    _NU_ is identical to _RO_, except that the encoding type is encode_to_curve. encode_to_curve is not yet implemented in this lib, thus these options are not yet included

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getH()
      Retrieves the value of the field 'h', representing the cofactor associated with this instance.
      int getK()
      Retrieves the security level in bits associated with this instance.
      int getL()
      Retrieves the value of the field 'L' representing the internal block size in bytes associated with this instance.
      java.lang.Integer getmJ()
      Retrieves the value of the field 'mJ' representing the associated Montgomery equation parameter A
      java.lang.Integer getmK()
      Retrieves the value of the field 'mK' representing the associated Montgomery equation parameter B specific to the hash-to-curve profile.
      java.math.BigInteger getZ()
      Retrieves the value of the field 'Z'.
      static HashToCurveProfile valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static HashToCurveProfile[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CURVE25519W_XMD_SHA_512_ELL2

        public static final HashToCurveProfile CURVE25519W_XMD_SHA_512_ELL2
      • BLS12_381_G1_XMD_SHA_256_SSWU_RO

        public static final HashToCurveProfile BLS12_381_G1_XMD_SHA_256_SSWU_RO
        BLS12381G1_XMD:SHA-256_SSWU_RO_ from RFC 9380 sec. 8.8.1. The Z and h fields are not used directly here: Z is fixed inside BLS12_381G1MapToCurve (the SSWU map runs on the 11-isogenous curve E', not on E), and cofactor clearing uses h_eff rather than the raw cofactor.
    • Method Detail

      • values

        public static HashToCurveProfile[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HashToCurveProfile c : HashToCurveProfile.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HashToCurveProfile valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getK

        public int getK()
        Retrieves the security level in bits associated with this instance.
        Returns:
        the value of the field 'k' representing security level in bits
      • getL

        public int getL()
        Retrieves the value of the field 'L' representing the internal block size in bytes associated with this instance.
        Returns:
        the value of the field 'L' representing the internal block size
      • getZ

        public java.math.BigInteger getZ()
        Retrieves the value of the field 'Z'.
        Returns:
        the value of the field 'Z' as a BigInteger
      • getH

        public int getH()
        Retrieves the value of the field 'h', representing the cofactor associated with this instance.
        Returns:
        the value of the field 'h' as an integer
      • getmJ

        public java.lang.Integer getmJ()
        Retrieves the value of the field 'mJ' representing the associated Montgomery equation parameter A
        Returns:
        the value of the field 'mJ' as an Integer
      • getmK

        public java.lang.Integer getmK()
        Retrieves the value of the field 'mK' representing the associated Montgomery equation parameter B specific to the hash-to-curve profile.
        Returns:
        the value of the field 'mK' as an Integer