ChaCha20Poly1305 class
ChaCha20-Poly1305 is a cryptographic algorithm combining ChaCha20 stream cipher for encryption and Poly1305 for generating message authentication code. It provides both confidentiality and integrity protection, making it a popular choice for secure communication protocols like TLS.
This implementation is based on the RFC-8439
- Inheritance
-
- Object
- StreamCipherBase
- AEADCipher<
ChaCha20, Poly1305> - ChaCha20Poly1305
- Mixed-in types
Constructors
-
ChaCha20Poly1305.new(List<
int> key, {List<int> ? nonce, Nonce64? counter, List<int> ? aad}) -
Creates a new instance of the ChaCha20Poly1305 cipher.
factory
Properties
-
aad
→ List<
int> ? -
Additional authenticated data (optional)
finalinherited
- cipher → ChaCha20
-
The cipher used by this AEAD construction
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- iv → Uint8List
-
The salt or initialization vector
no setteroverride
- mac → Poly1305
-
The MAC generator used by this AEAD construction
finalinherited
- name → String
-
The name of the algorithm
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bind(
Stream< List< stream, [dynamic onDigest(HashDigest tag)?, bool verifyMode = false]) → Stream<int> >Uint8List> -
Transforms the chunked
stream
inherited -
cast<
RS, RT> () → StreamTransformer< RS, RT> -
Provides a
StreamTransformer<RS, RT>
view of this stream transformer.inherited -
convert(
List< int> message, [bool verifyMode = false]) → Uint8List -
Transforms the
message
. Alias for sign.inherited -
createSink(
[bool verifyMode = false]) → AEADCipherSink< CipherSink, HashDigestSink> -
Creates a sink to process multiple input messages in chunks
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resetIV(
) → void -
Replaces current IV with a new random one
override
-
sign(
List< int> message) → AEADResultWithIV -
Signs the
message
with an authentication tag.override -
stream(
Stream< int> stream, [dynamic onDigest(HashDigest tag)?, bool verifyMode = false]) → Stream<int> -
Transforms the stream
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verify(
List< int> message, List<int> tag) → bool -
Returns true if
message
can be verified with the authenticationtag
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited