Skip to content

Conversation

@juergw
Copy link
Collaborator

@juergw juergw commented Jan 9, 2025

BoringSSL doesn't support Ed25519 with EVP_DigestUpdate, only
with EVP_DigestSign and EVP_DigestVerify. So we need to add wrappers
of these functions to NativeCrypto.

If the user wants to encrypt and calls doFinal(input, 123, 0); without a prior call to update,
it currently fails with an array out of bounds exception.

Instead, it should encrypt the empty string.
Some tests are now not run, because they use the same IV
as the previous test case. And that results in an
InvalidAlgorithmParameterException that gets ignored.

To not re-use IVs twice, we now run init with a different IV first.
And we don't ignore InvalidAlgorithmParameterException caused by IV reuse.
BoringSSL doesn't support Ed25519 with EVP_DigestUpdate, only
with EVP_DigestSign and EVP_DigestVerify. So we have to add these
to NativeCrypto.
Ed25519 doesn't use a hash function, so it doesn't need to be set.
@juergw
Copy link
Collaborator Author

juergw commented Jan 9, 2025

I'll close this and make a new pull request. I don't want to change the lines I didn't touch.

@juergw juergw closed this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant