-=attr algorithm
-
- $algorithm = $cipher->algorithm;
-
-Get the stream cipher algorithm. Can be one of C<Salsa20> and C<ChaCha>.
-
-=attr counter
-
- $counter = $cipher->counter;
-
-Get the initial counter / block count into the keystream.
-
-=attr offset
-
- $offset = $cipher->offset;
-
-Get the initial byte offset into the keystream. This has precedence over L</counter> if both are set.
-
-=cut
-
-sub algorithm { $_[0]->{algorithm} or throw 'Stream cipher algorithm is not set' }
-sub counter { $_[0]->{counter} // 0 }
-sub offset { $_[0]->{offset} }
-sub key_size { { Salsa20 => 32, ChaCha => 32 }->{$_[0]->{algorithm} || ''} // 0 }
-sub iv_size { { Salsa20 => 8, ChaCha => 12 }->{$_[0]->{algorithm} || ''} // -1 }
-sub block_size { 1 }
-