MPCL

Package gcm

Package gcm implements the Galois/Counter Mode of Operation (GCM) for block ciphers.

Constants

const NonceSize = 12

NonceSize specifies the nonce size in bytes.

Variables

This section is empty.

Functions

func EncryptAES128
func EncryptAES128(key [16]byte, nonce [NonceSize]byte, plaintext, additionalData []byte) []byte

EncryptAES128 encrypts the plaintext in AES-GCM mode. The key specifies the AES encryption key and nonce is an unique initialization vector; the nonce must not be reused for the same encryption key. The additionalData specifies additional data that is authenticated but not encrypted. The input plaintext can be of any length i.e. it don't have to be padded to cipher block size.

Types

This section is empty.