GCM
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{"}"}
Param | Description |
---|---|
nk | is the key length in bytes, 16, 24 or 32 |
key | the AES key as an array of 16 bytes |
niv | the number of bytes in the Initialisation Vector (IV) |
iv | the IV |
gcM.add_header(header, len)
Add header (material to be authenticated but not encrypted)
Kind: instance method of GCM
this: {"{"}GCM{"}"}
Param | Description |
---|---|
header | is the header material to be added |
len | the 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{"}"}
Param | Description |
---|---|
plain | is the plaintext material to be added |
len | the 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{"}"}
Param | Description |
---|---|
cipher | is the ciphertext to be added |
len | the number of bytes in the plaintext |