Click or drag to resize

GcmInitKey Method

Initializes the context with the key ready for repeated operations of Gcm.NextEncrypt, Gcm.NextDecrypt, or Gcm.NextGmac.

Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntax
public int InitKey(
	byte[] key
)

Parameters

key  Byte
Key: must be exactly 16, 24 or 32 bytes long.

Return Value

Int32
Zero (0) if successful; otherwise it returns a nonzero error code
Remarks
Once a key has been set up, Gcm.NextEncrypt, Gcm.NextDecrypt and Gcm.NextGmac can be used independently.
Example
C#
Gcm o = Instance();
o.InitKey(key);
byte[] tag = new byte[16];
byte[] ct = o.NextEncrypt(tag, pt, iv, aad);
//...
o.Dispose();
See Also