Package gcm

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


const NonceSize = 12

NonceSize specifies the nonce size in bytes.


This section is empty.


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.


This section is empty.