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) (priv *AEADPrivateKey, err error)
- func (priv *AEADPrivateKey) Decrypt(nonce []byte, ciphertext []byte, mode algorithm.AEADMode) (message []byte, err error)
- type AEADPublicKey
- 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
HashSeed [32]byte
Key []byte
}
func AEADGenerateKey ¶
func AEADGenerateKey(rand io.Reader, cipher algorithm.CipherFunction) (priv *AEADPrivateKey, err error)
func (*AEADPrivateKey) Decrypt ¶
func (priv *AEADPrivateKey) Decrypt(nonce []byte, ciphertext []byte, mode algorithm.AEADMode) (message []byte, err error)
type AEADPublicKey ¶
type AEADPublicKey struct {
Cipher algorithm.CipherFunction
BindingHash [32]byte
Key []byte
}
func (*AEADPublicKey) Encrypt ¶
func (pub *AEADPublicKey) Encrypt(rand io.Reader, data []byte, mode algorithm.AEADMode) (nonce []byte, ciphertext []byte, err error)
type HMACPrivateKey ¶
type HMACPrivateKey struct {
PublicKey HMACPublicKey
HashSeed [32]byte
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
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 (*HMACPublicKey) Verify ¶
func (pub *HMACPublicKey) Verify(digest []byte, signature []byte) (bool, error)
Source Files ¶
- Version
- v1.1.0-alpha.2-proton
- Published
- Mar 14, 2024
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 1 hour ago –
Tools for package owners.