Structure CMBASECRYPT
CMBASECRYPT stores all needed parameters needed for every possible en- or decryption.
Syntax
typedef struct __CMBASECRYPT {
CMULONG mflCtrl;
CMULONG mulKeyExtType;
CMULONG mulEncryptionCode;
CMULONG mulEncryptionCodeOptions;
CMULONG mulFeatureCode;
CMULONG mulCrc;
} CMBASECRYPT;
|
Parameter
mflCtrl contains commands and flags influencing the en- or decryption. The parameter can use the following flags:
Used Key:
CM_CRYPT_HIDDENDATA specifies that the encryption key is stored in a Hidden Data of a Product Item. The Key Source must also be specified here.
Used Encryption Algorithm:
CM_CRYPT_AES specifies that the Advanced Encryption Standard (AES) algorithm is used for encryption. The key CM_CRYPT_HIDDENDATA. The encryption will be affected by other parameters such as Firm Code, Product Code, Encryption Code etc.
CM_CRYPT_ECIES specifies that the Elliptic Curve Integrated Encryption Scheme (ECIES) algorithm is used for encryption. This flag is only allowed for direct encryption (see Encryption Modes).
CM_CRYPT_ECIES_STD specifies that the Elliptic Curve Integrated Encryption Scheme (ECIES) algorithm is used for encryption. This option executes the standard ECIES. This flag only works with direct encryption. Encryption only works with simulated encryption (CmCryptSim). The length of the buffer must be at least 64 bytes (CM_PUBLIC_KEY_LEN) larger than the input sequence to add the public key after the encrypted sequence. Decryption only works with real decryption (CmCrypt). Though the returned length is 64 bytes smaller than the input sequence. This flag is only valid for direct encryption (see Encryption Modes)
CM_CRYPT_AES_DIRECT specifies that the direct Advanced Encryption Standard (AES) algorithm is used for encryption without hash calculation. The length of the buffer must be at least 16 bytes. The key to use is CM_CRYPT_HIDDENDATA. This algorithm is compatible to standard AES. Required CmContainer Firmware version: 1.10.
CRC calculation:
The algorithm CRC-32 is used to calculate the CRC checksum of the data.
CM_CRYPT_CHKCRC specifies that the CRC value stored in mulCrc should be checked using the CRC of the current operation.
CM_CRYPT_CALCCRC specifies that the CRC of the current operation should be calculated and stored in mulCrc.
mulKeyExtType specifies the key source, if the encryption is done with a Hidden Data.
mulEncryptionCode contains the Encryption Code set by the user.
mulEncryptionCodeOptions contains one or more of the following flags:
CM_CRYPT_RES1MASK reserved for future use.
CM_CRYPT_UCMASK specifies all flags for the Unit Counter options.
CM_CRYPT_UCCHECK specifies that the Unit Counter is checked and reduced, if available as Product Item Option.
CM_CRYPT_UCIGNORE specifies that the Unit Counter is neither checked nor reduced, independent of its availability as Product Item Option.
CM_CRYPT_UCREQUIRED specifies that a Unit Counter is checked and reduced and must be available as Product Item Option.
CM_CRYPT_ATMASK specifies all flags for the Activation Time.
CM_CRYPT_ATCHECK specifies that the Activation Time is checked, if available as Product Item Option.
CM_CRYPT_ATIGNORE specifies that the Activation Time is not checked, independent of its availability as Product Item Option.
CM_CRYPT_ATREQUIRED specifies that a Activation Time is checked and must be available as Product Item Option.
CM_CRYPT_ETMASK specifies all flags for the Expiration Time options.
CM_CRYPT_ETCHECK specifies that Expiration Time or Usage Period are checked, if available as Product Item Option.
CM_CRYPT_ETIGNORE specifies that Expiration Time and Usage Period are not checked, independent of its availability as Product Item Option.
CM_CRYPT_ETREQUIRED specifies that Expiration Time or Usage Period are checked and one of them must be available as Product Item Option.
CM_CRYPT_CERTTIME specifies that the Certified Box Clock (CBC) has to be updated by a Certified Time Stamp (CTS) since the CmDongle has received power. This option is only evaluated, if an Expiration Time Product Item Option is available.
CM_CRYPT_FACDECREMENT specifies that the Access Counter is reduced by 1.
CM_CRYPT_TOPLAINONLY specifies that the CmContainer can execute only the decryption but not the encryption variant. This flag can only be used in combination with the CmCrypt flag CM_CRYPT_DIRECT_DEC. The corresponding encryption has to be done by using CmCryptSim.
CM_CRYPT_RES2MASK reserved for future use.
CM_CRYPT_SAMASK specifies all flags for network access. These bits affect the encryption.

|
Please make sure that these flags correspond to the access modes flags you have set the in CmAccess2.
|
CM_CRYPT_SAEXCLUSIVE specifies that the current access is done using Exclusive Mode.
CM_CRYPT_SAUNLIMITED specifies that the current access is done using No User Limit.
CM_CRYPT_SAUSERLIMIT specifies that the current access is done using User Limit.
CM_CRYPT_SASTATIONSHARE specifies that the current access is done using Stationshare Mode.
CM_CRYPT_RES3MASK reserved for future use.
CM_CRYPT_UCDELTAMASK contains the mask to specify the delta value to reduce the Unit Counter value during encryption. The value is limited to the range of 0 to 9999, values between 10000 and 16383 are reserved for future use.
mulFeatureCode specifies the Feature Code mapping for the existing Feature Map. The operation fails, if the Feature Code contains bits which do not exist in the Feature Map.
mulCrc contains the CRC value of the current operation. It depends on the CM_CRYPT_CALCCRC or CM_CRYPT_CHKCRC flags, if this value is set or checked.
|