Interface ChaChaBaseSpec
- All Superinterfaces:
ContextSpec
- All Known Implementing Classes:
ChaCha20Poly1305Spec, ChaChaSpec
ChaCha base specification marker
Common sealed interface for all ChaCha-family specifications. Implemented byChaChaSpec (raw stream cipher) and ChaCha20Poly1305Spec
(AEAD).
Extends ContextSpec to allow binding
algorithm-specific parameters into a context.
Header support
header()may return aSymmetricHeaderCodecthat encodes parameters (e.g., nonce, AAD hash) into the ciphertext stream.- If
null, no header is used and parameters must be managed viaCtxInterfaceor other out-of-band means.
Example
ChaChaBaseSpec spec = ChaCha20Poly1305Spec.withHeader(
new ChaCha20Poly1305HeaderCodec()
);
SymmetricHeaderCodec codec = spec.header(); // non-null
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionheader()Returns the optional header codec used to serialize/deserialize stream headers for this ChaCha mode.
-
Method Details
-
header
SymmetricHeaderCodec header()Returns the optional header codec used to serialize/deserialize stream headers for this ChaCha mode.- Returns:
SymmetricHeaderCodecinstance, ornullif no header
-