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

x/crypto: Support for sect571r1 in elliptic #36712

Closed
pramoths opened this issue Jan 23, 2020 · 2 comments
Closed

x/crypto: Support for sect571r1 in elliptic #36712

pramoths opened this issue Jan 23, 2020 · 2 comments

Comments

@pramoths
Copy link

@pramoths pramoths commented Jan 23, 2020

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

$ go version
go version go1.10.3 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 GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\----\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\----\go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\----\AppData\Local\Temp\go-build094907166=/tmp/go-build -gno-record-gcc-switches

What did you do?

I am trying to import privatekey generated with sunec 'sect571r1'

func decodePrivateKeyFromString(pemEncoded string) (*ecdsa.PrivateKey, error) {
val, _ := base64.StdEncoding.DecodeString(pemEncoded)
fmt.Println(string(val))
privateKey, err := x509.ParsePKCS8PrivateKey(val)
if err != nil {
fmt.Println(err)
return nil, errors.New("Failed to parse ECDSA private key")
}
switch privateKey := privateKey.(type) {
case *ecdsa.PrivateKey:
return privateKey, nil
}
return nil, errors.New("Unsupported public key type")
}

What did you expect to see?

To get the private key

What did you see instead?

x509: unknown elliptic curve

@toothrot toothrot changed the title Support for sect571r1 in elliptic x/crypto: Support for sect571r1 in elliptic Jan 23, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jan 23, 2020
@toothrot
Copy link
Contributor

@toothrot toothrot commented Jan 23, 2020

@FiloSottile
Copy link
Member

@FiloSottile FiloSottile commented Jan 23, 2020

sect571r1 aka B-571 is a rarely used binary curve. Binary curves have a worse security track record than ones on prime fields, and anyway implementing a new curve involves a lot of complexity which we are not going to carry unless it would be very widely used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.