cryptography-kotlin icon indicating copy to clipboard operation
cryptography-kotlin copied to clipboard

Add secp256k1 & brainpool EC curves

Open waltkb opened this issue 1 year ago • 4 comments

waltkb avatar Feb 12 '25 20:02 waltkb

secp256k1:

  • I can confirm this works with val provider = CryptographyProvider.JDK(BouncyCastleProvider()).
  • On the normal JVM provider (val provider = CryptographyProvider.JDK) this also works for me.
  • I also verified that with cryptography-provider-openssl3-prebuilt it works

brainpoolP256r1:

  • works with val provider = CryptographyProvider.JDK(BouncyCastleProvider())
  • and also val provider = CryptographyProvider.Openssl3

waltkb avatar Feb 19 '25 20:02 waltkb

Nice! That means that we could add tests for those in:

  • EcdsaTest - in both tests, probably curves could be extracted in class variable
  • EcCompatibilityTest - it will affect both ECDH and ECDSA tests. Let's add all curves there and see how will it affect tests duration on CI.

secp256k1 is already tested there, so only brainpool curves should be added to tests

whyoleg avatar Feb 19 '25 22:02 whyoleg

Hey @waltkb, are you planning to finalize PR based on the comment above, or could I finish it by myself?

whyoleg avatar Apr 15 '25 18:04 whyoleg

Hi, is it fine like this now?

waltkb avatar Apr 18 '25 00:04 waltkb

Hi there! Thanks for the work on adding the BP curves. As I need to use these curves for a project I would like to help to get this into the next release.

I made a patch replacing the println statements. https://github.com/sake/cryptography-kotlin/tree/add-ec-curves

As the merge request has conflicts I also performed a rebase against main. https://github.com/sake/cryptography-kotlin/tree/add-ec-curves-rebased

I can issue a merge request against the walt repo if that helps. If there is anything more I can do, I'm happy to help.

sake avatar Jun 16 '25 16:06 sake

Hey @sake! Thanks for taking care of it! Feel free to create a PR with your changes (rebased one) against the main (whyoleg) repo. As far as I see, the commits still show @waltkb as an author, so it should be fine, and so both of you will become contributors after the PR is merged :)

whyoleg avatar Jun 16 '25 19:06 whyoleg

Merged via #78

whyoleg avatar Jun 18 '25 05:06 whyoleg