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

crypto/ecdsa: The GenerateKey method cannot maintain consistency #63463

Closed
tossp opened this issue Oct 9, 2023 · 1 comment
Closed

crypto/ecdsa: The GenerateKey method cannot maintain consistency #63463

tossp opened this issue Oct 9, 2023 · 1 comment

Comments

@tossp
Copy link

tossp commented Oct 9, 2023

What version of Go are you using (go version)?

$ go version
go version go1.21.2 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env 
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\ts\AppData\Local\go-build
set GOENV=C:\Users\ts\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\ts\.go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\ts\.go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,https://goproxy.io,https://proxy.golang.org,direct
set GOROOT=C:\Users\ts\develop\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Users\ts\develop\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\ts\proj\go-site\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\ts\AppData\Local\Temp\go-build61053653=/tmp/go-build -gno-record-gcc-switch

What did you do?

I tried to give ecdsa.GenerateKey a fixed seed to generate a key, but two different key pairs appeared. Is it because I used them incorrectly? Or should we not use this method. There are no issues with 1.19 and its previous versions

https://go.dev/play/p/-xTC8xOiFtp
https://go.dev/play/p/_rY-hh0sEze

What did you expect to see?

Dome go1.21.2
GOROOT: /usr/local/go-faketime
GOPATH: 
GOARCH: amd64

Program exited.

What did you see instead?

PrivateKey Equal MIHcAgEBBEIBffxTPwQKvaYsgdQRcgBYed2+gF/TOjS+YuK30RvApI9L5r69RlX25ALY67KswqkB8LNsQ5z4Jkd39Q1OlXaxVCugBwYFK4EEACOhgYkDgYYABABMUy+HvA2T86IW748EJrHYK2gBxOdJYyM5JICxOuycm6bAWmFHkxhfLNZ26pYWGyHzPZcvBOCmC+mAxZuOGi98qQE8MZuBKJPKWUTsG8QrNsAXNfPHC2VP9CpypZBNXTYm3XfV83VyjUCqJsAllVwetOE3FKVTZl0HnlZopkzJQjxStg==
PublicKey Equal MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQATFMvh7wNk/OiFu+PBCax2CtoAcTnSWMjOSSAsTrsnJumwFphR5MYXyzWduqWFhsh8z2XLwTgpgvpgMWbjhovfKkBPDGbgSiTyllE7BvEKzbAFzXzxwtlT/QqcqWQTV02Jt131fN1co1AqibAJZVcHrThNxSlU2ZdB55WaKZMyUI8UrY=
GOVersion go1.21.2
GOROOT /usr/local/go-faketime
GOPATH 
GOARCH amd64
@tossp
Copy link
Author

tossp commented Oct 9, 2023

duplicate #58637

@tossp tossp closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant