...
Package hpke
- Variables
- func ParseHPKEPublicKey(kemID uint16, bytes []byte) (*ecdh.PublicKey, error)
- func SuiteID(kemID, kdfID, aeadID uint16) []byte
- type Sender
- func SetupSender(kemID, kdfID, aeadID uint16, pub crypto.PublicKey, info []byte) ([]byte, *Sender, error)
- func (s *Sender) Seal(aad, plaintext []byte) ([]byte, error)
Package files
hpke.go
Variables
var SupportedAEADs = map[uint16]struct {
keySize int
nonceSize int
aead func([]byte) (cipher.AEAD, error)
}{
0x0001: {},
0x0002: {},
0x0003: {},
}
var SupportedKDFs = map[uint16]func() *hkdfKDF{
0x0001: func() *hkdfKDF { return &hkdfKDF{crypto.SHA256} },
}
var SupportedKEMs = map[uint16]struct {
curve ecdh.Curve
hash crypto.Hash
nSecret uint16
}{
0x0020: {ecdh.X25519(), crypto.SHA256, 32},
}
func ParseHPKEPublicKey(kemID uint16, bytes []byte) (*ecdh.PublicKey, error)
func SuiteID(kemID, kdfID, aeadID uint16) []byte
type Sender struct {
}
func SetupSender(kemID, kdfID, aeadID uint16, pub crypto.PublicKey, info []byte) ([]byte, *Sender, error)
func (*Sender) Seal
¶
func (s *Sender) Seal(aad, plaintext []byte) ([]byte, error)