NXP Reader Library  v17.1.0.2535

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

Collaboration diagram for RSA:

Macros

#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_CMD_SIZE   17U
 Macro to represent the PKI_GenerateKeyPair command size.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_KEY_CMD_SIZE   21U
 Macro to represent the PKI_ImportKey command size.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_HASH_CMD_SIZE   9U
 Macro to represent the PKI_GenerateHash command size.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_ENCIPHER_KEY_ENTRIES_CMD_SIZE   11U
 Macro to represent the PKI_EncipherKeyEntries command size.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_ENCIPHER_DATA_CMD_SIZE   6U
 Macro to represent the PKI_EncipherData command size.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_DECIPHER_DATA_CMD_SIZE   6U
 Macro to represent the PKI_DecipherData command size.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_LC_MIN   10U
 Minimun Length of LC data for PKI_GenerateKeyPair command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_KEY_LC_MIN   6U
 Minimun Length of LC data for PKI_ImportKey command.
 

Functions

phStatus_t phhalHw_SamAV3_Cmd_PKI_GenerateKeyPair (phhalHw_SamAV3_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 an RSA key pair. More...
 
phStatus_t phhalHw_SamAV3_Cmd_PKI_ImportKey (phhalHw_SamAV3_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_SamAV3_Cmd_PKI_ExportPrivateKey (phhalHw_SamAV3_DataParams_t *pDataParams, uint16_t wOption, uint8_t bPKI_KeyNo, uint8_t **ppKeyData, uint16_t *pKeyDataLen)
 Export the private part of an RSA key pair. More...
 
phStatus_t phhalHw_SamAV3_Cmd_PKI_ExportPublicKey (phhalHw_SamAV3_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_SamAV3_Cmd_PKI_UpdateKeyEntries (phhalHw_SamAV3_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)
 Change up to 3 symmetric key entries by using PKI. More...
 
phStatus_t phhalHw_SamAV3_Cmd_PKI_EncipherKeyEntries (phhalHw_SamAV3_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_SamAV3_Cmd_PKI_GenerateHash (phhalHw_SamAV3_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_SamAV3_Cmd_PKI_GenerateSignature (phhalHw_SamAV3_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_SamAV3_Cmd_PKI_SendSignature (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t **ppSignature, uint16_t *pSignatureLen)
 Get a previously generated signature. More...
 
phStatus_t phhalHw_SamAV3_Cmd_PKI_VerifySignature (phhalHw_SamAV3_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_SamAV3_Cmd_PKI_EncipherData (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bHashingAlg, uint8_t bPKI_KeyNo_Enc, uint8_t *pPlainData, uint16_t wPlainDataLen, uint8_t **ppEncData, uint16_t *pEncDataLen)
 Performs the offline encryption of plain RSA data. More...
 
phStatus_t phhalHw_SamAV3_Cmd_PKI_DecipherData (phhalHw_SamAV3_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 AV3 command code for Public Key Infrastructure features.

#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_INS   0x15
 Sam AV3 Instruction code for Cmd.PKI_GenerateKeyPair command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_KEY_INS   0x19
 Sam AV3 Instruction code for Cmd.PKI_ImportKey command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_PRIVATE_KEY_INS   0x1F
 Sam AV3 Instruction code for Cmd.PKI_ExportPrivateKey command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_PUBLIC_KEY_INS   0x18
 Sam AV3 Instruction code for Cmd.PKI_ExportPublicKey command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_UPDATE_KEY_ENTRIES_INS   0x1D
 Sam AV3 Instruction code for Cmd.PKI_UpdateKeyEntries command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_ENCIPHER_KEY_ENTRIES_INS   0x12
 Sam AV3 Instruction code for Cmd.PKI_EncipherKeyEntries command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_HASH_INS   0x17
 Sam AV3 Instruction code for Cmd.PKI_GenerateHsh command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_SIGNATURE_INS   0x16
 Sam AV3 Instruction code for Cmd.PKI_GenerateSignature command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_SEND_SIGNATURE_INS   0x1A
 Sam AV3 Instruction code for Cmd.PKI_SendSignature command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_VERIFY_SIGNATURE_INS   0x1B
 Sam AV3 Instruction code for Cmd.PKI_VerifySignature command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_ENCIPHER_DATA_INS   0x13
 Sam AV3 Instruction code for Cmd.PKI_EncipherData command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_DECIPHER_DATA_INS   0x14
 Sam AV3 Instruction code for Cmd.PKI_Decipher command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_ECC_KEY_INS   0x21
 Sam AV3 Instruction code for Cmd.PKI_ImportEccKey command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_ECC_CURVE_INS   0x22
 Sam AV3 Instruction code for Cmd.PKI_ImportEccCurve command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_ECC_PUBLIC_KEY_INS   0x23
 Sam AV3 Instruction code for Cmd.PKI_ExportEccPublicKey command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_VERIFY_ECC_SIGNATURE_INS   0x20
 Sam AV3 Instruction code for Cmd.PKI_VerifyEccSignature command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_CAPK_INS   0x24
 Sam AV3 Instruction code for Cmd.PKI_ImportCaPk command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_REMOVE_CAPK_INS   0x2F
 Sam AV3 Instruction code for Cmd.PKI_RemoveCaPk command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_CAPK_INS   0x3D
 Sam AV3 Instruction code for Cmd.PKI_ExportCaPk command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_LOAD_ISSUER_PK_INS   0x27
 Sam AV3 Instruction code for Cmd.PKI_LoadIssuerPk command.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_LOAD_ICC_PK_INS   0x28
 Sam AV3 Instruction code for Cmd.PKI_LoadIccPk command.
 

Option macros for Sam AV3 Public Key Infrastructure GenerateKeyPair command.

#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_RANDOM_E   0x00
 Option mask for a key generation with a randomly selected exponent e.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_HOST_E   0x01
 Option mask for a key generation with a given exponent e.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_AEK_EXCLUDE   0x00
 Option mask for a key generation with Access Entry Key excluded.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_KEY_PAIR_AEK_INCLUDE   0x02
 Option mask for a key generation with Access Entry Key included.
 

Option macros for Sam AV3 Public Key Infrastructure ImportKey command.

#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_KEY_AEK_EXCLUDE   0x00
 Option mask for importing a key with Access Entry Key excluded.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_IMPORT_KEY_AEK_INCLUDE   0x02
 Option mask for importing a key with Access Entry Key included.
 

Option macros for Sam AV3 Public Key Infrastructure ExportPrivateKey command.

#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_PRIVATE_KEY_AEK_EXCLUDE   0x0000
 Option mask for disabling export of Access Entry Key number and version.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_PRIVATE_KEY_AEK_INCLUDE   0x0080
 Option mask for enabling export of Access Entry Key number and version.
 

Option macros for Sam AV3 Public Key Infrastructure ExportPublicKey command.

#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_PUBLIC_KEY_AEK_EXCLUDE   0x0000
 Option mask for disabling export of Access Entry Key number and version.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_EXPORT_PUBLIC_KEY_AEK_INCLUDE   0x0080
 Option mask for enabling export of Access Entry Key number and version.
 

Option macros for Sam AV3 Public Key Infrastructure hash algorithms.

#define PHHAL_HW_SAMAV3_CMD_PKI_HASH_ALGORITHM_SHA_1   0x00
 Option mask for SHA 1 hashing algorithm to be used.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_HASH_ALGORITHM_SHA_224   0x01
 Option mask for SHA 224 hashing algorithm to be used.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_HASH_ALGORITHM_RFU   0x02
 Option mask for RFU hashing algorithm to be used.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_HASH_ALGORITHM_SHA_256   0x03
 Option mask for SHA 256 hashing algorithm to be used.
 

Option macros for Sam AV3 Public Key Infrastructure UpdateKeyEntries command.

#define PHHAL_HW_SAMAV3_CMD_PKI_UPDATE_KEY_ENTRY_ACK_EXCLUDE   0x00
 Option mask for excluding the LE byte and Acknowledge key number.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_UPDATE_KEY_ENTRY_ACK_INCLUDE   0x80
 Option mask for including the LE byte and Acknowledge key number.
 

Option macros for Sam AV3 Public Key Infrastructure key diversification.

#define PHHAL_HW_SAMAV3_CMD_PKI_DIVERSIFICATION_OFF   0x00
 Option mask disabling the key diversification.
 
#define PHHAL_HW_SAMAV3_CMD_PKI_DIVERSIFICATION_ON   0x10
 Option mask enabling the key diversification.
 

Option macros for Sam AV3 Public Key Infrastructure GenerateHash command.

#define PHHAL_HW_SAMAV3_CMD_PKI_GENERATE_HASH_FIRST_FRAME   0x04
 Option mask for a framing the first frame of Generate hash command.
 

Option macros for Sam AV3 Public Key Infrastructure DecipherData command.

#define PHHAL_HW_SAMAV3_CMD_PKI_DECIPHER_DATA_FIRST_FRAME   0x80
 Option mask for a framing the first frame of Decipher Data command.
 

Detailed Description

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

See also

Function Documentation

◆ phhalHw_SamAV3_Cmd_PKI_GenerateKeyPair()

phStatus_t phhalHw_SamAV3_Cmd_PKI_GenerateKeyPair ( phhalHw_SamAV3_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 an RSA key pair.

This command is available for AV2 and AV3 version(s).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option for P1 information byte.
[in]bPKI_KeyNo[In] Reference number of the key entry where the created key should be stored (00h to 01h).
[in]wPKI_Set[In] Configuration settings of the created key entry.
[in]bPKI_KeyNoCEK[In] Reference number to the change key of the created key entry.
[in]bPKI_KeyVCEK[In] Version of the change key of the created key entry.
[in]bPKI_RefNoKUC[In] Reference number to the KUC of the created key entry.
[in]bPKI_KeyNoAEK[In] Reference number to the created access key entry.
0xFE : No Access Restrictions
0xFF : Entry Disabled
0x00 - 0x7F : Access key entry number
[in]bPKI_KeyVAEK[In] Version of the created acces key entry.
[in]wPKI_NLen[In] Length of the modulus N (multiple of 8 and in [32;256]).
[in]wPKI_eLen[In] Length of the exponent e (multiple of 4 and in [4;256]).
[in]pPKI_e[In] Buffer containing the exponent e provided by user or host.

◆ phhalHw_SamAV3_Cmd_PKI_ImportKey()

phStatus_t phhalHw_SamAV3_Cmd_PKI_ImportKey ( phhalHw_SamAV3_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.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option for P1 information byte.
[in]bPKI_KeyNo[In] Reference Number of the key entry to be imported (00h to 01h if private key is included or 00h to 02h if not included).
[in]wPKI_Set[In] Configuration settings of the imported key entry. It indicates wheter a private of public key shall be imported.
[in]bPKI_KeyNoCEK[In] Reference number to the change key of the imported key entry. 0xFE : No Restrictions
0xFF : Entry Locked
0x00 - 0x7F: Restricted to specific permanent KST Key Entry
[in]bPKI_KeyVCEK[In] Version of the change key of the imported key entry.
[in]bPKI_RefNoKUC[In] Reference number to the KUC of the created key entry.
[in]bPKI_KeyNoAEK[In] Reference number to the created access key entry.
0xFE : No Access Restrictions
0xFF : Entry Disabled
0x00 - 0x7F : Access key entry number
[in]bPKI_KeyVAEK[In] Version of the created acces key entry.
[in]wPKI_NLen[In] Length of Modulus N (multiple of 8 and in [32;256]).
[in]wPKI_eLen[In] Length of exponent e (multiple of 4 and in [4;256]).
[in]wPKI_PLen[In] Length of prime P.
[in]wPKI_QLen[In] Length of prime Q.
[in]pPKI_N[In] Buffer containing the Modulus N.
[in]pPKI_e[In] Buffer containing the Exponent e.
[in]pPKI_p[In] Buffer containing the Prime P.
[in]pPKI_q[In] Buffer containing the Prime Q.
[in]pPKI_dP[In] Parameter dP padded up to a length of wPKI_PLen.
[in]pPKI_dQ[In] Parameter dQ padded up to a length of wPKI_QLen.
[in]pPKI_ipq[In] Inverse P(-1) mod Q padded up to a length of wPKI_QLen.

◆ phhalHw_SamAV3_Cmd_PKI_ExportPrivateKey()

phStatus_t phhalHw_SamAV3_Cmd_PKI_ExportPrivateKey ( phhalHw_SamAV3_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t  bPKI_KeyNo,
uint8_t **  ppKeyData,
uint16_t pKeyDataLen 
)

Export the private part of an RSA key pair.

This command is only available for AV2 and AV3 version(s).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, command completed.
PH_ERR_SUCCESS_CHAININGOperation successful, chaining ongoing.
OtherDepending on implementation and underlaying component.
Parameters
[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] Reference number of the key entry to be exported (00h to 01h).
[out]ppKeyData[Out] Pointer to received key data.
[out]pKeyDataLen[Out] Length of received data.

◆ phhalHw_SamAV3_Cmd_PKI_ExportPublicKey()

phStatus_t phhalHw_SamAV3_Cmd_PKI_ExportPublicKey ( phhalHw_SamAV3_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.

This command is only available for AV2 and AV3 version(s).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, command completed.
PH_ERR_SUCCESS_CHAININGOperation successful, chaining ongoing.
OtherDepending on implementation and underlaying component.
Parameters
[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] Reference number of the key entry to be exported (00h to 01h).
[out]ppKeyData[Out] Pointer to received key data.
[out]pKeyDataLen[Out] Length of received data.

◆ phhalHw_SamAV3_Cmd_PKI_UpdateKeyEntries()

phStatus_t phhalHw_SamAV3_Cmd_PKI_UpdateKeyEntries ( phhalHw_SamAV3_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 
)

Change up to 3 symmetric key entries by using PKI.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option to receive the UploadACK.
[in]bNoOfKeyEntries[In] Number of symmetric key entries to update.
0x00: RFU
0x01: 1 Key Entry
0x02: 2 Key Entry
0x03: 3 Key Entry
[in]bHashingAlg[In] Hashing algorithm selection (for padding MGFs and digital signature).
[in]bPKI_KeyNo_Enc[In] Reference number of the RSA key entry to be used for decryption (00h to 01h).
[in]bPKI_KeyNo_Sign[In] Reference number of the RSA key entry to be used for signature verification (00h to 02h).
[in]bPKI_KeyNo_Ack[In] Reference number of the RSA 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.
[in]wKeyFrameLen[In] Length of RSA encrypted key entries and the signature.
[out]ppUpdateACK[Out] Buffer containing the RSA encrypted Acknowledge signature.
[out]pUpdateACKLen[Out] Length of RSA encrypted Acknowledge signature.

◆ phhalHw_SamAV3_Cmd_PKI_EncipherKeyEntries()

phStatus_t phhalHw_SamAV3_Cmd_PKI_EncipherKeyEntries ( phhalHw_SamAV3_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.

This command is only available for AV3 version(s).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, command completed.
PH_ERR_SUCCESS_CHAININGOperation successful, chaining ongoing.
OtherDepending on implementation and underlaying component.
Parameters
[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.
0x00: RFU
0x01: 1 Key Entry
0x02: 2 Key Entry
0x03: 3 Key Entry
[in]bHashingAlg[In] Hashing algorithm selection (for padding MGFs and digital signature).
[in]bPKI_KeyNo_Enc[In] Reference number of the RSA key entry to be used for encryption (00h to 02h).
[in]bPKI_KeyNo_Sign[In] Reference number of the RSA key entry to be used for signature verification (00h to 01h).
[in]bPKI_KeyNo_Dec[In] Reference number of the RSA key entry to be used for decryption (00h to 01h).
[in]bPKI_KeyNo_Verif[In] Reference number of the RSA key entry to be used for signature verification (00h to 02h).
[in]wPerso_Ctr[In] Targeted offline change counter data.
[in]pKeyEntries[In] Set of 01h - 03h reference number(s) of
Perso key entry: 00h - 7Fh (NVRam key) or E0h - E3h (Ram key)
key number : 00h - 7Fh
[in]bKeyEntriesLen[In] Length of key entries.
[in]pDivInput[In] Diversification input for key diversification. (1 to 31 byte(s) input).
[in]bDivInputLen[In] Length of diversification input.
[out]ppEncKeyFrame_Sign[Out] The Encrypted Key frame and Signature as returned by Sam hardware.
[out]pEncKeyFrame_Sign_Len[Out] The length of Encrypted Key frame and Signature returned by Sam hardware.

◆ phhalHw_SamAV3_Cmd_PKI_GenerateHash()

phStatus_t phhalHw_SamAV3_Cmd_PKI_GenerateHash ( phhalHw_SamAV3_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.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful, command completed.
PH_ERR_SUCCESS_CHAININGOperation successful, chaining ongoing.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
Local buffering is implemented by the flags
[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 message chunk.
[out]ppHash[Out] Buffer containing the hash after sending the last message chunk.
[out]pHashLen[Out] Amount of valid data in hash buffer.

◆ phhalHw_SamAV3_Cmd_PKI_GenerateSignature()

phStatus_t phhalHw_SamAV3_Cmd_PKI_GenerateSignature ( phhalHw_SamAV3_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.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[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] Number of the key entry to be used for signing (00h to 01h).
[in]pHash[In] Hash message to be signed.
[in]bHashLen[In] Hash message length.

◆ phhalHw_SamAV3_Cmd_PKI_SendSignature()

phStatus_t phhalHw_SamAV3_Cmd_PKI_SendSignature ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t **  ppSignature,
uint16_t pSignatureLen 
)

Get a previously generated signature.

This command is only available for AV2 and AV3 version(s).

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]ppSignature[Out] The signature received from Sam hardware.
[out]pSignatureLen[Out] Length of signature received.

◆ phhalHw_SamAV3_Cmd_PKI_VerifySignature()

phStatus_t phhalHw_SamAV3_Cmd_PKI_VerifySignature ( phhalHw_SamAV3_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.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[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 data.
[in]bHashLen[In] Hash data length.
[in]pSignature[In] RSA digital signature.
[in]wSignatureLen[In] RSA digital signature length.

◆ phhalHw_SamAV3_Cmd_PKI_EncipherData()

phStatus_t phhalHw_SamAV3_Cmd_PKI_EncipherData ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bHashingAlg,
uint8_t  bPKI_KeyNo_Enc,
uint8_t pPlainData,
uint16_t  wPlainDataLen,
uint8_t **  ppEncData,
uint16_t pEncDataLen 
)

Performs the offline encryption of plain RSA data.

This is only supported by Sam AV3 version.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[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] Reference number of the RSA key entry to be used for encryption (00h to 02h).
[in]pPlainData[In] RSA Plain Data to be encrypted.
[in]wPlainDataLen[In] Length of plain data.
[out]ppEncData[Out] The RSA encrypted data returned by Sam hardware.
[out]pEncDataLen[Out] Length of encrypted data.

◆ phhalHw_SamAV3_Cmd_PKI_DecipherData()

phStatus_t phhalHw_SamAV3_Cmd_PKI_DecipherData ( phhalHw_SamAV3_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.

This is only supported by Sam AV3 version.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGOperation successful, chaining ongoing.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
Local buffering is implemented by the flags
[in]bHashingAlg[In] Hashing algorithm selection (for padding MGFs and digital signature).
[in]bPKI_KeyNo_Dec[In] Reference number of the RSA key entry to be used for decryption (00h to 01h).
[in]pEncData[In] The RSA encrypted data to be decrypted.
[in]wEncDataLen[In] Length of encrypted data.
[in]ppPlainData[In] RSA Plain Data returned by Sam hardware.
[in]pPlainDataLen[In] Length of plain data.