Documentation ¶
Overview ¶
Package hybrid provides subtle implementations of the HKDF and EC primitives.
Index ¶
- func ComputeSharedSecret(pub *ECPoint, priv *ECPrivateKey) ([]byte, error)
- func GetCurve(c string) (elliptic.Curve, error)
- type ECIESAEADHKDFHybridDecrypt
- type ECIESAEADHKDFHybridEncrypt
- type ECIESHKDFRecipientKem
- type ECIESHKDFSenderKem
- type ECPoint
- type ECPrivateKey
- type ECPublicKey
- type EciesAEADHKDFDEMHelper
- type KEMKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSharedSecret ¶
func ComputeSharedSecret(pub *ECPoint, priv *ECPrivateKey) ([]byte, error)
ComputeSharedSecret is used to compute a shared secret using given private key and peer public key.
Types ¶
type ECIESAEADHKDFHybridDecrypt ¶
type ECIESAEADHKDFHybridDecrypt struct {
// contains filtered or unexported fields
}
ECIESAEADHKDFHybridDecrypt is an instance of ECIES decryption with HKDF-KEM (key encapsulation mechanism) and AEAD-DEM (data encapsulation mechanism).
func NewECIESAEADHKDFHybridDecrypt ¶
func NewECIESAEADHKDFHybridDecrypt(pvt *ECPrivateKey, hkdfSalt []byte, hkdfHMACAlgo string, ptFormat string, demHelper EciesAEADHKDFDEMHelper) (*ECIESAEADHKDFHybridDecrypt, error)
NewECIESAEADHKDFHybridDecrypt returns ECIES decryption construct with HKDF-KEM (key encapsulation mechanism) and AEAD-DEM (data encapsulation mechanism).
type ECIESAEADHKDFHybridEncrypt ¶
type ECIESAEADHKDFHybridEncrypt struct {
// contains filtered or unexported fields
}
ECIESAEADHKDFHybridEncrypt is an instance of ECIES encryption with HKDF-KEM (key encapsulation mechanism) and AEAD-DEM (data encapsulation mechanism).
func NewECIESAEADHKDFHybridEncrypt ¶
func NewECIESAEADHKDFHybridEncrypt(pub *ECPublicKey, hkdfSalt []byte, hkdfHMACAlgo string, ptFormat string, demHelper EciesAEADHKDFDEMHelper) (*ECIESAEADHKDFHybridEncrypt, error)
NewECIESAEADHKDFHybridEncrypt returns ECIES encryption construct with HKDF-KEM (key encapsulation mechanism) and AEAD-DEM (data encapsulation mechanism).
type ECIESHKDFRecipientKem ¶
type ECIESHKDFRecipientKem struct {
// contains filtered or unexported fields
}
ECIESHKDFRecipientKem represents a HKDF-based KEM (key encapsulation mechanism) for ECIES recipient.
type ECIESHKDFSenderKem ¶
type ECIESHKDFSenderKem struct {
// contains filtered or unexported fields
}
ECIESHKDFSenderKem represents HKDF-based ECIES-KEM (key encapsulation mechanism) for ECIES sender.
type ECPrivateKey ¶
type ECPrivateKey struct { PublicKey ECPublicKey D *big.Int }
ECPrivateKey represents a elliptic curve public key.
func GenerateECDHKeyPair ¶
func GenerateECDHKeyPair(c elliptic.Curve) (*ECPrivateKey, error)
GenerateECDHKeyPair will create a new private key for a given curve.
func GetECPrivateKey ¶
func GetECPrivateKey(c elliptic.Curve, b []byte) *ECPrivateKey
GetECPrivateKey converts a stored private key to ECPrivateKey.
type ECPublicKey ¶
ECPublicKey represents a elliptic curve public key.
type EciesAEADHKDFDEMHelper ¶
type EciesAEADHKDFDEMHelper interface { // GetSymmetricKeySize gives the size of the DEM-key in bytes GetSymmetricKeySize() uint32 // GetAEAD returns the newly created AEAD primitive. GetAEAD(symmetricKeyValue []byte) (tink.AEAD, error) }
EciesAEADHKDFDEMHelper a helper for DEM (data encapsulation mechanism) of ECIES-AEAD-HKDF.