mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/ecdsa: deprecate direct use of big.Int fields in keys
Updates #63963 Change-Id: I6a6a69645e625cde1ac1c6abf698a5fd3d52b4cf Reviewed-on: https://go-review.googlesource.com/c/go/+/701516 Auto-Submit: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
a67977da5e
commit
645ee44492
3 changed files with 6 additions and 6 deletions
3
api/next/63963.txt
Normal file
3
api/next/63963.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
pkg crypto/ecdsa, type PrivateKey struct, D //deprecated #63963
|
||||||
|
pkg crypto/ecdsa, type PublicKey struct, X //deprecated #63963
|
||||||
|
pkg crypto/ecdsa, type PublicKey struct, Y //deprecated #63963
|
||||||
1
doc/next/6-stdlib/99-minor/crypto/ecdsa/63963.md
Normal file
1
doc/next/6-stdlib/99-minor/crypto/ecdsa/63963.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
The `big.Int` fields of [PublicKey] and [PrivateKey] are now deprecated.
|
||||||
|
|
@ -44,15 +44,13 @@ type PublicKey struct {
|
||||||
|
|
||||||
// X, Y are the coordinates of the public key point.
|
// X, Y are the coordinates of the public key point.
|
||||||
//
|
//
|
||||||
// Modifying the raw coordinates can produce invalid keys, and may
|
// Deprecated: modifying the raw coordinates can produce invalid keys, and may
|
||||||
// invalidate internal optimizations; moreover, [big.Int] methods are not
|
// invalidate internal optimizations; moreover, [big.Int] methods are not
|
||||||
// suitable for operating on cryptographic values. To encode and decode
|
// suitable for operating on cryptographic values. To encode and decode
|
||||||
// PublicKey values, use [PublicKey.Bytes] and [ParseUncompressedPublicKey]
|
// PublicKey values, use [PublicKey.Bytes] and [ParseUncompressedPublicKey]
|
||||||
// or [crypto/x509.MarshalPKIXPublicKey] and [crypto/x509.ParsePKIXPublicKey].
|
// or [crypto/x509.MarshalPKIXPublicKey] and [crypto/x509.ParsePKIXPublicKey].
|
||||||
// For ECDH, use [crypto/ecdh]. For lower-level elliptic curve operations,
|
// For ECDH, use [crypto/ecdh]. For lower-level elliptic curve operations,
|
||||||
// use a third-party module like filippo.io/nistec.
|
// use a third-party module like filippo.io/nistec.
|
||||||
//
|
|
||||||
// These fields will be deprecated in Go 1.26.
|
|
||||||
X, Y *big.Int
|
X, Y *big.Int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,14 +169,12 @@ type PrivateKey struct {
|
||||||
|
|
||||||
// D is the private scalar value.
|
// D is the private scalar value.
|
||||||
//
|
//
|
||||||
// Modifying the raw value can produce invalid keys, and may
|
// Deprecated: modifying the raw value can produce invalid keys, and may
|
||||||
// invalidate internal optimizations; moreover, [big.Int] methods are not
|
// invalidate internal optimizations; moreover, [big.Int] methods are not
|
||||||
// suitable for operating on cryptographic values. To encode and decode
|
// suitable for operating on cryptographic values. To encode and decode
|
||||||
// PrivateKey values, use [PrivateKey.Bytes] and [ParseRawPrivateKey] or
|
// PrivateKey values, use [PrivateKey.Bytes] and [ParseRawPrivateKey] or
|
||||||
// [crypto/x509.MarshalPKCS8PrivateKey] and [crypto/x509.ParsePKCS8PrivateKey].
|
// [crypto/x509.MarshalPKCS8PrivateKey] and [crypto/x509.ParsePKCS8PrivateKey].
|
||||||
// For ECDH, use [crypto/ecdh].
|
// For ECDH, use [crypto/ecdh].
|
||||||
//
|
|
||||||
// This field will be deprecated in Go 1.26.
|
|
||||||
D *big.Int
|
D *big.Int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue