Skip to content

Commit ae9d2e4

Browse files
committed
Fix analysis issues
1 parent 8937e09 commit ae9d2e4

10 files changed

Lines changed: 42 additions & 38 deletions

File tree

benchmark/base.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ abstract class Benchmark extends BenchmarkBase with BenchmarkTools {
7373

7474
Stream<int> get inputStream => Stream.fromIterable(input);
7575

76-
Benchmark(String name, this.size, this.iter)
77-
: input = List.filled(size, 0x3f),
78-
super(name);
76+
Benchmark(
77+
super.name,
78+
this.size,
79+
this.iter,
80+
) : input = List.filled(size, 0x3f);
7981

8082
@override
8183
void exercise() {
@@ -98,9 +100,11 @@ abstract class AsyncBenchmark extends AsyncBenchmarkBase with BenchmarkTools {
98100

99101
Stream<int> get inputStream => Stream.fromIterable(input);
100102

101-
AsyncBenchmark(String name, this.size, this.iter)
102-
: input = List.filled(size, 0x3f),
103-
super(name);
103+
AsyncBenchmark(
104+
super.name,
105+
this.size,
106+
this.iter,
107+
) : input = List.filled(size, 0x3f);
104108

105109
@override
106110
Future<void> exercise() async {

benchmark/benchmark.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import 'xor.dart' as xor;
2323
IOSink sink = stdout;
2424
RandomAccessFile? raf;
2525

26-
void dump(message) {
27-
raf?.writeStringSync(message + '\n');
26+
void dump(String message) {
27+
raf?.writeStringSync('$message\n');
2828
stdout.writeln(message);
2929
}
3030

lib/src/algorithms/aead_cipher.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class AEADResultWithIV extends AEADResult {
3434
final Uint8List iv;
3535

3636
const AEADResultWithIV._(
37-
Uint8List data,
38-
HashDigest tag,
37+
super.data,
38+
super.tag,
3939
this.iv,
40-
) : super._(data, tag);
40+
) : super._();
4141
}
4242

4343
/// Extends the base [AEADCipherSink] to generate message digest for cipher

lib/src/algorithms/aes_modes/gcm.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ abstract class _AESInGCMModeSinkBase implements CipherSink {
248248
/// [AESInGCMModeEncrypt] algorithm.
249249
class AESInGCMModeEncryptSink extends _AESInGCMModeSinkBase {
250250
AESInGCMModeEncryptSink(
251-
Uint8List key,
252-
Uint8List iv,
253-
Iterable<int>? aad, [
251+
super._key,
252+
super._iv,
253+
super._aad, [
254254
this._tagSize = 16,
255-
]) : super(key, iv, aad) {
255+
]) {
256256
if (_tagSize < 1) {
257257
throw StateError('Tag size must be at least 1');
258258
} else if (_tagSize > 16) {
@@ -315,11 +315,11 @@ class AESInGCMModeEncryptSink extends _AESInGCMModeSinkBase {
315315
/// [AESInGCMModeDecrypt] algorithm.
316316
class AESInGCMModeDecryptSink extends _AESInGCMModeSinkBase {
317317
AESInGCMModeDecryptSink(
318-
Uint8List key,
319-
Uint8List iv,
320-
Iterable<int>? aad, [
318+
super._key,
319+
super._iv,
320+
super._aad, [
321321
this._tagSize = 16,
322-
]) : super(key, iv, aad) {
322+
]) {
323323
if (_tagSize < 1) {
324324
throw StateError('Tag size must be at least 1');
325325
} else if (_tagSize > 16) {

lib/src/algorithms/xor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class XOR extends Cipher {
7474

7575
const XOR(this.key);
7676

77-
/// Creates a [XOR] with List<int> [key], transforming every elements to
77+
/// Creates a [XOR] with `List<int>` [key], transforming every elements to
7878
/// unsigned 8-bit numbers.
7979
factory XOR.fromList(List<int> key) =>
8080
XOR(key is Uint8List ? key : Uint8List.fromList(key));

lib/src/chacha20_poly1305.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import 'utils/nonce.dart';
2222
class ChaCha20Poly1305 extends AEADCipher<ChaCha20, Poly1305>
2323
with SaltedCipher {
2424
const ChaCha20Poly1305._(
25-
ChaCha20 cipher,
26-
Poly1305 mac,
27-
List<int>? aad,
28-
) : super(cipher, mac, aad);
25+
super.cipher,
26+
super.mac,
27+
super.aad,
28+
);
2929

3030
/// Creates a new instance of the [ChaCha20Poly1305] cipher.
3131
///

lib/src/salsa20_poly1305.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import 'utils/nonce.dart';
1515
/// authentication code.
1616
class Salsa20Poly1305 extends AEADCipher<Salsa20, Poly1305> with SaltedCipher {
1717
const Salsa20Poly1305._(
18-
Salsa20 cipher,
19-
Poly1305 mac,
20-
List<int>? aad,
21-
) : super(cipher, mac, aad);
18+
super.cipher,
19+
super.mac,
20+
super.aad,
21+
);
2222

2323
/// Creates a new instance of the [Salsa20Poly1305] cipher.
2424
///

lib/src/utils/nonce.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Nonce extends _NonceBase {
109109

110110
/// The 64-bit initialization vector builder.
111111
class Nonce64 extends Nonce {
112-
const Nonce64._(Uint8List bytes) : super._(bytes);
112+
const Nonce64._(super.bytes) : super._();
113113

114114
/// Create a 64-bit nonce with zeros
115115
factory Nonce64.zero() => Nonce64._(Uint8List(8));
@@ -172,7 +172,7 @@ class Nonce64 extends Nonce {
172172

173173
/// The 128-bit initialization vector builder.
174174
class Nonce128 extends Nonce {
175-
const Nonce128._(Uint8List bytes) : super._(bytes);
175+
const Nonce128._(super.bytes) : super._();
176176

177177
/// Create a 128-bit nonce with zeros
178178
factory Nonce128.zero() => Nonce128._(Uint8List(16));

lib/src/xchacha20_poly1305.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import 'utils/nonce.dart';
2020
class XChaCha20Poly1305 extends AEADCipher<XChaCha20, Poly1305>
2121
with SaltedCipher {
2222
const XChaCha20Poly1305._(
23-
XChaCha20 cipher,
24-
Poly1305 mac,
25-
List<int>? aad,
26-
) : super(cipher, mac, aad);
23+
super.cipher,
24+
super.mac,
25+
super.aad,
26+
);
2727

2828
/// Creates a new instance of the [XChaCha20Poly1305] cipher.
2929
///

lib/src/xsalsa20_poly1305.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import 'utils/nonce.dart';
1616
class XSalsa20Poly1305 extends AEADCipher<XSalsa20, Poly1305>
1717
with SaltedCipher {
1818
const XSalsa20Poly1305._(
19-
XSalsa20 cipher,
20-
Poly1305 mac,
21-
List<int>? aad,
22-
) : super(cipher, mac, aad);
19+
super.cipher,
20+
super.mac,
21+
super.aad,
22+
);
2323

2424
/// Creates a new instance of the [XSalsa20Poly1305] cipher.
2525
///

0 commit comments

Comments
 (0)