Add existing HPKE project files
This commit is contained in:
15
crypto/ecdh/interfaces.go
Normal file
15
crypto/ecdh/interfaces.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// Package ecdh defines an additional interface that will be added to the
|
||||
// crypto/ecdh package in Go 1.26+.
|
||||
package ecdh
|
||||
|
||||
import "crypto/ecdh"
|
||||
|
||||
// KeyExchanger is an interface for an opaque private key that can be used for
|
||||
// key exchange operations. For example, an ECDH key kept in a hardware module.
|
||||
//
|
||||
// It is implemented by [ecdh.PrivateKey].
|
||||
type KeyExchanger interface {
|
||||
PublicKey() *ecdh.PublicKey
|
||||
Curve() ecdh.Curve
|
||||
ECDH(*ecdh.PublicKey) ([]byte, error)
|
||||
}
|
||||
15
crypto/ecdh/stubs.go
Normal file
15
crypto/ecdh/stubs.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package ecdh
|
||||
|
||||
import "crypto/ecdh"
|
||||
|
||||
// This file contains stubs to allow importing only this package instead of
|
||||
// crypto/ecdh, to minimize the diff.
|
||||
|
||||
type Curve = ecdh.Curve
|
||||
type PrivateKey = ecdh.PrivateKey
|
||||
type PublicKey = ecdh.PublicKey
|
||||
|
||||
func X25519() Curve { return ecdh.X25519() }
|
||||
func P256() Curve { return ecdh.P256() }
|
||||
func P384() Curve { return ecdh.P384() }
|
||||
func P521() Curve { return ecdh.P521() }
|
||||
Reference in New Issue
Block a user