package symmetric
import "github.com/ProtonMail/go-crypto/openpgp/symmetric"
Index ¶
- func ComputeBindingHash(seed [32]byte) []byte
- type AEADPrivateKey
- func AEADGenerateKey(rand io.Reader, cipher algorithm.CipherFunction, aead algorithm.AEADMode) (priv *AEADPrivateKey, err error)
- func (priv *AEADPrivateKey) Decrypt(ivAndCiphertext []byte, mode algorithm.AEADMode) (message []byte, err error)
- type AEADPublicKey
- type ExperimentalAEADPrivateKey
- func ExperimentalAEADGenerateKey(rand io.Reader, cipher algorithm.CipherFunction) (priv *ExperimentalAEADPrivateKey, err error)
- func (priv *ExperimentalAEADPrivateKey) Decrypt(nonce []byte, ciphertext []byte, mode algorithm.AEADMode) (message []byte, err error)
- type ExperimentalAEADPublicKey
- type ExperimentalHMACPrivateKey
- func ExperimentalHMACGenerateKey(rand io.Reader, hash algorithm.Hash) (priv *ExperimentalHMACPrivateKey, err error)
- func (priv *ExperimentalHMACPrivateKey) Public() crypto.PublicKey
- func (priv *ExperimentalHMACPrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
- type ExperimentalHMACPublicKey
- type HMACPrivateKey
- func HMACGenerateKey(rand io.Reader, hash algorithm.Hash) (priv *HMACPrivateKey, err error)
- func (priv *HMACPrivateKey) Public() crypto.PublicKey
- func (priv *HMACPrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
- type HMACPublicKey
Functions ¶
func ComputeBindingHash ¶
Types ¶
type AEADPrivateKey ¶
type AEADPrivateKey struct {
PublicKey AEADPublicKey
Key []byte
}
func AEADGenerateKey ¶
func AEADGenerateKey(rand io.Reader, cipher algorithm.CipherFunction, aead algorithm.AEADMode) (priv *AEADPrivateKey, err error)
func (*AEADPrivateKey) Decrypt ¶
func (priv *AEADPrivateKey) Decrypt(ivAndCiphertext []byte, mode algorithm.AEADMode) (message []byte, err error)
type AEADPublicKey ¶
type AEADPublicKey struct {
Cipher algorithm.CipherFunction
AEADMode algorithm.AEADMode
FpSeed [32]byte
// While this is a "public" key, the symmetric key needs to be present here.
// Symmetric cryptographic operations use the same key material for
// signing and verifying, and go-crypto assumes that a public key type will
// be used for encryption. Thus, this `Key` field must never be exported
// publicly.
Key []byte
}
func (*AEADPublicKey) Encrypt ¶
func (pub *AEADPublicKey) Encrypt(rand io.Reader, data []byte, mode algorithm.AEADMode) (nonce []byte, ciphertext []byte, err error)
type ExperimentalAEADPrivateKey ¶
type ExperimentalAEADPrivateKey struct {
PublicKey ExperimentalAEADPublicKey
HashSeed [32]byte
Key []byte
}
func ExperimentalAEADGenerateKey ¶
func ExperimentalAEADGenerateKey(rand io.Reader, cipher algorithm.CipherFunction) (priv *ExperimentalAEADPrivateKey, err error)
func (*ExperimentalAEADPrivateKey) Decrypt ¶
func (priv *ExperimentalAEADPrivateKey) Decrypt(nonce []byte, ciphertext []byte, mode algorithm.AEADMode) (message []byte, err error)
type ExperimentalAEADPublicKey ¶
type ExperimentalAEADPublicKey struct {
Cipher algorithm.CipherFunction
BindingHash [32]byte
Key []byte
}
func (*ExperimentalAEADPublicKey) Encrypt ¶
func (pub *ExperimentalAEADPublicKey) Encrypt(rand io.Reader, data []byte, mode algorithm.AEADMode) (nonce []byte, ciphertext []byte, err error)
type ExperimentalHMACPrivateKey ¶
type ExperimentalHMACPrivateKey struct {
PublicKey ExperimentalHMACPublicKey
HashSeed [32]byte
Key []byte
}
func ExperimentalHMACGenerateKey ¶
func ExperimentalHMACGenerateKey(rand io.Reader, hash algorithm.Hash) (priv *ExperimentalHMACPrivateKey, err error)
func (*ExperimentalHMACPrivateKey) Public ¶
func (priv *ExperimentalHMACPrivateKey) Public() crypto.PublicKey
func (*ExperimentalHMACPrivateKey) Sign ¶
func (priv *ExperimentalHMACPrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
type ExperimentalHMACPublicKey ¶
type ExperimentalHMACPublicKey struct {
Hash algorithm.Hash
BindingHash [32]byte
// While this is a "public" key, the symmetric key needs to be present here.
// Symmetric cryptographic operations use the same key material for
// signing and verifying, and go-crypto assumes that a public key type will
// be used for verification. Thus, this `Key` field must never be exported
// publicly.
Key []byte
}
func (*ExperimentalHMACPublicKey) Verify ¶
func (pub *ExperimentalHMACPublicKey) Verify(digest []byte, signature []byte) (bool, error)
type HMACPrivateKey ¶
type HMACPrivateKey struct {
PublicKey HMACPublicKey
Key []byte
}
func HMACGenerateKey ¶
func (*HMACPrivateKey) Public ¶
func (priv *HMACPrivateKey) Public() crypto.PublicKey
func (*HMACPrivateKey) Sign ¶
func (priv *HMACPrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
type HMACPublicKey ¶
type HMACPublicKey struct {
Hash algorithm.Hash
FpSeed [32]byte
// While this is a "public" key, the symmetric key needs to be present here.
// Symmetric cryptographic operations use the same key material for
// signing and verifying, and go-crypto assumes that a public key type will
// be used for verification. Thus, this `Key` field must never be exported
// publicly.
Key []byte
}
func (*HMACPublicKey) Verify ¶
func (pub *HMACPublicKey) Verify(digest []byte, signature []byte) (bool, error)
Source Files ¶
aead.go experimental_aead.go experimental_hmac.go hmac.go
- Version
- v1.4.0-proton
- Published
- Feb 27, 2026
- Platform
- windows/amd64
- Imports
- 6 packages
- Last checked
- 1 hour ago –
Tools for package owners.