Description
Depending on the decryption parameter, encrypts or decrypts the data buffer using the AES128 cryptographic algorithm associated with the Feature. Checks the license terms of the feature.
If the license is limited by the number of launches, this function decreases the value of the launch counter for the license by the number specified via the n parameter.
Encryption flags can be applied in addition to the selected encryption mode. If the GRD_NO_COUNTER_DECREMENT flag is set, the function uses a different encryption key and the launch counter is not decreased.
The GRD_SOFTWARE_ACCELERATION flag allows you to speed up the function significantly, since the data will be decrypted by a software algorithm which key depends on the feature.
The encrypting results of the same data with and without the GRD_NO_COUNTER_DECREMENT flag will be different
The GRD_EM_CFB and GRD_EM_OFB encryption modes are only available when the GRD_SOFTWARE_ACCELERATION flag is used simultaneously.
Syntax
int GRD_API GrdFeatureCryptAndCount(GrdHandle handle,
grd_uint32 dataSize,
void* data,
grd_uint32 mode,
void* context,
grd_uint32 contextSize,
int decryption,
grd_uint32 n,
grd_uint32 flags);
Parameters
handle | Session handle |
dataSize | The size (in bytes) of the buffer for open message |
data | Pointer to a buffer with the open message. |
mode |
Encryption flags:
|
context | Pointer to GrdAesContext context required for AES encryption operations. May be NULL |
contextSize | The size of the context. Must be equal to sizeof(GrdAesContext). Zero value is allowed. |
decryption | A type of transformation where a zero value is passed to the parameter to encrypt data, and any non-zero value is passed to decrypt it. |
n | The number of feature launches subtracted when calling the function. The parameter takes an integer, non-zero value. |
flags [reserved] | NULL |