You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since #28946, in particular commit ab49f22, the Encrypt() and Decrypt() functions in the crypto/ecies require the public keys to implement the crypto.EllipticCurve interface, otherwise they return ecies.ErrInvalidCurve. Consequentially, since this change the ecies package no longer accepts ECDSA keys as returned by the Go standard library, e.g. generated with ecdsa.GenerateKey(elliptic.P256(), rand.Reader), since those do not implement crypto.EllipticCurve. This used to work fine in versions v1.13.x, as shown by the following test, which works in v1.13.x and fails in v1.14.x:
At the same time, in the ecies package the functions ExportECDSA(), ImportECDSA() and ImportECDSAPublic() for importing ecdsa.PublicKey and ecdsa.PrivateKey instances still exist. Those sort of suggest that using ordinary ECDSA keys (i.e. P256 keys from the Go standard library) should work, as well as these ECIES parameters being set up for the P256 curve from the standard library.
Should using ECDSA keys from the Go standard library work? In other words, is it a bug that the above test fails?
The text was updated successfully, but these errors were encountered:
Are you compiling both tests with the same go version ?
Tagged this as triage, as we should have a discussion about ecies imo. We should in my opinion make it very clear that our ecies implementation should not be used or imported by 3rd parties, since we don't have the capabilities to properly maintain it atm
Since #28946, in particular commit ab49f22, the
Encrypt()
andDecrypt()
functions in thecrypto/ecies
require the public keys to implement thecrypto.EllipticCurve
interface, otherwise they returnecies.ErrInvalidCurve
. Consequentially, since this change theecies
package no longer accepts ECDSA keys as returned by the Go standard library, e.g. generated withecdsa.GenerateKey(elliptic.P256(), rand.Reader)
, since those do not implementcrypto.EllipticCurve
. This used to work fine in versions v1.13.x, as shown by the following test, which works in v1.13.x and fails in v1.14.x:At the same time, in the
ecies
package the functionsExportECDSA()
,ImportECDSA()
andImportECDSAPublic()
for importingecdsa.PublicKey
andecdsa.PrivateKey
instances still exist. Those sort of suggest that using ordinary ECDSA keys (i.e. P256 keys from the Go standard library) should work, as well as these ECIES parameters being set up for the P256 curve from the standard library.Should using ECDSA keys from the Go standard library work? In other words, is it a bug that the above test fails?
The text was updated successfully, but these errors were encountered: