SAM commands used for asymmetric RSA key management, signature handling and symmetric key updates based on PKI. More...

Modules | |
| Defines | |
| Definitions for SAM PKI RSA commands. | |
Functions | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_GenerateKeyPair (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bPKI_KeyNo, uint16_t wPKI_Set, uint8_t bPKI_KeyNoCEK, uint8_t bPKI_KeyVCEK, uint8_t bPKI_RefNoKUC, uint8_t bPKI_KeyNoAEK, uint8_t bPKI_KeyVAEK, uint16_t wPKI_NLen, uint16_t wPKI_eLen, uint8_t *pPKI_e) |
| Create a pair of a public and private RSA key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_ImportKey (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bPKI_KeyNo, uint16_t wPKI_Set, uint8_t bPKI_KeyNoCEK, uint8_t bPKI_KeyVCEK, uint8_t bPKI_RefNoKUC, uint8_t bPKI_KeyNoAEK, uint8_t bPKI_KeyVAEK, uint16_t wPKI_NLen, uint16_t wPKI_eLen, uint16_t wPKI_PLen, uint16_t wPKI_QLen, uint8_t *pPKI_N, uint8_t *pPKI_e, uint8_t *pPKI_p, uint8_t *pPKI_q, uint8_t *pPKI_dP, uint8_t *pPKI_dQ, uint8_t *pPKI_ipq) |
| Import a public or private RSA key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_ExportPrivateKey (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bPKI_KeyNo, uint8_t **ppKeyData, uint16_t *pKeyDataLen) |
| Export a full RSA key entry (i.e including the private key if present). More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_ExportPublicKey (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bPKI_KeyNo, uint8_t **ppKeyData, uint16_t *pKeyDataLen) |
| Export the public part of an RSA key pair. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_UpdateKeyEntries (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bNoOfKeyEntries, uint8_t bHashingAlg, uint8_t bPKI_KeyNo_Enc, uint8_t bPKI_KeyNo_Sign, uint8_t bPKI_KeyNo_Ack, uint8_t *pKeyFrame, uint16_t wKeyFrameLen, uint8_t **ppUpdateACK, uint16_t *pUpdateACKLen) |
| The PKI_UpdateKeyEntries can be used to change key entries of the symmetric key storage (KST). More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_EncipherKeyEntries (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bNoOfKeyEntries, uint8_t bHashingAlg, uint8_t bPKI_KeyNo_Enc, uint8_t bPKI_KeyNo_Sign, uint8_t bPKI_KeyNo_Dec, uint8_t bPKI_KeyNo_Verif, uint16_t wPerso_Ctr, uint8_t *pKeyEntries, uint8_t bKeyEntriesLen, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t **ppEncKeyFrame_Sign, uint16_t *pEncKeyFrame_Sign_Len) |
| Prepare a cryptogram (according to Asymmetric Offline Change Cryptogram) for the PKI offline update of KST key entries on a target SAM. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_GenerateHash (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bHashingAlg, uint32_t dwMLen, uint8_t *pMessage, uint16_t wMsgLen, uint8_t **ppHash, uint16_t *pHashLen) |
| Generate Hash DataFrame from Data. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_GenerateSignature (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bHashingAlg, uint8_t bPKI_KeyNo_Sign, uint8_t *pHash, uint8_t bHashLen) |
| Generate a signature with a given RSA key entry. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_SendSignature (phhalHw_Sam_DataParams_t *pDataParams, uint8_t **ppSignature, uint16_t *pSignatureLen) |
| Get a previously generated signature. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_VerifySignature (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bPKI_KeyNo_Verif, uint8_t bHashingAlg, uint8_t *pHash, uint8_t bHashLen, uint8_t *pSignature, uint16_t wSignatureLen) |
| Verify a hash / signature pair with a given RSA key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_EncipherData (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bHashingAlg, uint8_t bPKI_KeyNo_Enc, uint8_t *pPlainData, uint8_t bPlainDataLen, uint8_t **ppEncData, uint16_t *pEncDataLen) |
| Performs the offline encryption of plain RSA data. More... | |
| phStatus_t | phhalHw_Sam_Cmd_PKI_DecipherData (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bHashingAlg, uint8_t bPKI_KeyNo_Dec, uint8_t *pEncData, uint16_t wEncDataLen, uint8_t **ppPlainData, uint16_t *pPlainDataLen) |
| Performs the offline decryption of encrypted RSA data. More... | |
SAM commands used for asymmetric RSA key management, signature handling and symmetric key updates based on PKI.
| phStatus_t phhalHw_Sam_Cmd_PKI_GenerateKeyPair | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bPKI_KeyNo, | ||
| uint16_t | wPKI_Set, | ||
| uint8_t | bPKI_KeyNoCEK, | ||
| uint8_t | bPKI_KeyVCEK, | ||
| uint8_t | bPKI_RefNoKUC, | ||
| uint8_t | bPKI_KeyNoAEK, | ||
| uint8_t | bPKI_KeyVAEK, | ||
| uint16_t | wPKI_NLen, | ||
| uint16_t | wPKI_eLen, | ||
| uint8_t * | pPKI_e | ||
| ) |
Create a pair of a public and private RSA key.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pPKI_e is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Option for P1 information byte.
|
| [in] | bPKI_KeyNo | [In] Key reference number of the PKI Key Entry (00h to 01h). |
| [in] | wPKI_Set | [In] Configuration settings of the created key entry. |
| [in] | bPKI_KeyNoCEK | [In] Key reference number of KST change entry key.
|
| [in] | bPKI_KeyVCEK | [In] Key version of KST change entry key. |
| [in] | bPKI_RefNoKUC | [In] Reference number of key usage counter (00h - 0Fh, FFh). |
| [in] | bPKI_KeyNoAEK | [In] Key reference number of KST access entry key.
|
| [in] | bPKI_KeyVAEK | [In] Key version of KST access entry key. |
| [in] | wPKI_NLen | [In] RSA key length size in bytes: between 64 and 256 bytes, a multiple of 8 byte. |
| [in] | wPKI_eLen | [In] Public exponent length size in bytes between 4 and 256 bytes, a multiple of 4 byte, and shall not be greater than PKI_NLen: between 4 and 256 bytes, a multiple of 4 byte |
| [in] | pPKI_e | [In] Public exponent e where eLen is PKI_eLen. It must be an odd integer.
|
| phStatus_t phhalHw_Sam_Cmd_PKI_ImportKey | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bPKI_KeyNo, | ||
| uint16_t | wPKI_Set, | ||
| uint8_t | bPKI_KeyNoCEK, | ||
| uint8_t | bPKI_KeyVCEK, | ||
| uint8_t | bPKI_RefNoKUC, | ||
| uint8_t | bPKI_KeyNoAEK, | ||
| uint8_t | bPKI_KeyVAEK, | ||
| uint16_t | wPKI_NLen, | ||
| uint16_t | wPKI_eLen, | ||
| uint16_t | wPKI_PLen, | ||
| uint16_t | wPKI_QLen, | ||
| uint8_t * | pPKI_N, | ||
| uint8_t * | pPKI_e, | ||
| uint8_t * | pPKI_p, | ||
| uint8_t * | pPKI_q, | ||
| uint8_t * | pPKI_dP, | ||
| uint8_t * | pPKI_dQ, | ||
| uint8_t * | pPKI_ipq | ||
| ) |
Import a public or private RSA key.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | - pPKI_N and pPKI_e are NULL if bOption = Update only key settings
|
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Option for P1 information byte.
|
| [in] | bPKI_KeyNo | [In] Key reference number of the PKI Key Entry to update.
|
| [in] | wPKI_Set | [In] Configuration settings of the imported key entry. It indicates whether a private of public key shall be imported. |
| [in] | bPKI_KeyNoCEK | [In] Key reference number of KST change entry key.
|
| [in] | bPKI_KeyVCEK | [In] Key version of KST change entry key. |
| [in] | bPKI_RefNoKUC | [In] Reference number of key usage counter (00h - 0Fh, FFh). |
| [in] | bPKI_KeyNoAEK | [In] Key reference number of KST access entry key
|
| [in] | bPKI_KeyVAEK | [In] Key version of KST access entry key. |
| [in] | wPKI_NLen | [In] RSA key length size in bytes: between 64 and 256 bytes, a multiple of 8 byte. |
| [in] | wPKI_eLen | [In] Public exponent length size in bytes between 4 and 256 bytes, a multiple of 4 byte, and shall not be greater than PKI_NLen: between 4 and 256 bytes, a multiple of 4 byte. |
| [in] | wPKI_PLen | [In] If private key included, the prime p length size in bytes ceil(PKI_pLen / 4) + 2 <= ceil(PKI_NLen / 4). |
| [in] | wPKI_QLen | [In] If private key included, the prime q length size in bytes ceil(PKI_qLen/4) + 2 <= ceil(PKI_NLen/4). |
| [in] | pPKI_N | [In] If private key included, Modulus N where NLen is PKI_NLen. The most significant 32-bit word of N shall not be equal to zero. |
| [in] | pPKI_e | [In] If private key included, Public exponent e where eLen is PKI_eLen. It must be an odd integer. |
| [in] | pPKI_p | [In] If private key included, Prime p where pLen is PKI_pLen. The MSB of p shall not be equal to zero. |
| [in] | pPKI_q | [In] If private key included, Prime q where pLen is PKI_qLen. The MSB of q shall not be equal to zero. |
| [in] | pPKI_dP | [In] If private key included, Private exponent d_p where pLen is PKI_pLen. |
| [in] | pPKI_dQ | [In] If private key included, Private exponent d_q where qLen is PKI_qLen. |
| [in] | pPKI_ipq | [In] If private key included, Inverse p-1mod(q) where qLen is PKI_qLen. |
| phStatus_t phhalHw_Sam_Cmd_PKI_ExportPrivateKey | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bPKI_KeyNo, | ||
| uint8_t ** | ppKeyData, | ||
| uint16_t * | pKeyDataLen | ||
| ) |
Export a full RSA key entry (i.e including the private key if present).
A successful host authentication in the LC using SAM_AuthenticateHost with a Host Key is required to execute the PKI_ExportPrivateKey command. This needs to be done with the Host Key referenced by the PKI_KeyNoCEK and PKI_KeyVCEK of the targeted key entry.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful. More data available to receive from SAM. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pKeyDataLen is NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option for AEK selection and differentiating between first part and last part of data.
|
| [in] | bPKI_KeyNo | [In] Key reference number of the PKI Key Entry (00h to 01h). |
| [out] | ppKeyData | [Out] Received Private Key information from SAM. |
| [out] | pKeyDataLen | [Out] Length of bytes available in ppKeyData buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_ExportPublicKey | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bPKI_KeyNo, | ||
| uint8_t ** | ppKeyData, | ||
| uint16_t * | pKeyDataLen | ||
| ) |
Export the public part of an RSA key pair.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful. More data available to receive from SAM. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pKeyDataLen is NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option for AEK selection and differentiating between first part and last part of data.
|
| [in] | bPKI_KeyNo | [In] Key reference number of the PKI Key Entry (00h to 02h). |
| [out] | ppKeyData | [Out] Received Public Key information from SAM. |
| [out] | pKeyDataLen | [Out] Length of bytes available in ppKeyData buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_UpdateKeyEntries | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bNoOfKeyEntries, | ||
| uint8_t | bHashingAlg, | ||
| uint8_t | bPKI_KeyNo_Enc, | ||
| uint8_t | bPKI_KeyNo_Sign, | ||
| uint8_t | bPKI_KeyNo_Ack, | ||
| uint8_t * | pKeyFrame, | ||
| uint16_t | wKeyFrameLen, | ||
| uint8_t ** | ppUpdateACK, | ||
| uint16_t * | pUpdateACKLen | ||
| ) |
The PKI_UpdateKeyEntries can be used to change key entries of the symmetric key storage (KST).
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pKeyFrame and pUpdateACKLen are NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Option for AEK selection and differentiating between first part and last part of data.
|
| [in] | bNoOfKeyEntries | [In] Number of key entries to include in the cryptogram
|
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | bPKI_KeyNo_Enc | [In] Key reference number of the PKI Key Entry to be used for decryption (00h to 01h). |
| [in] | bPKI_KeyNo_Sign | [In] Key reference number of the PKI Key Entry to be used for signature verification (00h to 02h). |
| [in] | bPKI_KeyNo_Ack | [In] Key reference number of the PKI Key Entry to be used for acknowledge signature generation (00h to 01h). |
| [in] | pKeyFrame | [In] Buffer containing the RSA encrypted key entries and the signature (EncKeyFrame || Signature).
|
| [in] | wKeyFrameLen | [In] Length of bytes available in wKeyFrameLen buffer. |
| [out] | ppUpdateACK | [Out] Buffer containing the RSA encrypted Acknowledge signature. |
| [out] | pUpdateACKLen | [Out] Length of bytes available in ppUpdateACK buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_EncipherKeyEntries | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bNoOfKeyEntries, | ||
| uint8_t | bHashingAlg, | ||
| uint8_t | bPKI_KeyNo_Enc, | ||
| uint8_t | bPKI_KeyNo_Sign, | ||
| uint8_t | bPKI_KeyNo_Dec, | ||
| uint8_t | bPKI_KeyNo_Verif, | ||
| uint16_t | wPerso_Ctr, | ||
| uint8_t * | pKeyEntries, | ||
| uint8_t | bKeyEntriesLen, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t ** | ppEncKeyFrame_Sign, | ||
| uint16_t * | pEncKeyFrame_Sign_Len | ||
| ) |
Prepare a cryptogram (according to Asymmetric Offline Change Cryptogram) for the PKI offline update of KST key entries on a target SAM.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pKeyEntries, pDivInput and pEncKeyFrame_Sign_Len are NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option to differentiate between the command frame to be exchanged.
|
| [in] | bNoOfKeyEntries | [In] Number of key entries to include in the cryptogram
|
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | bPKI_KeyNo_Enc | [In] Key reference number of the PKI Key Entry to be used for the cryptogram encryption (00h to 02h). |
| [in] | bPKI_KeyNo_Sign | [In] Key reference number of the PKI Key Entry to be used for the cryptogram signature generation (00h to 01h). |
| [in] | bPKI_KeyNo_Dec | [In] Key reference number of the PKI Key Entry that will be used for decryption in the target SAM (00h to 01h). |
| [in] | bPKI_KeyNo_Verif | [In] Key reference number of the PKI Key Entry that will be used for signature verification in the target SAM (00h to 02h). |
| [in] | wPerso_Ctr | [In] Targeted offline change counter data. |
| [in] | pKeyEntries | [In] Key entry descriptions
|
| [in] | bKeyEntriesLen | [In] Length of bytes available in pKeyEntries buffer. |
| [in] | pDivInput | [In] Diversification input for key diversification. (1 to 31 byte(s) input). |
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | ppEncKeyFrame_Sign | [Out] The Encrypted Key frame and Signature as returned by Sam hardware.
|
| [out] | pEncKeyFrame_Sign_Len | [Out] Length of bytes available in ppEncKeyFrame_Sign buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_GenerateHash | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bHashingAlg, | ||
| uint32_t | dwMLen, | ||
| uint8_t * | pMessage, | ||
| uint16_t | wMsgLen, | ||
| uint8_t ** | ppHash, | ||
| uint16_t * | pHashLen | ||
| ) |
Generate Hash DataFrame from Data.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pMessage and pHashLen are NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering Options:
|
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | dwMLen | [In] Overall message length (4 byte). |
| [in] | pMessage | [In] Message chunk to be hashed. |
| [in] | wMsgLen | [In] Length of bytes available in pMessage buffer. |
| [out] | ppHash | [Out] Buffer containing the hash after sending the last message chunk. |
| [out] | pHashLen | [Out] Length of bytes available in pHashLen buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_GenerateSignature | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bHashingAlg, | ||
| uint8_t | bPKI_KeyNo_Sign, | ||
| uint8_t * | pHash, | ||
| uint8_t | bHashLen | ||
| ) |
Generate a signature with a given RSA key entry.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pHash is NULL |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | bPKI_KeyNo_Sign | [In] Key reference number of the PKI Key Entry to be used for the cryptogram signature generation (00h to 01h). |
| [in] | pHash | [In] Hash message to be signed. |
| [in] | bHashLen | [In] Length of bytes available in pHash buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_SendSignature | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t ** | ppSignature, | ||
| uint16_t * | pSignatureLen | ||
| ) |
Get a previously generated signature.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pHash is NULL |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [out] | ppSignature | [Out] The signature received from Sam hardware. |
| [out] | pSignatureLen | [Out] Length of bytes available in ppSignature buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_VerifySignature | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bPKI_KeyNo_Verif, | ||
| uint8_t | bHashingAlg, | ||
| uint8_t * | pHash, | ||
| uint8_t | bHashLen, | ||
| uint8_t * | pSignature, | ||
| uint16_t | wSignatureLen | ||
| ) |
Verify a hash / signature pair with a given RSA key.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pHash and pSignature are NULL |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bPKI_KeyNo_Verif | [In] Key reference number of the PKI Key Entry to be used for the cryptogram signature verification (00h to 02h) |
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | pHash | [In] Hash message to be signed. |
| [in] | bHashLen | [In] Length of bytes available in pHash buffer. |
| [in] | pSignature | [In] RSA digital signature where NLen is the PKI_NLen of the PKI_KeyNo key entry |
| [in] | wSignatureLen | [In] Length of bytes available in pSignature buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_EncipherData | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bHashingAlg, | ||
| uint8_t | bPKI_KeyNo_Enc, | ||
| uint8_t * | pPlainData, | ||
| uint8_t | bPlainDataLen, | ||
| uint8_t ** | ppEncData, | ||
| uint16_t * | pEncDataLen | ||
| ) |
Performs the offline encryption of plain RSA data.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pPlainData and pEncDataLen are NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | bPKI_KeyNo_Enc | [In] Key reference number of the PKI Key Entry to be used for encryption (00h to 02h). |
| [in] | pPlainData | [In] RSA Plain Data to be encrypted where mLen (wPlainDataLen) is restricted by the PKI_NLen of the PKI_KeyNo_Enc key entry and the output length of the hash function |
| [in] | bPlainDataLen | [In] Length of bytes available in pPlainData buffer. |
| [out] | ppEncData | [Out] RSA encrypted data as EncData = RSA_E ( KPKI_KeyNo_Enc , PlainData) where LenE is the PKI_NLen of the PKI_KeyNo_Enc key entry. |
| [out] | pEncDataLen | [Out] Length of bytes available in ppEncData buffer. |
| phStatus_t phhalHw_Sam_Cmd_PKI_DecipherData | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bHashingAlg, | ||
| uint8_t | bPKI_KeyNo_Dec, | ||
| uint8_t * | pEncData, | ||
| uint16_t | wEncDataLen, | ||
| uint8_t ** | ppPlainData, | ||
| uint16_t * | pPlainDataLen | ||
| ) |
Performs the offline decryption of encrypted RSA data.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pEncData and pPlainDataLen are NULL |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option parameter:
|
| [in] | bHashingAlg | [In] Hashing algorithm selection (for padding MGFs and digital signature). |
| [in] | bPKI_KeyNo_Dec | [In] Key reference number of the PKI Key Entry to be used for decryption (00h to 01h). |
| [in] | pEncData | [In] RSA encrypted data as EncData = RSA_E ( KPKI_KeyNo_Enc , PlainData) where LenE is the PKI_NLen of the PKI_KeyNo_Enc key entry |
| [in] | wEncDataLen | [In] Length of bytes available in pEncData buffer. |
| [in] | ppPlainData | [In] RSA decrypted data as PlainData= RSA_D ( KPKI_KeyNo_Enc , EncData) where mLen is limited by the PKI_NLen of the PKI_Key No_Enc key entry and the output length of the hash function |
| [in] | pPlainDataLen | [In] Length of bytes available in ppPlainData buffer. |