Package zeroecho.core.alg.ed25519


package zeroecho.core.alg.ed25519
Ed25519 digital signature integration.

This package wires the Ed25519 signature scheme into the core layer. It provides the algorithm descriptor, a streaming signature context with a fixed tag length, builders for generating and importing keys, and compact key specifications for marshalling and transport.

Scope and responsibilities

  • Register the Ed25519 algorithm and declare SIGN and VERIFY roles with fixed-length signatures.
  • Provide a streaming signature context that adapts JCA engines and enforces the 64-byte tag size.
  • Expose builders for key-pair generation and for importing encoded public/private keys.
  • Define defensively copying key specifications suitable for safe cloning and simple marshalling; private-key specifications are destroyable.

Components

  • Ed25519Algorithm: algorithm descriptor that binds roles to a signature context and registers builders for key generation and import.
  • Ed25519SignatureContext: streaming context for signing and verification with a fixed 64-byte tag.
  • Ed25519KeyGenBuilder and Ed25519KeyGenSpec: generator and marker spec for producing key pairs.
  • Ed25519PublicKeyBuilder / Ed25519PrivateKeyBuilder: importers backed by JCA key factories.
  • Ed25519PublicKeySpec / Ed25519PrivateKeySpec: wrappers over X.509 and PKCS#8 encodings, with defensive copying and simple base64 marshalling helpers; the private-key form is destroyable.

Design notes

  • Algorithm descriptors are immutable and thread-safe.
  • Signature contexts are stateful and not thread-safe; create a new instance per operation.
  • Key specification classes never expose internal byte arrays; cloning is used on input and output.
  • Marshalling helpers use a compact key-value form intended for configuration, transport, and tests.
Since:
1.0