8000 The EC parameters in `Secp256k1` are divergent from `BcKeyUtils` · Issue #446 · XRPLF/xrpl4j · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The EC parameters in Secp256k1 are divergent from BcKeyUtils #446

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

Closed
sappenin opened this issue Jul 12, 2023 · 0 comments
Closed

The EC parameters in Secp256k1 are divergent from BcKeyUtils #446

sappenin opened this issue Jul 12, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sappenin
Copy link
Collaborator

It turns out that the underlying implementation of a Curve point in ECPrivateKeyParameters is different between Secp256k1.java and BcKeyUtils.java (this only manifests as a test failure starting in BouncyCastle v1.74 and above -- broken build here).

For consistency, we should make everything use BcKeyUtils.PARAMS and deprecate Secp256k1 (slated for removal in v4).

Appendix

Test failure

java.lang.AssertionError: 
Expecting actual:
  org.bouncycastle.crypto.params.ECPrivateKeyParameters@2462cb01
to be equal to:
  org.bouncycastle.crypto.params.ECPrivateKeyParameters@19b843ba
when recursively comparing field by field, but found the following 5 differences:

field/property 'parameters.G.curve' differ:
- actual value  : org.bouncycastle.math.ec.ECCurve$Fp@61722b91
- expected value: org.bouncycastle.math.ec.custom.sec.SecP256K1Curve@61722b91
org.bouncycastle.math.ec.ECCurve$Fp can't be compared to org.bouncycastle.math.ec.custom.sec.SecP256K1Curve as SecP256K1Curve does not declare all Fp fields, it lacks these: [q, r]
@sappenin sappenin added the bug Something isn't working label Jul 12, 2023
@sappenin sappenin added this to the v3.0 milestone Jul 12, 2023
@sappenin sappenin self-assigned this Jul 12, 2023
sappenin added a commit that referenced this issue Jul 12, 2023
* Use `BcKeyUtils` values everywhere.
* Deprecate unused interface that is public.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0