Skip to content

Commit

Permalink
chore: const
Browse files Browse the repository at this point in the history
  • Loading branch information
koji-1009 committed Feb 25, 2024
1 parent 0eac388 commit 28b439f
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.aescbc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

part of impl_js;

final _aesCbcAlgorithm = subtle.Algorithm(name: 'AES-CBC');
const _aesCbcAlgorithm = subtle.Algorithm(name: 'AES-CBC');

Future<AesCbcSecretKey> aesCbc_importRawKey(List<int> keyData) async {
return _AesCbcSecretKey(await _importKey(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.aesctr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

part of impl_js;

final _aesCtrAlgorithm = subtle.Algorithm(name: 'AES-CTR');
const _aesCtrAlgorithm = subtle.Algorithm(name: 'AES-CTR');

Future<AesCtrSecretKey> aesCtr_importRawKey(List<int> keyData) async {
return _AesCtrSecretKey(await _importKey(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.aesgcm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

part of impl_js;

final _aesGcmAlgorithm = subtle.Algorithm(name: 'AES-GCM');
const _aesGcmAlgorithm = subtle.Algorithm(name: 'AES-GCM');

Future<AesGcmSecretKey> aesGcm_importRawKey(List<int> keyData) async {
return _AesGcmSecretKey(await _importKey(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.hkdf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Future<HkdfSecretKey> hkdfSecretKey_importRawKey(List<int> keyData) async {
return _HkdfSecretKey(await _importKey(
'raw',
keyData,
subtle.Algorithm(name: _hkdfAlgorithmName),
const subtle.Algorithm(name: _hkdfAlgorithmName),
_usagesDeriveBits,
'secret',
// Unlike all other key types it makes no sense to HkdfSecretKey to be
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.hmac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

part of impl_js;

final _hmacAlgorithm = subtle.Algorithm(name: 'HMAC');
const _hmacAlgorithm = subtle.Algorithm(name: 'HMAC');

Future<HmacSecretKey> hmacSecretKey_importRawKey(
List<int> keyData,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.pbkdf2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Future<Pbkdf2SecretKey> pbkdf2SecretKey_importRawKey(List<int> keyData) async {
return _Pbkdf2SecretKey(await _importKey(
'raw',
keyData,
subtle.Algorithm(name: _pbkdf2AlgorithmName),
const subtle.Algorithm(name: _pbkdf2AlgorithmName),
_usagesDeriveBits,
'secret',
// Unlike all other key types it makes no sense to HkdfSecretKey to be
Expand Down
4 changes: 2 additions & 2 deletions lib/src/impl_js/impl_js.rsaoaep.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class _RsaOaepPrivateKey implements RsaOaepPrivateKey {
Future<Uint8List> decryptBytes(List<int> data, {List<int>? label}) async {
return _decrypt(
label == null
? subtle.Algorithm(name: _rsaOaepAlgorithmName)
? const subtle.Algorithm(name: _rsaOaepAlgorithmName)
: subtle.Algorithm(
name: _rsaOaepAlgorithmName,
label: Uint8List.fromList(label),
Expand Down Expand Up @@ -138,7 +138,7 @@ class _RsaOaepPublicKey implements RsaOaepPublicKey {
Future<Uint8List> encryptBytes(List<int> data, {List<int>? label}) async {
return _encrypt(
label == null
? subtle.Algorithm(name: _rsaOaepAlgorithmName)
? const subtle.Algorithm(name: _rsaOaepAlgorithmName)
: subtle.Algorithm(
name: _rsaOaepAlgorithmName,
label: Uint8List.fromList(label),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/impl_js/impl_js.rsassapkcs1v15.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

part of impl_js;

final _rsassaPkcs1V15Algorithm = subtle.Algorithm(name: 'RSASSA-PKCS1-v1_5');
const _rsassaPkcs1V15Algorithm = subtle.Algorithm(name: 'RSASSA-PKCS1-v1_5');

Future<RsassaPkcs1V15PrivateKey> rsassaPkcs1V15PrivateKey_importPkcs8Key(
List<int> keyData,
Expand Down

0 comments on commit 28b439f

Please sign in to comment.