aead

package
v1.3.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2019 License: Apache-2.0 Imports: 23 Imported by: 86

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AES128CTRHMACSHA256KeyTemplate added in v1.3.0

func AES128CTRHMACSHA256KeyTemplate() *tinkpb.KeyTemplate

AES128CTRHMACSHA256KeyTemplate is a KeyTemplate that generates an AES-CTR-HMAC-AEAD key with the following parameters:

  • AES key size: 16 bytes
  • AES CTR IV size: 16 bytes
  • HMAC key size: 32 bytes
  • HMAC tag size: 16 bytes
  • HMAC hash function: SHA256

func AES128GCMKeyTemplate added in v1.3.0

func AES128GCMKeyTemplate() *tinkpb.KeyTemplate

AES128GCMKeyTemplate is a KeyTemplate that generates an AES-GCM key with the following parameters:

  • Key size: 16 bytes

func AES256CTRHMACSHA256KeyTemplate added in v1.3.0

func AES256CTRHMACSHA256KeyTemplate() *tinkpb.KeyTemplate

AES256CTRHMACSHA256KeyTemplate is a KeyTemplate that generates an AES-CTR-HMAC-AEAD key with the following parameters:

  • AES key size: 32 bytes
  • AES CTR IV size: 16 bytes
  • HMAC key size: 32 bytes
  • HMAC tag size: 32 bytes
  • HMAC hash function: SHA256

func AES256GCMKeyTemplate added in v1.3.0

func AES256GCMKeyTemplate() *tinkpb.KeyTemplate

AES256GCMKeyTemplate is a KeyTemplate that generates an AES-GCM key with the following parameters:

  • Key size: 32 bytes

func ChaCha20Poly1305KeyTemplate added in v1.3.0

func ChaCha20Poly1305KeyTemplate() *tinkpb.KeyTemplate

ChaCha20Poly1305KeyTemplate is a KeyTemplate that generates a CHACHA20_POLY1305 key.

func KMSEnvelopeAEADKeyTemplate added in v1.3.0

func KMSEnvelopeAEADKeyTemplate(uri string, dekT *tinkpb.KeyTemplate) *tinkpb.KeyTemplate

KMSEnvelopeAEADKeyTemplate is a KeyTemplate that generates a KMSEnvelopeAEAD key for a given KEK in remote KMS

func New added in v1.3.0

func New(h *keyset.Handle) (tink.AEAD, error)

New returns an AEAD primitive from the given keyset handle.

func NewWithKeyManager added in v1.3.0

func NewWithKeyManager(h *keyset.Handle, km registry.KeyManager) (tink.AEAD, error)

NewWithKeyManager returns an AEAD primitive from the given keyset handle and custom key manager.

func XChaCha20Poly1305KeyTemplate added in v1.3.0

func XChaCha20Poly1305KeyTemplate() *tinkpb.KeyTemplate

XChaCha20Poly1305KeyTemplate is a KeyTemplate that generates a XCHACHA20_POLY1305 key.

Types

type KMSEnvelopeAEAD added in v1.3.0

type KMSEnvelopeAEAD struct {
	// contains filtered or unexported fields
}

KMSEnvelopeAEAD represents an instance of Envelope AEAD.

func NewKMSEnvelopeAEAD added in v1.3.0

func NewKMSEnvelopeAEAD(kt tinkpb.KeyTemplate, remote tink.AEAD) *KMSEnvelopeAEAD

NewKMSEnvelopeAEAD creates an new instance of KMSEnvelopeAEAD

func (*KMSEnvelopeAEAD) Decrypt added in v1.3.0

func (a *KMSEnvelopeAEAD) Decrypt(ct, aad []byte) ([]byte, error)

Decrypt implements the tink.AEAD interface for decryption.

func (*KMSEnvelopeAEAD) Encrypt added in v1.3.0

func (a *KMSEnvelopeAEAD) Encrypt(pt, aad []byte) ([]byte, error)

Encrypt implements the tink.AEAD interface for encryption.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL