Class ChaCha20Poly1305Spec
java.lang.Object
zeroecho.core.alg.chacha.ChaCha20Poly1305Spec
- All Implemented Interfaces:
ChaChaBaseSpec, Describable, ContextSpec
ChaCha20-Poly1305 algorithm specification
Immutable parameters for configuring a ChaCha20-Poly1305 operation. Optionally carries aSymmetricHeaderCodec to prepend/parse per-stream
headers (e.g., nonce and AAD hash) during encryption/decryption.
Notes
- If
header()isnull, no header is written or read; callers must exchange the nonce/AAD out-of-band via the context. - The effective authentication tag size is 128 bits.
Example
ChaCha20Poly1305Spec spec = ChaCha20Poly1305Spec.builder()
.header(new ChaCha20Poly1305HeaderCodec())
.build();
- Since:
- 1.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ChaCha20Poly1305Spec.Builderbuilder()Returns a new builder forChaCha20Poly1305Spec.Human-readable description of this spec.header()Returns the optional header codec.static ChaCha20Poly1305SpecwithHeader(SymmetricHeaderCodec header) Convenience factory that returns a spec with the provided header codec.
-
Method Details
-
builder
Returns a new builder forChaCha20Poly1305Spec.- Returns:
- a fresh
ChaCha20Poly1305Spec.Builder
-
withHeader
Convenience factory that returns a spec with the provided header codec.- Parameters:
header- optional header codec; may benull- Returns:
- a new
ChaCha20Poly1305Specconfigured withheader
-
header
Returns the optional header codec.- Specified by:
headerin interfaceChaChaBaseSpec- Returns:
- header codec or
nullif none
-
description
Human-readable description of this spec.- Specified by:
descriptionin interfaceDescribable- Returns:
"ChaCha20-Poly1305(tag=128)"
-