NXP NFC Reader Library
v4.040.05.011646
|
Software implementation of the Symmetric Cryptography interface. More...
![]() |
Data Structures | |
struct | phCryptoSym_Sw_DataParams_t |
Software parameter structure. More... | |
Macros | |
#define | PH_CRYPTOSYM_SW_ID 0x01 |
ID for Software crypto component. More... | |
#define | PH_CRYTOSYM_SW_FAST_RAM |
Enables 8051 data storage specifier. More... | |
#define | PH_CRYPTOSYM_SW_CONST_ROM |
ROM specifier - not set per default. | |
#define | PH_CRYPTOSYM_SW_MAX_BLOCK_SIZE PH_CRYPTOSYM_AES_BLOCK_SIZE |
Maximum Block Size of the currently supported ciphers. | |
Functions | |
phStatus_t | phCryptoSym_Sw_Init (phCryptoSym_Sw_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pKeyStoreDataParams) |
Initialise the CryptoSym component. More... | |
Compile Switches. | |
Compile switches used to find the optimum trade-off between performance, memory footprint and supported features. | |
#define | PH_CRYPTOSYM_SW_DES |
Enables DES support. More... | |
#define | PH_CRYPTOSYM_SW_AES |
Enables AES support. More... | |
#define | PH_CRYPTOSYM_SW_ONLINE_KEYSCHEDULING |
Enables online key scheduling. More... | |
#define | PH_CRYPTOSYM_SW_ONLINE_CMAC_SUBKEY_CALCULATION |
Enables online CMAC subkey calculation. More... | |
#define | PH_CRYPTOSYM_SW_ROM_OPTIMIZATION |
Enables ROM optimizations in the AES algorithm. More... | |
Software implementation of the Symmetric Cryptography interface.
This implementation was designed to optimize the footprint of crypto libraries used in embedded systems. The following standards are implemented:
Hints for compiling the library:
Architecture of the phCryptoSym_Sw Component:
#define PH_CRYPTOSYM_SW_ID 0x01 |
ID for Software crypto component.
#define PH_CRYPTOSYM_SW_DES |
Enables DES support.
Defines that the DES algorithm is supported. The defines for general DES capabilities like block sizes etc. are not affected as they do not add to the memory footprint.
#define PH_CRYPTOSYM_SW_AES |
Enables AES support.
Defines that the AES algorithm is supported. The defines for general AES capabilities like block sizes etc. are not affected as they do not add to the memory footprint.
#define PH_CRYPTOSYM_SW_ONLINE_KEYSCHEDULING |
Enables online key scheduling.
This define enables for both AES and DES the online key scheduling. This means, that the round keys are not pre-calculated at key loading, but they are always calculated when a new block is going to be encrypted or decrypted.
The following advantages come out of enabling online key scheduling:
The following disadvantages come out of enabling online key scheduling:
On 8051 platforms in combination with the PH_CRYPTOSYM_SW_USE_8051_DATA_STORAGE enabling online key scheduling even gives better results on execution time if only 1 or 2 blocks are encryted with a given key. In case of keys are used longer (which is most likely the standard case), it is faster to disable that feature. Also note, that e.g. for a MIFARE Plus (R) instance of the library, two crypto instances are required, and as a consequence online key scheduling can save 704(DES enabled)/(DES disabled)448 bytes of RAM.
#define PH_CRYPTOSYM_SW_ONLINE_CMAC_SUBKEY_CALCULATION |
Enables online CMAC subkey calculation.
This define enables for both AES and DES the online CMAC subkey calculation. This means, that the CMAC subkeys are not stored in the context of the individual instance of the crypto lib, but they are newly calculated for each MAC.
The following advantages come out of enabling online CMAC subkey calculation:
The following disadvantages come out of online CMAC subkey calculation:
#define PH_CRYPTOSYM_SW_ROM_OPTIMIZATION |
Enables ROM optimizations in the AES algorithm.
This define removes some of the lookup tables in the AES implementation to save ROM space.
The following advantages come out of enabling ROM optimizations:
The following disadvantages come out of enabling ROM optimizations:
#define PH_CRYTOSYM_SW_FAST_RAM |
Enables 8051 data storage specifier.
This define allows to specify any value for PH_CRYTOSYM_SW_FAST_RAM. It takes care, that the buffers are recopied correctly, and that most of the time consuming calculations are done on this fast mempory. In case of PH_CRYPTOSYM_SW_ONLINE_KEYSCHEDULING is set, even the key scheduling can be performed on this fast memory.Fast RAM specifier - not set per default
phStatus_t phCryptoSym_Sw_Init | ( | phCryptoSym_Sw_DataParams_t * | pDataParams, |
uint16_t | wSizeOfDataParams, | ||
void * | pKeyStoreDataParams | ||
) |
Initialise the CryptoSym component.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and underlaying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wSizeOfDataParams | Specifies the size of the data parameter structure. |
[in] | pKeyStoreDataParams | Pointer to a key store structure (can be null). |