Documentation ¶
Overview ¶
Package hpke provides RFC9180 hybrid public key encryption features.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AEAD ¶
type AEAD uint16
const ( // AEAD_AES128GCM is AES-128 block cipher in Galois Counter Mode (GCM). AEAD_AES128GCM AEAD = 0x01 // AEAD_AES256GCM is AES-256 block cipher in Galois Counter Mode (GCM). AEAD_AES256GCM AEAD = 0x02 // AEAD_ChaCha20Poly1305 is ChaCha20 stream cipher and Poly1305 MAC. AEAD_ChaCha20Poly1305 AEAD = 0x03 // AEAD_EXPORT_ONLY is reserved for applications that only use the Exporter // interface. AEAD_EXPORT_ONLY AEAD = 0xFFFF )
type KEM ¶
type KEM uint16
const ( // KEM_P256_HKDF_SHA256 is a KEM using P-256 curve and HKDF with SHA-256. KEM_P256_HKDF_SHA256 KEM = 0x10 // KEM_P384_HKDF_SHA384 is a KEM using P-384 curve and HKDF with SHA-384. KEM_P384_HKDF_SHA384 KEM = 0x11 // KEM_P521_HKDF_SHA512 is a KEM using P-521 curve and HKDF with SHA-512. KEM_P521_HKDF_SHA512 KEM = 0x12 // KEM_X25519_HKDF_SHA256 is a KEM using X25519 Diffie-Hellman function // and HKDF with SHA-256. KEM_X25519_HKDF_SHA256 KEM = 0x20 )
type Opener ¶
type Opener interface { Exporter // Open tries to authenticate and decrypt a ciphertext with associated // additional data. The nonce is handled internally. Open(ct, aad []byte) (pt []byte, err error) }
Opener decrypts a ciphertext using an AEAD encryption.
type Receiver ¶
type Receiver interface { SetupBase(enc []byte) (Opener, error) SetupPSK(enc []byte, psk, pskID []byte) (Opener, error) SetupAuth(enc []byte, pkS *ecdh.PublicKey) (Opener, error) SetupAuthPSK(enc []byte, psk, pskID []byte, pkS *ecdh.PublicKey) (Opener, error) }
Receiver describes message receiver contract.
type Sealer ¶
type Sealer interface { Exporter // Seal encrypts a given plaintext a plaintext with associated data. // The nonce is managed internally. Seal(pt, aad []byte) (ct []byte, err error) }
Sealer encrypts a plaintext using an AEAD encryption.
type Sender ¶
type Sender interface { SetupBase() ([]byte, Sealer, error) SetupPSK(psk, pskID []byte) ([]byte, Sealer, error) SetupAuth(skS *ecdh.PrivateKey) ([]byte, Sealer, error) SetupAuthPSK(psk, pskID []byte, skS *ecdh.PrivateKey) ([]byte, Sealer, error) }
Sender describes message sender contract.
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite represents HPKE suite parameters.
Click to show internal directories.
Click to hide internal directories.