Documentation
¶
Overview ¶
Package transform maps IKEv2 IANA transform IDs onto concrete cryptographic primitives.
It is the seam between the wire protocol and the algorithm implementations: internal/payload owns the transform-ID registry, internal/cryptoutil owns the primitives and knows nothing about IKEv2, and this package is the only place that translates between them. Keeping the lookup here is what lets cryptoutil stay reusable by other VPN protocols, whose registries number the same algorithms differently.
Adding an algorithm means adding a case here plus a constructor in cryptoutil.
Index ¶
- func Cipher(encrID uint16, keyBits int) (cryptoutil.SKCipher, error)
- func DH(id uint16) (cryptoutil.DHGroup, error)
- func ESPCrypter(encrID uint16, keyBits int, encKey []byte, integID uint16, integKey []byte) (cryptoutil.ESPCrypter, error)
- func Integrity(id uint16) (*cryptoutil.Integrity, error)
- func PRF(id uint16) (*cryptoutil.PRF, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cipher ¶
func Cipher(encrID uint16, keyBits int) (cryptoutil.SKCipher, error)
Cipher returns the SK (handshake) cipher for an ENCR transform ID and key length in bits; 0 bits selects the algorithm's default.
func DH ¶
func DH(id uint16) (cryptoutil.DHGroup, error)
DH returns the Diffie-Hellman group for a DH transform ID. The NIST curves transmit bare X||Y on the wire (RFC 5903), so their point prefix is stripped; Curve25519 has no such prefix.
func ESPCrypter ¶
func ESPCrypter(encrID uint16, keyBits int, encKey []byte, integID uint16, integKey []byte) (cryptoutil.ESPCrypter, error)
ESPCrypter returns a prepared data-path crypter for an ESP transform. encKey carries the 4-octet GCM salt for AEAD suites; integID/integKey are used only by non-AEAD (CBC) suites.
Types ¶
This section is empty.