Skip to content

crypto/hpke: does not support X-Wing keys backed by KMS #78591

Description

@misha-drozd

Go version

go version go1.26.2 darwin/arm64

Output of go env in your module/workspace:

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/misha/drozd/_deps/go@1.26.2/bin'
GOCACHE='/Users/misha/drozd/_cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/misha/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/5c/8gj0vdr51bn_3q8pr2l708lr0000gn/T/go-build2330383098=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/misha/drozd/go.mod'
GOMODCACHE='/Users/misha/drozd/_cache/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/misha/drozd/_cache/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/misha/drozd/_deps/go@1.26.2'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/misha/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/Users/misha/drozd/_deps/go@1.26.2/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.26.2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I have tried to implement hpke.PrivateKey and hpke.PublicKey backed by Google Cloud KMS. That KMS provides support for X-Wing: https://docs.cloud.google.com/kms/docs/key-encapsulation-mechanisms#pqc

What did you see happen?

NewHybridPrivateKey and NewHybridPublicKey accept ML-KEM and X25519 keys separately, and one cannot even implement a pair of crypto.Encapsulator / crypto.Decapsulator interfaces that delegate to KMS.

What did you expect to see?

I expected a way to construct crypto.Encapsulator / crypto.Decapsulator that can delegate to GCP Cloud KMS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions