diff --git a/lib/src/main/java/zeroecho/core/alg/chacha/package-info.java b/lib/src/main/java/zeroecho/core/alg/chacha/package-info.java index b482ce8..7dc97ba 100644 --- a/lib/src/main/java/zeroecho/core/alg/chacha/package-info.java +++ b/lib/src/main/java/zeroecho/core/alg/chacha/package-info.java @@ -33,56 +33,83 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** - * Classic McEliece (CMCE) KEM integration and utilities. + * ChaCha algorithm implementation and runtime wiring. * *

- * This package adapts the Bouncy Castle PQC CMCE primitives to the core SPI. It - * provides the algorithm descriptor, a runtime KEM context, and key - * specifications for generation and import. The design keeps provider-specific - * details encapsulated behind factories while exposing clear roles and metadata - * to the higher layers. + * This package provides the ChaCha capability set for the core layer, including + * the stream cipher ChaCha20 and the AEAD construction ChaCha20-Poly1305. The + * module contains algorithm descriptors, streaming cipher contexts, immutable + * specifications, optional header codecs for runtime parameters, and symmetric + * key import/generation specifications. The design favors safe defaults + * (12-byte nonces, 128-bit AEAD tag), explicit role-to-context binding, and a + * clear separation between static configuration and per-operation parameters. *

* - *

Scope and responsibilities

- * - * *

Components

* * - *

Provider requirements

+ *

Runtime parameters and context exchange

*

- * The algorithm expects the Bouncy Castle PQC provider to be installed before - * use; the descriptor verifies this when generating or importing keys. + * Streaming contexts exchange ephemeral parameters through a Conflux session + * context using namespaced keys. For ChaCha20 and ChaCha20-Poly1305, a 12-byte + * nonce is required for each operation. On encryption, if the session context + * does not provide a nonce, the context generates a fresh value and stores it + * back into the session; on decryption the nonce must already be present and + * have the correct length. ChaCha20 also uses an initial counter sourced from + * {@link ChaChaSpec} and optionally overridden by the session context. When a + * header codec is configured and a session context is set, encryption prepends + * a minimal header and decryption reads it first to hydrate the session before + * initializing the cipher. *

* + *

Safety and validation

+ * + * *

Thread-safety

* * * @since 1.0 diff --git a/lib/src/main/java/zeroecho/core/alg/cmce/package-info.java b/lib/src/main/java/zeroecho/core/alg/cmce/package-info.java index e1491cf..b68d290 100644 --- a/lib/src/main/java/zeroecho/core/alg/cmce/package-info.java +++ b/lib/src/main/java/zeroecho/core/alg/cmce/package-info.java @@ -33,70 +33,58 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** - *

Classic McEliece (CMCE)

+ * Classic McEliece (CMCE) KEM integration and utilities. * *

- * This package integrates the Classic McEliece cryptosystem, one of the oldest - * and most studied code-based public-key cryptosystems. Originally proposed by - * Robert McEliece in 1978, it is based on the hardness of decoding random - * binary Goppa codes. Despite large public key sizes, the scheme has withstood - * decades of cryptanalysis and remains unbroken by both classical and quantum - * computers. + * This package adapts the Bouncy Castle PQC CMCE primitives to the core SPI. It + * provides the algorithm descriptor, a runtime KEM context, and key + * specifications for generation and import. The design keeps provider-specific + * details encapsulated behind factories while exposing clear roles and metadata + * to the higher layers. *

* - *

Post-quantum KEM

+ *

Scope and responsibilities

+ * * + *

Components

+ * + * + *

Provider requirements

*

- * Classic McEliece has been selected by NIST in the post-quantum cryptography - * standardization process for key encapsulation. Its primary appeal is - * long-term confidence: no efficient attacks are known even in the quantum - * setting. It provides IND-CCA2 security through a well-studied transform and - * is especially suited for use cases where large public keys are acceptable but - * extremely strong security margins are desired. + * The algorithm expects the Bouncy Castle PQC provider to be installed before + * use; the descriptor verifies this when generating or importing keys. *

* - *

Contents

+ *

Thread-safety

* * - *

Security properties

- * - * - *

Usage

{@code
- * // Select a variant (e.g., 8192128F for 256-bit security)
- * CmceKeyGenSpec spec = CmceKeyGenSpec.mceliece8192128f();
- * CmceAlgorithm alg = new CmceAlgorithm();
- * KeyPair kp = alg.asymmetricKeyBuilder(CmceKeyGenSpec.class).generateKeyPair(spec);
- *
- * // Encapsulation (sender)
- * try (CmceKemContext ctx = new CmceKemContext(alg, kp.getPublic())) {
- *   KemResult kem = ctx.encapsulate();
- *   byte[] ct = kem.ciphertext();
- *   byte[] secret = kem.secret();
- * }
- *
- * // Decapsulation (recipient)
- * try (CmceKemContext ctx = new CmceKemContext(alg, kp.getPrivate())) {
- *   byte[] secret = ctx.decapsulate(ct);
- * }
- * }
- * * @since 1.0 */ package zeroecho.core.alg.cmce;