crypto/ecdsa: custom curve implementations are not supported with boringcrypto #54486
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
I don't know if you are interested with
boringcrypto
related reports, if not just close this issue.What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (assuming you build with boringcrypto).
No if you use the go native implementation.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
This is because the boring crypto tries to match the curve name to
P-224
,P-256
,P-384
orP-521
and if this fails return an error:go/src/crypto/internal/boring/ecdsa.go
Lines 40 to 52 in e49e876
In my case
secp256p1
is implement by having custom ECC methods:https://github.com/decred/dcrd/blob/master/dcrec/secp256k1/ellipticadaptor.go
I expect
crypto/ecdsa
to fallback to the native golang implementation which would call into thoses custom methods and work (like it already do if I build withoutboringcrypto
) if I pass in a custom curve.Adding
secp256k1
support to the boringcrypto wrapper (if possible) would also solve my issue, but it doesn't feel like the right thing to do if done alone.The text was updated successfully, but these errors were encountered: