java.lang.Object
net.i2p.crypto.eddsa.spec.EdDSAParameterSpec
All Implemented Interfaces:
Serializable, AlgorithmParameterSpec
Direct Known Subclasses:
EdDSANamedCurveSpec

public class EdDSAParameterSpecextends Object implements AlgorithmParameterSpec, Serializable
Parameter specification for an EdDSA algorithm.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Pinned for serialized-form compatibility.
      See Also:
    • curve

      private final Curve curve
      The curve parameters.
    • hashAlgo

      private final String hashAlgo
      Hash algo.
    • sc

      private final ScalarOps sc
      The scalar operations.
    • B

      private final GroupElement B
      The base point.
  • Constructor Details

    • EdDSAParameterSpec

      public EdDSAParameterSpec(Curve curve, String hashAlgo, ScalarOps sc, GroupElement b)
      Create a new EdDSA parameter specification.
      Parameters:
      curve - the curve the parameters describe; its field size must match the hash output length
      hashAlgo - the JCA string for the hash algorithm
      sc - the parameter L represented as ScalarOps
      b - the parameter B
      Throws:
      IllegalArgumentException - if hash algorithm is unsupported or length is wrong
  • Method Details

    • getCurve

      public Curve getCurve()
      Returns the curve used by this parameter specification.
      Returns:
      the curve parameters this spec was built with, never null
    • getHashAlgorithm

      public String getHashAlgorithm()
      Returns the JCA hash algorithm name.
      Returns:
      the hash algorithm name
    • getScalarOps

      public ScalarOps getScalarOps()
      Returns the scalar operations implementation.
      Returns:
      the scalar operations
    • getB

      public GroupElement getB()
      Return the base (generator) point.
      Returns:
      the base (generator)
    • hashCode

      public int hashCode()
      Returns a hash code for this parameter specification.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • equals

      public boolean equals(Object o)
      Compares this parameter specification to another object for equality.
      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare
      Returns:
      true if the objects are equal