Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix CryptographyTests #15529

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void verifySyncEd25519Only(final int count) {
signatures[i] = ed25519SignaturePool.next();
final SignatureComponents components = extractComponents(signatures[i]);
assertTrue(cryptography.verifySync(
components.data(), components.publicKey(), components.signatureBytes(), SignatureType.ED25519));
components.data(), components.signatureBytes(), components.publicKey(), SignatureType.ED25519));
}
}

Expand All @@ -129,8 +129,8 @@ void verifySyncEcdsaSecp256k1Only(final int count) {
assertTrue(
cryptography.verifySync(
components.data(),
components.publicKey(),
components.signatureBytes(),
components.publicKey(),
SignatureType.ECDSA_SECP256K1),
"Signature should be valid");
}
Expand All @@ -145,8 +145,8 @@ void verifySyncInvalidEcdsaSecp256k1() {
assertFalse(
cryptography.verifySync(
components.data(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
components.signatureBytes(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
SignatureType.ECDSA_SECP256K1),
"Fails for invalid signature");
}
Expand All @@ -160,8 +160,8 @@ void verifySyncInvalidEd25519() {
assertFalse(
cryptography.verifySync(
components.data(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
components.signatureBytes(),
Arrays.copyOfRange(components.publicKey(), 0, components.publicKey().length - 1),
SignatureType.ED25519),
"Fails for invalid signature");
}
Expand Down Expand Up @@ -195,7 +195,7 @@ private SignatureComponents extractComponents(final TransactionSignature signatu
.position(signature.getSignatureOffset())
.get(signatureBytes);

return new SignatureComponents(data, signatureBytes, publicKey);
return new SignatureComponents(data, publicKey, signatureBytes);
}

private void checkMessages(final Message... messages) throws ExecutionException, InterruptedException {
Expand Down
Loading