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

Add support for Ed25519 to NativeCrypto #1286

Closed
wants to merge 12 commits into from
Closed

Conversation

juergw
Copy link
Contributor

@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
Contributor 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