![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header file for the Nanocrypto GCM API. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | GCM_cipher_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *adata, ubyte4 alen, ubyte *data, ubyte4 dlen, ubyte4 verifyLen, sbyte4 encrypt) |
AES-GCM encrypt or decrypt a data buffer. More... | |
MOC_EXTERN MSTATUS | GCM_cipher_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *adata, ubyte4 alen, ubyte *data, ubyte4 dlen, ubyte4 verifyLen, sbyte4 encrypt) |
AES-GCM encrypt or decrypt a data buffer. More... | |
MOC_EXTERN MSTATUS | GCM_cipher_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *adata, ubyte4 alen, ubyte *data, ubyte4 dlen, ubyte4 verifyLen, sbyte4 encrypt) |
AES-GCM encrypt or decrypt a data buffer. More... | |
MOC_EXTERN MSTATUS | GCM_clone_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
Clone a AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_clone_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
Clone a AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_clone_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
Clone a AES-GCM context. More... | |
MOC_EXTERN BulkCtx | GCM_createCtx_256b (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *key, sbyte4 keylen, sbyte4 encrypt) |
Create and return a context data structure for AES-GCM operations. More... | |
MOC_EXTERN BulkCtx | GCM_createCtx_4k (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *key, sbyte4 keylen, sbyte4 encrypt) |
Create and return a context data structure for AES-GCM operations. More... | |
MOC_EXTERN BulkCtx | GCM_createCtx_64k (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *key, sbyte4 keylen, sbyte4 encrypt) |
Create and return a context data structure for AES-GCM operations. More... | |
MOC_EXTERN MSTATUS | GCM_deleteCtx_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx) |
Delete an AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_deleteCtx_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx) |
Delete an AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_deleteCtx_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx) |
Delete an AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_final_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte tag[]) |
Write authentication tag after message encryption. More... | |
MOC_EXTERN MSTATUS | GCM_final_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte tag[]) |
Write authentication tag after message encryption. More... | |
MOC_EXTERN MSTATUS | GCM_final_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte tag[]) |
Write authentication tag after message encryption. More... | |
MOC_EXTERN MSTATUS | GCM_final_ex_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pTag, ubyte4 tagLen) |
Finalizes an AES-GCM context and verifies or outputs the tag. More... | |
MOC_EXTERN MSTATUS | GCM_final_ex_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pTag, ubyte4 tagLen) |
Finalizes an AES-GCM context and verifies or outputs the tag. More... | |
MOC_EXTERN MSTATUS | GCM_final_ex_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pTag, ubyte4 tagLen) |
Finalizes an AES-GCM context and verifies or outputs the tag. More... | |
MOC_EXTERN MSTATUS | GCM_init_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *adata, ubyte4 alen) |
Initialize nonce and authentication data for AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_init_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *adata, ubyte4 alen) |
Initialize nonce and authentication data for AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_init_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *nonce, ubyte4 nlen, ubyte *adata, ubyte4 alen) |
Initialize nonce and authentication data for AES-GCM context. More... | |
MOC_EXTERN MSTATUS | GCM_update_aad_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pAadData, ubyte4 aadDataLen) |
Updates an AES-GCM context with additional authenticated data. More... | |
MOC_EXTERN MSTATUS | GCM_update_aad_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pAadData, ubyte4 aadDataLen) |
Updates an AES-GCM context with additional authenticated data. More... | |
MOC_EXTERN MSTATUS | GCM_update_aad_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pAadData, ubyte4 aadDataLen) |
Updates an AES-GCM context with additional authenticated data. More... | |
MOC_EXTERN MSTATUS | GCM_update_data_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, ubyte4 dataLen) |
Finalizes an AES-GCM context and verifies or outputs the tag. More... | |
MOC_EXTERN MSTATUS | GCM_update_data_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, ubyte4 dataLen) |
Finalizes an AES-GCM context and verifies or outputs the tag. More... | |
MOC_EXTERN MSTATUS | GCM_update_data_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, ubyte4 dataLen) |
Updates an AES-GCM context with data to be encrypted or decrypted. More... | |
MOC_EXTERN MSTATUS | GCM_update_decrypt_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *ct, ubyte4 ctlen) |
Decrypt data buffer and perform authentication. More... | |
MOC_EXTERN MSTATUS | GCM_update_decrypt_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *ct, ubyte4 ctlen) |
Decrypt data buffer and perform authentication. More... | |
MOC_EXTERN MSTATUS | GCM_update_decrypt_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *ct, ubyte4 ctlen) |
Decrypt data buffer and perform authentication. More... | |
MOC_EXTERN MSTATUS | GCM_update_encrypt_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, ubyte4 dlen) |
Encrypt a data buffer and perform authentication. More... | |
MOC_EXTERN MSTATUS | GCM_update_encrypt_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, ubyte4 dlen) |
Encrypt a data buffer and perform authentication. More... | |
MOC_EXTERN MSTATUS | GCM_update_encrypt_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, ubyte4 dlen) |
Encrypt a data buffer and perform authentication. More... | |
MOC_EXTERN MSTATUS | GCM_update_nonce_256b (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pNonce, ubyte4 nonceLen) |
Sets the nonce in a previously created AES-GCM Context. More... | |
MOC_EXTERN MSTATUS | GCM_update_nonce_4k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pNonce, ubyte4 nonceLen) |
Sets the nonce in a previously created AES-GCM Context. More... | |
MOC_EXTERN MSTATUS | GCM_update_nonce_64k (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pNonce, ubyte4 nonceLen) |
Sets the nonce in a previously created AES-GCM Context. More... | |
Header file for the Nanocrypto GCM API.
MOC_EXTERN MSTATUS GCM_cipher_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | nonce, | ||
ubyte4 | nlen, | ||
ubyte * | adata, | ||
ubyte4 | alen, | ||
ubyte * | data, | ||
ubyte4 | dlen, | ||
ubyte4 | verifyLen, | ||
sbyte4 | encrypt | ||
) |
This function AES-GCM encrypts or AES-GCM decrypts a data buffer. Before calling this function, your application must call the GCM_createCtx_256b() function to dynamically create a valid AES-GCM context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_256b(). |
nonce | Nonce. |
nlen | Length of (nonce ) in octets. |
adata | Additional authenticated data. |
alen | Length of additional authenticated data (aData ) in octets. |
data | Data to encrypt and protect. |
dlen | Length of data to encrypt and protect (data ). |
verifyLen | Length of the authentication tag. |
encrypt | TRUE if context for encryption; otherwise FALSE (context is for decryption). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_cipher_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | nonce, | ||
ubyte4 | nlen, | ||
ubyte * | adata, | ||
ubyte4 | alen, | ||
ubyte * | data, | ||
ubyte4 | dlen, | ||
ubyte4 | verifyLen, | ||
sbyte4 | encrypt | ||
) |
This function AES-GCM encrypts or AES-GCM decrypts a data buffer. Before calling this function, your application must call the GCM_createCtx_4k() function to dynamically create a valid AES-GCM context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_4k(). |
nonce | Nonce. |
nlen | Length of (nonce ) in octets. |
adata | Additional authenticated data. |
alen | Length of additional authenticated data (aData ) in octets. |
data | Data to encrypt and protect. |
dlen | Length of data to encrypt and protect (data ). |
verifyLen | Length of the authentication tag. |
encrypt | TRUE if context for encryption; otherwise FALSE (context is for decryption). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_cipher_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | nonce, | ||
ubyte4 | nlen, | ||
ubyte * | adata, | ||
ubyte4 | alen, | ||
ubyte * | data, | ||
ubyte4 | dlen, | ||
ubyte4 | verifyLen, | ||
sbyte4 | encrypt | ||
) |
This function AES-GCM encrypts or AES-GCM decrypts a data buffer. Before calling this function, your application must call the GCM_createCtx_64k() function to dynamically create a valid AES-GCM context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_64k(). |
nonce | Nonce. |
nlen | Length of (nonce ) in octets. |
adata | Additional authenticated data. |
alen | Length of additional authenticated data (aData ) in octets. |
data | Data to encrypt and protect. |
dlen | Length of data to encrypt and protect (data ). |
verifyLen | Length of the authentication tag. |
encrypt | TRUE if context for encryption; otherwise FALSE (context is for decryption). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_clone_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
BulkCtx * | ppNewCtx | ||
) |
pCtx | Pointer to an instantiated BulkCtx. |
ppNewCtx | Double pointer to the BulkCtx to be created and populated with the key data from the source key. |
OK
(0) if successful, otherwise a negative number error code from merrors.h. MOC_EXTERN MSTATUS GCM_clone_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
BulkCtx * | ppNewCtx | ||
) |
pCtx | Pointer to an instantiated BulkCtx. |
ppNewCtx | Double pointer to the BulkCtx to be created and populated with the key data from the source key. |
OK
(0) if successful, otherwise a negative number error code from merrors.h. MOC_EXTERN MSTATUS GCM_clone_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
BulkCtx * | ppNewCtx | ||
) |
pCtx | Pointer to an instantiated BulkCtx. |
ppNewCtx | Double pointer to the BulkCtx to be created and populated with the key data from the source key. |
OK
(0) if successful, otherwise a negative number error code from merrors.h. MOC_EXTERN BulkCtx GCM_createCtx_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) ubyte * | key, |
sbyte4 | keylen, | ||
sbyte4 | encrypt | ||
) |
This function creates and returns a context data structure for AES-GCM operations, and prepares the key schedule (intermediate key material). This is the first function your application calls when performing AES operations (encryption or decryption). Your application uses the returned structure in subsequent DoAES() functions.
The AES-GCM context data structure holds information such as key length, key schedule, and mode of operation. To avoid memory leaks, your application code must call GCM_deleteCtx_256b() after completing AES-GCM related operations (because the AES-GCM context is dynamically allocated by this function during context creation).
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
key | Key material. |
keylen | Length of key material (key ). |
encrypt | TRUE if context for encryption; otherwise FALSE (context is for decryption). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN BulkCtx GCM_createCtx_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) ubyte * | key, |
sbyte4 | keylen, | ||
sbyte4 | encrypt | ||
) |
This function creates and returns a context data structure for AES-GCM operations, and prepares the key schedule (intermediate key material). This is the first function your application calls when performing AES operations (encryption or decryption). Your application uses the returned structure in subsequent DoAES() functions.
The AES-GCM context data structure holds information such as key length, key schedule, and mode of operation. To avoid memory leaks, your application code must call GCM_deleteCtx_4k() after completing AES-GCM related operations (because the AES-GCM context is dynamically allocated by this function during context creation).
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
key | Key material. |
keylen | Length of key material (key ). |
encrypt | TRUE if context for encryption; otherwise FALSE (context for decryption). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN BulkCtx GCM_createCtx_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) ubyte * | key, |
sbyte4 | keylen, | ||
sbyte4 | encrypt | ||
) |
This function creates and returns a context data structure for AES-GCM operations, and prepares the key schedule (intermediate key material). This is the first function your application calls when performing AES operations (encryption or decryption). Your application uses the returned structure in subsequent DoAES() functions.
The AES-GCM context data structure holds information such as key length, key schedule, and mode of operation. To avoid memory leaks, your application code must call GCM_deleteCtx_64k() after completing AES-GCM related operations (because the AES-GCM context is dynamically allocated by this function during context creation).
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
key | Key material. |
keylen | Length of key material (key ). |
encrypt | TRUE if context for encryption; otherwise FALSE (context is for decryption). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_deleteCtx_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx * | ctx | ) |
This function deletes an AES-GCM context previously created by GCM_createCtx_256b(). To avoid memory leaks, your application must call this function after completing AES-related operations for a given context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
ctx | Pointer to AES-GCM context to free. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_deleteCtx_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx * | ctx | ) |
This function deletes an AES-GCM context previously created by GCM_createCtx_4k(). To avoid memory leaks, your application must call this function after completing AES-related operations for a given context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
ctx | Pointer to AES-GCM context to free. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_deleteCtx_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx * | ctx | ) |
This function deletes an AES-GCM context previously created by GCM_createCtx_64k(). To avoid memory leaks, your application must call this function after completing AES-related operations for a given context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
ctx | Pointer to AES-GCM context to free. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_final_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte | tag[] | ||
) |
This function writes the authentication tag upon completion of encrypting a message.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_256b(). |
tag | Pointer to write authentication tag of AES_BLOCK_SIZE octets. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_final_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte | tag[] | ||
) |
This function writes the authentication tag upon completion of encrypting a message.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_4k(). |
tag | Pointer to write authentication tag of AES_BLOCK_SIZE octets. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_final_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte | tag[] | ||
) |
This function writes the authentication tag upon completion of encrypting a message.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_64k(). |
tag | Pointer to write authentication tag of AES_BLOCK_SIZE octets. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_final_ex_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pTag, | ||
ubyte4 | tagLen | ||
) |
Finalizes an AES-GCM context and verifies or outputs the tag. If the context was created for encryption the tag will be output. If the context was created for decryption the tag will be verified and a negative error code will be returned for an invalid tag.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated and updated context. |
pTag | For encrypt the resulting tag will be placed in this buffer. For decrypt this buffer should contain the input tag. |
tagLen | For encrypt this is the length of the tag requested in bytes (at most 16 bytes). For decrypt this is the length of the input tag in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_final_ex_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pTag, | ||
ubyte4 | tagLen | ||
) |
Finalizes an AES-GCM context and verifies or outputs the tag. If the context was created for encryption the tag will be output. If the context was created for decryption the tag will be verified and a negative error code will be returned for an invalid tag.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated and updated context. |
pTag | For encrypt the resulting tag will be placed in this buffer. For decrypt this buffer should contain the input tag. |
tagLen | For encrypt this is the length of the tag requested in bytes (at most 16 bytes). For decrypt this is the length of the input tag in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_final_ex_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pTag, | ||
ubyte4 | tagLen | ||
) |
Finalizes an AES-GCM context and verifies or outputs the tag. If the context was created for encryption the tag will be output. If the context was created for decryption the tag will be verified and a negative error code will be returned for an invalid tag.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated and updated context. |
pTag | For encrypt the resulting tag will be placed in this buffer. For decrypt this buffer should contain the input tag. |
tagLen | For encrypt this is the length of the tag requested in bytes (at most 16 bytes). For decrypt this is the length of the input tag in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_init_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | nonce, | ||
ubyte4 | nlen, | ||
ubyte * | adata, | ||
ubyte4 | alen | ||
) |
This function initializes nonce and authentication data for an AES-GCM context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_256b(). |
nonce | Nonce. |
nlen | Length of (nonce ) in octets. |
adata | Additional authenticated data. |
alen | Length of additional authenticated data (aData ) in octets. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_init_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | nonce, | ||
ubyte4 | nlen, | ||
ubyte * | adata, | ||
ubyte4 | alen | ||
) |
This function initializes nonce and authentication data for an AES-GCM context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_4k(). |
nonce | Nonce. |
nlen | Length of (nonce ) in octets. |
adata | Additional authenticated data. |
alen | Length of additional authenticated data (aData ) in octets. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_init_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | nonce, | ||
ubyte4 | nlen, | ||
ubyte * | adata, | ||
ubyte4 | alen | ||
) |
This function initializes nonce and authentication data for an AES-GCM context.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_64k(). |
nonce | Nonce. |
nlen | Length of (nonce ) in octets. |
adata | Additional authenticated data. |
alen | Length of additional authenticated data (aData ) in octets. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_aad_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pAadData, | ||
ubyte4 | aadDataLen | ||
) |
Updates an AES-GCM context with additional authenticated data. This method may be called as many times as necessary.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pAadData | Buffer holding the additional authenticated data. |
aadDataLen | The length of the aad in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_aad_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pAadData, | ||
ubyte4 | aadDataLen | ||
) |
Updates an AES-GCM context with additional authenticated data. This method may be called as many times as necessary.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pAadData | Buffer holding the additional authenticated data. |
aadDataLen | The length of the aad in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_aad_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pAadData, | ||
ubyte4 | aadDataLen | ||
) |
Updates an AES-GCM context with additional authenticated data. This method may be called as many times as necessary.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pAadData | Buffer holding the additional authenticated data. |
aadDataLen | The length of the aad in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_data_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pData, | ||
ubyte4 | dataLen | ||
) |
Finalizes an AES-GCM context and verifies or outputs the tag. If the context was created for encryption the tag will be output. If the context was created for decryption the tag will be verified and a negative error code will be returned for an invalid tag.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated and updated context. |
pTag | For encrypt the resulting tag will be placed in this buffer. For decrypt this buffer should contain the input tag. |
tagLen | For encrypt this is the length of the tag requested in bytes (at most 16 bytes). For decrypt this is the length of the input tag in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_data_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pData, | ||
ubyte4 | dataLen | ||
) |
Finalizes an AES-GCM context and verifies or outputs the tag. If the context was created for encryption the tag will be output. If the context was created for decryption the tag will be verified and a negative error code will be returned for an invalid tag.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated and updated context. |
pTag | For encrypt the resulting tag will be placed in this buffer. For decrypt this buffer should contain the input tag. |
tagLen | For encrypt this is the length of the tag requested in bytes (at most 16 bytes). For decrypt this is the length of the input tag in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_data_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pData, | ||
ubyte4 | dataLen | ||
) |
Updates an AES-GCM context with data to be encrypted or decrypted. Which direction depends on the encrypt
flag passed into the context creation GCM_createCtx_64k
method. The GCM_update_data_64k
method may be called as many times as necessary.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pData | Buffer holding the data to be encrypted or decrypted. It will be processed in place, ie this buffer will also hold the resulting ciphertext or plaintext. |
dataLen | The length of the data in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_decrypt_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | ct, | ||
ubyte4 | ctlen | ||
) |
This function AES-GCM decrypts a data buffer and authenticates. Before calling this function, your application must call the GCM_createCtx_256b() function to dynamically create a valid AES context, and optionally call GCM_init_256b() to set a nonce or additional authentication data.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_256b(). |
ct | Cipher text to decrypt and authenticate. |
ctlen | Length of cipher text to decrypt and authenticate (data ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_decrypt_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | ct, | ||
ubyte4 | ctlen | ||
) |
This function AES-GCM decrypts a data buffer and authenticates. Before calling this function, your application must call the GCM_createCtx_4k() function to dynamically create a valid AES context, and optionally call GCM_init_4k() to set a nonce or additional authentication data.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_4k(). |
ct | Cipher text to decrypt and authenticate. |
ctlen | Length of cipher text to decrypt and authenticate (data ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_decrypt_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | ct, | ||
ubyte4 | ctlen | ||
) |
This function AES-GCM decrypts a data buffer and authenticates. Before calling this function, your application must call the GCM_createCtx_64k() function to dynamically create a valid AES context, and optionally call GCM_init_64k() to set a nonce or additional authentication data.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_64k(). |
ct | Cipher text to decrypt and authenticate. |
ctlen | Length of cipher text to decrypt and authenticate (data ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_encrypt_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | data, | ||
ubyte4 | dlen | ||
) |
This function AES-GCM encrypts a data buffer and authenticates. Before calling this function, your application must call the GCM_createCtx_256b() function to dynamically create a valid AES context, and optionally call GCM_init_256b() to set a nonce or additional authentication data.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_256B__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_256b(). |
data | Data to encrypt and protect. |
dlen | Length of data to encrypt and protect (data ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_encrypt_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | data, | ||
ubyte4 | dlen | ||
) |
This function AES-GCM encrypts a data buffer and authenticates. Before calling this function, your application must call the GCM_createCtx_4k() function to dynamically create a valid AES context, and optionally call GCM_init_4k() to set a nonce or additional authentication data.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_4K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_4k(). |
data | Data to encrypt and protect. |
dlen | Length of data to encrypt and protect (data ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_encrypt_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | ctx, |
ubyte * | data, | ||
ubyte4 | dlen | ||
) |
This function AES-GCM encrypts a data buffer and authenticates. Before calling this function, your application must call the GCM_createCtx_64k() function to dynamically create a valid AES context, and optionally call GCM_init_64k() to set a nonce or additional authentication data.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
ctx | AES-GCM context, previously created by GCM_createCtx_64k(). |
data | Data to encrypt and protect. |
dlen | Length of data to encrypt and protect (data ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_nonce_256b | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pNonce, | ||
ubyte4 | nonceLen | ||
) |
Sets the nonce in a previously created AES-GCM Context.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pNonce | Buffer holding the input nonce value. |
nonceLen | The length of the nonce in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_nonce_4k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pNonce, | ||
ubyte4 | nonceLen | ||
) |
Sets the nonce in a previously created AES-GCM Context.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pNonce | Buffer holding the input nonce value. |
nonceLen | The length of the nonce in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS GCM_update_nonce_64k | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pNonce, | ||
ubyte4 | nonceLen | ||
) |
Sets the nonce in a previously created AES-GCM Context.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_GCM_64K__
__ENABLE_MOCANA_GCM__
pCtx | Pointer to a previously allocated context. |
pNonce | Buffer holding the input nonce value. |
nonceLen | The length of the nonce in bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.