Skip to content

Commit

Permalink
chore: dart fix
Browse files Browse the repository at this point in the history
  • Loading branch information
koji-1009 committed Feb 25, 2024
1 parent bcb6e84 commit 0eac388
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions lib/src/testing/utils/testrunner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ void _runTests<PrivateKey, PublicKey>(
signature = c.signature;
} else {
test('create signature', () async {
signature = await r._signBytes!(
signature = await r._signBytes(
privateKey as PrivateKey,
c.plaintext!,
c.signVerifyParams!,
Expand Down Expand Up @@ -838,7 +838,7 @@ void _runTests<PrivateKey, PublicKey>(
ciphertext = c.ciphertext!;
} else {
test('create ciphertext', () async {
ciphertext = await r._encryptBytes!(
ciphertext = await r._encryptBytes(
publicKey as PublicKey,
c.plaintext!,
c.encryptDecryptParams!,
Expand Down Expand Up @@ -866,7 +866,7 @@ void _runTests<PrivateKey, PublicKey>(
derivedBits = c.derivedBits!;
} else {
test('create derivedBits', () async {
derivedBits = await r._deriveBits!(
derivedBits = await r._deriveBits(
_KeyPair(
privateKey: privateKey as PrivateKey,
publicKey: publicKey as PublicKey),
Expand All @@ -877,7 +877,7 @@ void _runTests<PrivateKey, PublicKey>(
}

test('validated derivedBits', () async {
final derived = await r._deriveBits!(
final derived = await r._deriveBits(
_KeyPair(
privateKey: privateKey as PrivateKey,
publicKey: publicKey as PublicKey),
Expand All @@ -901,7 +901,7 @@ void _runTests<PrivateKey, PublicKey>(
'failed to verify signature',
);
check(
!await r._verifyBytes!(
!await r._verifyBytes(
key,
flipFirstBits(sig),
c.plaintext!,
Expand All @@ -911,7 +911,7 @@ void _runTests<PrivateKey, PublicKey>(
);
if (c.plaintext!.isNotEmpty) {
check(
!await r._verifyBytes!(
!await r._verifyBytes(
key,
sig,
flipFirstBits(c.plaintext!),
Expand All @@ -931,7 +931,7 @@ void _runTests<PrivateKey, PublicKey>(
// If ciphertext is mangled some primitives like AES-GCM must throw
// others may return garbled plaintext.
try {
final invalidText = await r._decryptBytes!(
final invalidText = await r._decryptBytes(
key,
flipFirstBits(ctext),
c.encryptDecryptParams!,
Expand Down Expand Up @@ -974,15 +974,15 @@ void _runTests<PrivateKey, PublicKey>(
await checkVerifyBytes(publicKey as PublicKey, signature);
}
if (r._encryptBytes != null) {
final ctext = await r._encryptBytes!(
final ctext = await r._encryptBytes(
publicKey as PublicKey,
c.plaintext!,
c.encryptDecryptParams!,
);
await checkCipherText(ctext);
}
if (r._deriveBits != null) {
final derived = await r._deriveBits!(
final derived = await r._deriveBits(
_KeyPair(
privateKey: privateKey as PrivateKey,
publicKey: publicKey as PublicKey),
Expand All @@ -997,7 +997,7 @@ void _runTests<PrivateKey, PublicKey>(
Future<void> checkPrivateKey(PrivateKey? privateKey) async {
check(privateKey != null, 'privateKey is null');
if (r._signBytes != null) {
final sig = await r._signBytes!(
final sig = await r._signBytes(
privateKey as PrivateKey,
c.plaintext!,
c.signVerifyParams!,
Expand All @@ -1008,7 +1008,7 @@ void _runTests<PrivateKey, PublicKey>(
await checkDecryptBytes(privateKey as PrivateKey, ciphertext!);
}
if (r._deriveBits != null) {
final derived = await r._deriveBits!(
final derived = await r._deriveBits(
_KeyPair(
privateKey: privateKey as PrivateKey,
publicKey: publicKey as PublicKey),
Expand Down Expand Up @@ -1093,7 +1093,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._signBytes != null) {
test('signBytes(plaintext)', () async {
final sig = await r._signBytes!(
final sig = await r._signBytes(
privateKey as PrivateKey,
c.plaintext!,
c.signVerifyParams!,
Expand All @@ -1104,7 +1104,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._signStream != null) {
test('signStream(plaintext)', () async {
final sig = await r._signStream!(
final sig = await r._signStream(
privateKey as PrivateKey,
Stream.value(c.plaintext!),
c.signVerifyParams!,
Expand All @@ -1113,7 +1113,7 @@ void _runTests<PrivateKey, PublicKey>(
});

test('signStream(fibChunked(plaintext))', () async {
final sig = await r._signStream!(
final sig = await r._signStream(
privateKey as PrivateKey,
fibonacciChunkedStream(c.plaintext!),
c.signVerifyParams!,
Expand All @@ -1127,7 +1127,7 @@ void _runTests<PrivateKey, PublicKey>(
if (r._verifyBytes != null) {
test('verifyBytes(signature, plaintext)', () async {
check(
await r._verifyBytes!(
await r._verifyBytes(
publicKey as PublicKey,
signature!,
c.plaintext!,
Expand All @@ -1137,7 +1137,7 @@ void _runTests<PrivateKey, PublicKey>(
);

check(
!await r._verifyBytes!(
!await r._verifyBytes(
publicKey as PublicKey,
flipFirstBits(signature!),
c.plaintext!,
Expand All @@ -1148,7 +1148,7 @@ void _runTests<PrivateKey, PublicKey>(

if (c.plaintext!.isNotEmpty) {
check(
!await r._verifyBytes!(
!await r._verifyBytes(
publicKey as PublicKey,
signature!,
flipFirstBits(c.plaintext!),
Expand All @@ -1163,7 +1163,7 @@ void _runTests<PrivateKey, PublicKey>(
if (r._verifyStream != null) {
test('verifyStream(signature, Stream.value(plaintext))', () async {
check(
await r._verifyStream!(
await r._verifyStream(
publicKey as PublicKey,
signature!,
Stream.value(c.plaintext!),
Expand All @@ -1173,7 +1173,7 @@ void _runTests<PrivateKey, PublicKey>(
);

check(
!await r._verifyStream!(
!await r._verifyStream(
publicKey as PublicKey,
flipFirstBits(signature!),
Stream.value(c.plaintext!),
Expand All @@ -1184,7 +1184,7 @@ void _runTests<PrivateKey, PublicKey>(

if (c.plaintext!.isNotEmpty) {
check(
!await r._verifyStream!(
!await r._verifyStream(
publicKey as PublicKey,
signature!,
Stream.value(flipFirstBits(c.plaintext!)),
Expand All @@ -1197,7 +1197,7 @@ void _runTests<PrivateKey, PublicKey>(

test('verifyStream(signature, fibChunkedStream(plaintext))', () async {
check(
await r._verifyStream!(
await r._verifyStream(
publicKey as PublicKey,
signature!,
fibonacciChunkedStream(c.plaintext!),
Expand All @@ -1207,7 +1207,7 @@ void _runTests<PrivateKey, PublicKey>(
);

check(
!await r._verifyStream!(
!await r._verifyStream(
publicKey as PublicKey,
flipFirstBits(signature!),
fibonacciChunkedStream(c.plaintext!),
Expand All @@ -1218,7 +1218,7 @@ void _runTests<PrivateKey, PublicKey>(

if (c.plaintext!.isNotEmpty) {
check(
!await r._verifyStream!(
!await r._verifyStream(
publicKey as PublicKey,
signature!,
fibonacciChunkedStream(flipFirstBits(c.plaintext!)),
Expand All @@ -1234,7 +1234,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._encryptBytes != null) {
test('encryptBytes(plaintext)', () async {
final ctext = await r._encryptBytes!(
final ctext = await r._encryptBytes(
publicKey as PublicKey,
c.plaintext!,
c.encryptDecryptParams!,
Expand All @@ -1245,7 +1245,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._encryptStream != null) {
test('encryptStream(plaintext)', () async {
final ctext = await bufferStream(r._encryptStream!(
final ctext = await bufferStream(r._encryptStream(
publicKey as PublicKey,
Stream.value(c.plaintext!),
c.encryptDecryptParams!,
Expand All @@ -1254,7 +1254,7 @@ void _runTests<PrivateKey, PublicKey>(
});

test('encryptStream(fibChunked(plaintext))', () async {
final ctext = await bufferStream(r._encryptStream!(
final ctext = await bufferStream(r._encryptStream(
publicKey as PublicKey,
fibonacciChunkedStream(c.plaintext!),
c.encryptDecryptParams!,
Expand All @@ -1267,7 +1267,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._decryptBytes != null) {
test('decryptBytes(plaintext)', () async {
final text = await r._decryptBytes!(
final text = await r._decryptBytes(
privateKey as PrivateKey,
ciphertext!,
c.encryptDecryptParams!,
Expand All @@ -1281,7 +1281,7 @@ void _runTests<PrivateKey, PublicKey>(
// If ciphertext is mangled some primitives like AES-GCM must throw
// others may return garbled plaintext.
try {
final text2 = await r._decryptBytes!(
final text2 = await r._decryptBytes(
privateKey as PrivateKey,
flipFirstBits(ciphertext!),
c.encryptDecryptParams!,
Expand All @@ -1299,7 +1299,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._decryptStream != null) {
test('decryptStream(Stream.value(ciphertext))', () async {
final text = await bufferStream(r._decryptStream!(
final text = await bufferStream(r._decryptStream(
privateKey as PrivateKey,
Stream.value(ciphertext!),
c.encryptDecryptParams!,
Expand All @@ -1313,7 +1313,7 @@ void _runTests<PrivateKey, PublicKey>(
// If ciphertext is mangled some primitives like AES-GCM must throw
// others may return garbled plaintext.
try {
final text2 = await bufferStream(r._decryptStream!(
final text2 = await bufferStream(r._decryptStream(
privateKey as PrivateKey,
Stream.value(flipFirstBits(ciphertext!)),
c.encryptDecryptParams!,
Expand All @@ -1329,7 +1329,7 @@ void _runTests<PrivateKey, PublicKey>(
});

test('decryptStream(fibChunkedStream(ciphertext))', () async {
final text = await bufferStream(r._decryptStream!(
final text = await bufferStream(r._decryptStream(
privateKey as PrivateKey,
fibonacciChunkedStream(ciphertext!),
c.encryptDecryptParams!,
Expand All @@ -1343,7 +1343,7 @@ void _runTests<PrivateKey, PublicKey>(
// If ciphertext is mangled some primitives like AES-GCM must throw
// others may return garbled plaintext.
try {
final text2 = await bufferStream(r._decryptStream!(
final text2 = await bufferStream(r._decryptStream(
privateKey as PrivateKey,
fibonacciChunkedStream(flipFirstBits(ciphertext!)),
c.encryptDecryptParams!,
Expand All @@ -1362,7 +1362,7 @@ void _runTests<PrivateKey, PublicKey>(
//------------------------------ Test derivedBits
if (r._deriveBits != null) {
test('deriveBits', () async {
final derived = await r._deriveBits!(
final derived = await r._deriveBits(
_KeyPair(
privateKey: privateKey as PrivateKey,
publicKey: publicKey as PublicKey),
Expand All @@ -1376,7 +1376,7 @@ void _runTests<PrivateKey, PublicKey>(
//------------------------------ export/import private key
if (r._exportPrivateRawKey != null) {
test('export/import raw private key', () async {
final keyData = await r._exportPrivateRawKey!(privateKey as PrivateKey);
final keyData = await r._exportPrivateRawKey(privateKey as PrivateKey);
check(keyData.isNotEmpty, 'exported key is empty');

final key = await r._importPrivateRawKey!(keyData, c.importKeyParams!);
Expand All @@ -1386,7 +1386,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._exportPrivatePkcs8Key != null) {
test('export/import pkcs8 private key', () async {
final keyData = await r._exportPrivatePkcs8Key!(privateKey as PrivateKey);
final keyData = await r._exportPrivatePkcs8Key(privateKey as PrivateKey);
check(keyData.isNotEmpty, 'exported key is empty');

final key = await r._importPrivatePkcs8Key!(keyData, c.importKeyParams!);
Expand All @@ -1396,7 +1396,7 @@ void _runTests<PrivateKey, PublicKey>(

if (r._exportPrivateJsonWebKey != null) {
test('export/import jwk private key', () async {
final jwk = await r._exportPrivateJsonWebKey!(privateKey as PrivateKey);
final jwk = await r._exportPrivateJsonWebKey(privateKey as PrivateKey);
check(jwk.isNotEmpty, 'exported key is empty');

final key = await r._importPrivateJsonWebKey!(jwk, c.importKeyParams!);
Expand All @@ -1410,7 +1410,7 @@ void _runTests<PrivateKey, PublicKey>(
assert(!r._isSymmetric && r._importPublicRawKey != null);

test('export/import raw public key', () async {
final keyData = await r._exportPublicRawKey!(publicKey as PublicKey);
final keyData = await r._exportPublicRawKey(publicKey as PublicKey);
check(keyData.isNotEmpty, 'exported key is empty');

final key = await r._importPublicRawKey!(keyData, c.importKeyParams!);
Expand All @@ -1422,7 +1422,7 @@ void _runTests<PrivateKey, PublicKey>(
assert(!r._isSymmetric && r._importPublicSpkiKey != null);

test('export/import pkcs8 public key', () async {
final keyData = await r._exportPublicSpkiKey!(publicKey as PublicKey);
final keyData = await r._exportPublicSpkiKey(publicKey as PublicKey);
check(keyData.isNotEmpty, 'exported key is empty');

final key = await r._importPublicSpkiKey!(keyData, c.importKeyParams!);
Expand All @@ -1434,7 +1434,7 @@ void _runTests<PrivateKey, PublicKey>(
assert(!r._isSymmetric && r._importPublicJsonWebKey != null);

test('export/import jwk public key', () async {
final jwk = await r._exportPublicJsonWebKey!(publicKey as PublicKey);
final jwk = await r._exportPublicJsonWebKey(publicKey as PublicKey);
check(jwk.isNotEmpty, 'exported key is empty');

final key = await r._importPublicJsonWebKey!(jwk, c.importKeyParams!);
Expand Down

0 comments on commit 0eac388

Please sign in to comment.