Software implementation of the DES algorithm. More...

Functions | |
| void | phCryptoSym_Sw_Des_Permutate_IP (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pStateIn, uint8_t PH_CRYTOSYM_SW_FAST_RAM *pStateOut) |
| Compute a permutation as defined in table IP in section Enciphering of FIPS46.3. More... | |
| void | phCryptoSym_Sw_Des_Permutate_IP_Inv (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pStateIn, uint8_t PH_CRYTOSYM_SW_FAST_RAM *pStateOut) |
| Compute a permutation as defined in table IP-1 (inverse IP) in section Enciphering of FIPS46.3. More... | |
| void | phCryptoSym_Sw_Des_PC1_Permutation (const uint8_t *pKeyIn, uint8_t PH_CRYTOSYM_SW_FAST_RAM *pKeyOut) |
| Compute a permutation as defined in table PC1 of Appendix 1 of FIPS46.3. More... | |
| void | phCryptoSym_Sw_Des_PC2_Permutation (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pKeyIn, uint8_t *pKeyOut) |
| Compute a permutation as defined in table PC2 of Appendix 1 of FIPS46.3. More... | |
| void | phCryptoSym_Sw_Des_RotateLeft28 (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pArray, uint8_t bNumPos) |
| Rotates (bitwise) a four byte array to the left by bNumPos positions. More... | |
| void | phCryptoSym_Sw_Des_RotateRight28 (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pArray, uint8_t bNumPos) |
| Rotates (bitwise) a four byte array to the right by bNumPos positions. More... | |
| void | phCryptoSym_Sw_Des_F (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pR, uint8_t *pRoundKey) |
| Performes the cipher function F as described in chapter "The Cipher Function f" of FIPS46.3. More... | |
| void | phCryptoSym_Sw_Des_ComputeRound (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pState, uint8_t *pRoundKey) |
| Performes a round as described in Figure 1. More... | |
| void | phCryptoSym_Sw_Des_Expand (uint8_t PH_CRYTOSYM_SW_FAST_RAM *pR, uint8_t PH_CRYTOSYM_SW_FAST_RAM *pRexp) |
| Expands the 32 bit input to generate a 48 bit output according to E-Selection Table. More... | |
| void | phCryptoSym_Sw_Des_Swap (uint8_t PH_CRYTOSYM_SW_FAST_RAM *bState) |
| Take an array of length 8, put bState[0:3] to bState[4:7] and vice versa. More... | |
Software implementation of the DES algorithm.
| void phCryptoSym_Sw_Des_Permutate_IP | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pStateIn, |
| uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pStateOut | ||
| ) |
Compute a permutation as defined in table IP in section Enciphering of FIPS46.3.
The implementation is chosen such that the trade off between ROM usage and execution performance is optimum for (small) uC architectures. For implementation details refer to the detailed documentation inside of the function body.
| [in] | pStateIn | [In] State pointer containing the initial state. |
| [out] | pStateOut | [Out] State pointer containing the permutated state. |
| void phCryptoSym_Sw_Des_Permutate_IP_Inv | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pStateIn, |
| uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pStateOut | ||
| ) |
Compute a permutation as defined in table IP-1 (inverse IP) in section Enciphering of FIPS46.3.
The implementation is chosen such that the trade off between ROM usage and execution performance is optimum for (small) uC architectures. For implementation details refer to the detailed documentation inside of the function body.
| [in] | pStateIn | [In] State pointer containing the computed state. |
| [out] | pStateOut | [Out] State pointer containing the final state. |
| void phCryptoSym_Sw_Des_PC1_Permutation | ( | const uint8_t * | pKeyIn, |
| uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pKeyOut | ||
| ) |
Compute a permutation as defined in table PC1 of Appendix 1 of FIPS46.3.
The implementation is chosen such that the trade off between ROM usage and execution performance is optimum for (small) uC architectures. For implementation details refer to the detailed documentation inside of the function body.
| [in] | pKeyIn | [In] key pointer containing the original key. |
| [out] | pKeyOut | [Out] key pointer containing the permutated key. |
| void phCryptoSym_Sw_Des_PC2_Permutation | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pKeyIn, |
| uint8_t * | pKeyOut | ||
| ) |
Compute a permutation as defined in table PC2 of Appendix 1 of FIPS46.3.
The implementation is chosen such that the trade off between ROM usage and execution performance is optimum for (small) uC architectures. For implementation details refer to the detailed documentation inside of the function body.
| [in] | pKeyIn | [In] round key pointer containing the input. |
| [out] | pKeyOut | [Out] round key pointer containing the output. |
| void phCryptoSym_Sw_Des_RotateLeft28 | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pArray, |
| uint8_t | bNumPos | ||
| ) |
Rotates (bitwise) a four byte array to the left by bNumPos positions.
Note: Only the first 28 bits are rotated through, in other words, bits 4-7 of byte 3 are untouched
| [in,out] | pArray | [InOut] 4 Byte array to be rotated. |
| [in] | bNumPos | [In] Amount of positions (bits) to rotate through. |
| void phCryptoSym_Sw_Des_RotateRight28 | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pArray, |
| uint8_t | bNumPos | ||
| ) |
Rotates (bitwise) a four byte array to the right by bNumPos positions.
Note: Only the first 28 bits are rotated through, in other words, bits 4-7 of byte 3 are untouched
| [in,out] | pArray | [InOut] 4 Byte array to be rotated. |
| [in] | bNumPos | [In] Amount of positions (bits) to rotate through. |
| void phCryptoSym_Sw_Des_F | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pR, |
| uint8_t * | pRoundKey | ||
| ) |
Performes the cipher function F as described in chapter "The Cipher Function f" of FIPS46.3.
The 32 bit input pR is expanded, XORed with the key, looked up using the SBOX and finally permutated according to the standard of the DES algorithm
| [in,out] | pR | [InOut] 4 Byte array to be ciphered. |
| [in] | pRoundKey | [In] 8 bytes (containing 48 bits) round key used for XORing. |
| void phCryptoSym_Sw_Des_ComputeRound | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pState, |
| uint8_t * | pRoundKey | ||
| ) |
Performes a round as described in Figure 1.
Enciphering computation. of FIPS46.3. The 8 byte input is first split into two parts, namely L and R. On R, the function F is executed, and then finally the result is xored to L.
| [in,out] | pState | [InOut] 8 bytes state to compute the round on. |
| [in] | pRoundKey | [In] 8 bytes (containing 48 bits) round key used for XORing. |
| void phCryptoSym_Sw_Des_Expand | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pR, |
| uint8_t PH_CRYTOSYM_SW_FAST_RAM * | pRexp | ||
| ) |
Expands the 32 bit input to generate a 48 bit output according to E-Selection Table.
of FIPS46.3. The 4 byte input is expanded to create a 8 byte output containing 6 bits of expanded data in the individual bytes.
| [in] | pR | [In] 4 Bytes of input Data. |
| [out] | pRexp | [Out] 8 bytes (containing 48 bits) of expanded data. |
| void phCryptoSym_Sw_Des_Swap | ( | uint8_t PH_CRYTOSYM_SW_FAST_RAM * | bState | ) |
Take an array of length 8, put bState[0:3] to bState[4:7] and vice versa.
| [in,out] | bState | [InOut] State to be swapped. |