EdDSA: Use BouncyCastle implementation. #73
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Buddys,
Since BouncyCastle published their EdDSA implementation, loading key files using
buddy.core.keys/public-key
andbuddy.core.keys/private-key
started loading the BC key classes instead of those from net.i2p.crypto. Since I was not using jwks in my app this was a problem.I went ahead and replaced the original library with the BouncyCastle implementation, and removed the dependency.
There is one minor issue with this implementation which may cause JVM security or reflection warnings The constructor to this class is not public, so we use some reflection hacks to access it. https://github.com/bcgit/bc-java/blob/bc3b92f1f0e78b82e2584c5fb4b226a13e7f8b3b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/edec/BCEdDSAPrivateKey.java#L32
I will be submitting a PR to BouncyCastle to open that constructor up in the meantime.
Stack trace for reference on the original issue