java.lang.Object
net.i2p.crypto.eddsa.spec.EdDSANamedCurveTable

public class EdDSANamedCurveTableextends Object
Table of named EdDSA curves. Provides lookup of curve specifications by name.
  • Field Details

    • ED_25519

      public static final String ED_25519
      RFC 8032.
      See Also:
    • CURVE_ED25519_SHA512

      public static final String CURVE_ED25519_SHA512
      Old name for the Ed25519 curve.
      See Also:
    • ed25519field

      private static final Field ed25519field
      The Ed25519 field.
    • ed25519curve

      private static final Curve ed25519curve
      The Ed25519 curve's parameters.
    • ED_25519_CURVE_SPEC

      public static final EdDSANamedCurveSpec ED_25519_CURVE_SPEC
      ED_25519_CURVE_SPEC.
    • curves

      private static volatile HashMap<String, EdDSANamedCurveSpec> curves
      The registered curves, by name.
  • Constructor Details

    • EdDSANamedCurveTable

      public EdDSANamedCurveTable()
      Constructor. The curve specs are built into static fields, so an instance holds nothing and lookups are static.
  • Method Details

    • putCurve

      private static void putCurve(String name, EdDSANamedCurveSpec curve)
      Registers a curve under a name.
      Parameters:
      name - the name to register it as
      curve - the curve to register
    • defineCurve

      public static void defineCurve(EdDSANamedCurveSpec curve)
      Defines a named curve in the table.
      Parameters:
      curve - the named curve specification to add
    • defineCurveAlias

      static void defineCurveAlias(String name, String alias)
      Define an alias for a curve.
      Parameters:
      name - the existing curve name to alias, matched case-insensitively
      alias - the additional name to file the curve under, matched case-insensitively
    • getByName

      public static EdDSANamedCurveSpec getByName(String name)
      Returns the curve specification for the given name, or null if not found.
      Parameters:
      name - the curve name (case-insensitive)
      Returns:
      the curve specification, or null if not found