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

proposal: crypto/elliptic: Make suggested alternative api more clear for ScalarMult #69567

Closed
zhiqiangxu opened this issue Sep 21, 2024 · 2 comments
Labels
Milestone

Comments

@zhiqiangxu
Copy link
Contributor

zhiqiangxu commented Sep 21, 2024

Proposal Details

The Curve.ScalarMult is supposed to be deprecated according to here:

// ScalarMult returns k*(x,y) where k is an integer in big-endian form.
//
// Deprecated: this is a low-level unsafe API. For ECDH, use the crypto/ecdh
// package. Most uses of ScalarMult can be replaced by a call to the ECDH
// methods of NIST curves in crypto/ecdh.

But it's not very clear how to actually deprecate the ScalarMult call, and thus go-ethereum is still using this deprecated API:

secret, _ := crypto.S256().ScalarMult(cardPublic.X, cardPublic.Y, key.D.Bytes())

(source)

I don't think the rationale for deprecating this widely used method is very clear.

@gopherbot gopherbot added this to the Proposal milestone Sep 21, 2024
@zhiqiangxu zhiqiangxu changed the title proposal: crypto/elliptic: Add suggested alternative api more clear for ScalarMult proposal: crypto/elliptic: Make suggested alternative api more clear for ScalarMult Sep 21, 2024
@gabyhelp
Copy link

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@seankhliao
Copy link
Member

see #52221

It is not a goal of the standard library to support these operations.
You may continue to use deprecated functions.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants