GCM

Kind: global class
this: {GCM}

new GCM()

Creates an instance of GCM

gcM.init(nk, key, niv, iv)

Initialize GCM mode

Kind: instance method of GCM
this: {GCM}

ParamDescription
nkis the key length in bytes, 16, 24 or 32
keythe AES key as an array of 16 bytes
nivthe number of bytes in the Initialisation Vector (IV)
ivthe IV

gcM.add_header(header, len)

Add header (material to be authenticated but not encrypted)

Kind: instance method of GCM
this: {GCM}

ParamDescription
headeris the header material to be added
lenthe number of bytes in the header

gcM.add_plain(plain, len) ⇒

Add plaintext and extract ciphertext

Kind: instance method of GCM
Returns: cipher is the ciphertext generated
this: {GCM}

ParamDescription
plainis the plaintext material to be added
lenthe number of bytes in the plaintext

gcM.add_cipher(cipher, len) ⇒

Add Ciphertext - decrypts to plaintext

Kind: instance method of GCM
Returns: plain is the plaintext material generated
this: {GCM}

ParamDescription
cipheris the ciphertext to be added
lenthe number of bytes in the plaintext