ChaCha20Algorithm class
ChaCha20 according to RFC 7539 (RFC 8439).
Constructors
- ChaCha20Algorithm(Uint32List key, int blockCounter, Uint32List nonce)
- Expects a key of 8x32 bits, a 32-bit block counter and a nonce of 3x32 bits.
- ChaCha20Algorithm.fromState(Uint32List chaChaState)
Properties
- chaChaState ↔ Uint32List
-
The initial state (constants, key, counter, nonce).
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
chaCha20(
) → void - ChaCha20 block function: 20 rounds plus addition of the initial state.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
processBytes(
Uint8List inputBytes) → Uint8List -
Returns a new Uint8List with the transformed
inputBytes. Encryption and decryption are identical for ChaCha20. The initial state is preserved, so the method can be called repeatedly. -
quarterRound(
int a, int b, int c, int d) → void - Performs a quarter round in place on the state words a, b, c, d, without allocating intermediate lists.
-
rotateLeft(
int n, int count) → int -
Left rotation of a 32-bit value by
countplaces. -
tenQuarterRounds(
) → void - ChaCha20 consists of ten double rounds (each with 4 column and 4 diagonal quarter rounds).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
magicConstants
→ const List<
int>