![]() |
xilsecure
Vitis Drivers API Documentation
|
Macros | |
| #define | XSECURE_KAT_MSG_LEN_IN_BYTES (32U) |
| Message length of known answer test in bytes. More... | |
| #define | XSECURE_KAT_AAD_SIZE_IN_BYTES (16U) |
| AAD size of known answer test in bytes. More... | |
| #define | XSECURE_KAT_IV_SIZE_IN_BYTES (16U) |
| IV size of known answer test in bytes. More... | |
| #define | XSECURE_KAT_KEY_SIZE_IN_BYTES (32U) |
| Key size of known answer test in bytes. More... | |
| #define | XSECURE_KAT_MSG_LEN_IN_WORDS (8U) |
| Message length of known answer test in words. More... | |
| #define | XSECURE_KAT_RSA_PUB_EXP (0x1000100U) |
| RSA public exponent of known answer test. More... | |
| #define | XSECURE_KAT_ECC_P521_SHA3_HASH_SIZE_IN_BYTES (66U) |
| Hash size of ECC P521 and SHA3 in bytes. More... | |
| #define | XSECURE_KAT_MAX_CMD_LEN (4U) |
| Maximum command length. More... | |
| #define | XSECURE_DDR_KAT_MASK_MUL (4U) |
| Multiplier to get DDR KAT mask. More... | |
| #define | XSECURE_DDR_MAX_SUPPORT (7U) |
| Maximum supported DDR. More... | |
| #define | XSECURE_DEF_KAT_MASK (0xFFFFFFFFU) |
| KAT mask. More... | |
Functions | |
| u8 * | XSecure_GetKatMessage (void) |
| This function returns message to perform KAT. More... | |
| u8 * | XSecure_GetKatAesKey (void) |
| This function returns AES key for KAT. More... | |
| u8 * | XSecure_GetKatSha3ExpHash (void) |
| This function returns expected SHA3 hash for KAT. More... | |
| u32 * | XSecure_GetKatRsaModulus (void) |
| This function returns modulus for RSA KAT. More... | |
| u32 * | XSecure_GetKatRsaModExt (void) |
| This function returns public pre-calculated exponential (R^2 Mod N) value for RSA KAT. More... | |
| u32 * | XSecure_GetKatRsaData (void) |
| This function returns data for RSA KAT. More... | |
| u32 * | XSecure_GetKatRsaCtData (void) |
| This function returns cipher text data for RSA KAT. More... | |
| u32 * | XSecure_GetKatRsaPrivateExp (void) |
| This function returns private exponent for RSA KAT. More... | |
| XSecure_EllipticKey * | XSecure_GetKatEccPublicKey (XSecure_EllipticCrvClass CrvClass) |
| This function returns ECC public key to perform KAT. More... | |
| XSecure_EllipticSign * | XSecure_GetKatEccExpSign (XSecure_EllipticCrvClass CrvClass) |
| This function returns ECC expected signature to perform KAT. More... | |
| u8 * | XSecure_GetKatEccPrivateKey (XSecure_EllipticCrvClass CrvClass) |
| This function returns ECC private key to perform KAT. More... | |
| u8 * | XSecure_GetKatEccEphemeralKey (XSecure_EllipticCrvTyp CrvType) |
| This function returns ECC ephemeral key to perform KAT. More... | |
| int | XSecure_AesDecryptCmKat (const XSecure_Aes *AesInstance) |
| This function performs known answer test(KAT) on AES engine to confirm DPA counter measures is working fine. More... | |
| int | XSecure_AesDecryptKat (XSecure_Aes *AesInstance) |
| This function performs decryption known answer test(KAT) on AES engine. More... | |
| int | XSecure_AesEncryptKat (XSecure_Aes *AesInstance) |
| This function performs encryption known answer test(KAT) on AES engine. More... | |
| int | XSecure_Sha3Kat (XSecure_Sha3 *SecureSha3) |
| This function performs known answer test(KAT) on SHA crypto engine. More... | |
| int | XSecure_RsaPublicEncryptKat (void) |
| This function performs KAT on RSA core. More... | |
| int | XSecure_EllipticVerifySignKat (XSecure_EllipticCrvClass CrvClass) |
| This function performs ECC sign verify known answer test(KAT) on ECC core. More... | |
| int | XSecure_EllipticSignGenerateKat (XSecure_EllipticCrvClass CrvClass) |
| This function performs ECC sign generate known answer test(KAT) on ECC core. More... | |
| int | XSecure_EllipticPwct (XSecure_EllipticCrvTyp Curvetype, u64 DAddr, XSecure_EllipticKeyAddr *PubKeyAddr) |
| This function performs ECC pairwise consistency test on ECC core. More... | |
| int | XSecure_KatIpiHandler (XPlmi_Cmd *Cmd) |
| This function calls respective IPI handler based on the API_ID. More... | |
| int | XSecure_RsaPrivateDecryptKat (void) |
| This function performs private decrypt KAT on RSA core. More... | |
| int | XSecure_HmacKat (XSecure_Sha *SecureSha) |
| This function performs KAT on HMAC (SHA3-384). More... | |
| int | XSecure_Sha384Kat (void) |
| This function performs KAT on SHA-384. More... | |
| int | XSecure_Sha2256Kat (XSecure_Sha *SecureSha2) |
| This function performs known answer test(KAT) on SHA-2 crypto engine. More... | |
| int | XSecure_ShakeKat (XSecure_Sha *SecureShake) |
| This function performs known answer test(KAT) on SHAKE crypto engine. More... | |
| int | XSecure_HssSha2256Kat (XSecure_Sha *ShaInstPtr, XPmcDma *DmaPtr) |
| This function performs KAT on HSS SHA2 256. More... | |
| int | XSecure_HssShake256Kat (XSecure_Sha *ShaInstPtr, XPmcDma *DmaPtr) |
| This function performs KAT on HSS SHAKE 256. More... | |
| int | XSecure_LmsSha2256Kat (XSecure_Sha *ShaInstPtr, XPmcDma *DmaPtr) |
| This function performs KAT on LMS - SHA2 256. More... | |
| int | XSecure_LmsShake256Kat (XSecure_Sha *ShaInstPtr, XPmcDma *DmaPtr) |
| This function performs KAT on LMS SHAKE 256. More... | |
| int | XSecure_KatPlatIpiHandler (XPlmi_Cmd *Cmd) |
| This function calls respective IPI handler based on the API_ID. More... | |
| int | XSecure_RsaPwct (XSecure_RsaPrivKey *PrivKey, XSecure_RsaPubKey *PubKey, void *ShaInstancePtr, XSecure_ShaMode Shatype) |
| This function performs pairwise consistency test for generated RSA key pair using OAEP encrypt and decrypt operation. More... | |
| int | XSecure_UpdateKatStatusIpiHandler (XPlmi_Cmd *Cmd) |
| This function calls respective IPI handler based on the API_ID. More... | |
AES KAT parameters | |
| #define | XSECURE_KAT_AES_SPLIT_DATA_SIZE (4U) |
| < AES KAT parameters More... | |
| #define | XSECURE_KAT_KEY_SIZE_IN_WORDS (8U) |
| #define | XSECURE_KAT_OPER_DATA_SIZE_IN_WORDS (16U) |
| #define XSECURE_DDR_KAT_MASK_MUL (4U) |
Multiplier to get DDR KAT mask.
Referenced by XSecure_UpdateKatStatusIpiHandler().
| #define XSECURE_DDR_MAX_SUPPORT (7U) |
Maximum supported DDR.
Referenced by XSecure_UpdateKatStatusIpiHandler().
| #define XSECURE_DEF_KAT_MASK (0xFFFFFFFFU) |
KAT mask.
Referenced by XSecure_UpdateKatStatusIpiHandler().
| #define XSECURE_KAT_AAD_SIZE_IN_BYTES (16U) |
AAD size of known answer test in bytes.
Referenced by XSecure_AesDecryptKat(), and XSecure_AesEncryptKat().
| #define XSECURE_KAT_AES_SPLIT_DATA_SIZE (4U) |
< AES KAT parameters
| #define XSECURE_KAT_ECC_P521_SHA3_HASH_SIZE_IN_BYTES (66U) |
Hash size of ECC P521 and SHA3 in bytes.
| #define XSECURE_KAT_IV_SIZE_IN_BYTES (16U) |
IV size of known answer test in bytes.
| #define XSECURE_KAT_KEY_SIZE_IN_BYTES (32U) |
Key size of known answer test in bytes.
Referenced by XSecure_HmacKat().
| #define XSECURE_KAT_MAX_CMD_LEN (4U) |
Maximum command length.
Referenced by XSecure_UpdateKatStatusIpiHandler().
| #define XSECURE_KAT_MSG_LEN_IN_BYTES (32U) |
Message length of known answer test in bytes.
Referenced by XSecure_AesDecryptKat(), XSecure_AesEncryptKat(), XSecure_HmacKat(), XSecure_RsaPwct(), XSecure_Sha384Kat(), and XSecure_Sha3Kat().
| #define XSECURE_KAT_MSG_LEN_IN_WORDS (8U) |
Message length of known answer test in words.
Referenced by XSecure_AesDecryptKat(), and XSecure_AesEncryptKat().
| #define XSECURE_KAT_RSA_PUB_EXP (0x1000100U) |
RSA public exponent of known answer test.
Referenced by XSecure_RsaPublicEncryptKat().
| int XSecure_AesDecryptCmKat | ( | const XSecure_Aes * | AesInstance | ) |
This function performs known answer test(KAT) on AES engine to confirm DPA counter measures is working fine.
| AesInstance | Pointer to the XSecure_Aes instance |
Perform KAT on AES engine to know performance integrity
References XSECURE_AES_KAT_BUSY, XSECURE_AES_STATE_MISMATCH_ERROR, XSECURE_AES_USER_KEY_7, XSECURE_AESDPACM_KAT_CHECK1_FAILED_ERROR, XSECURE_AESDPACM_KAT_CHECK2_FAILED_ERROR, XSECURE_AESDPACM_KAT_CHECK3_FAILED_ERROR, XSECURE_AESDPACM_KAT_CHECK4_FAILED_ERROR, XSECURE_AESDPACM_KAT_CHECK5_FAILED_ERROR, XSecure_AesDpaCmDecryptData(), XSECURE_AESKAT_INVALID_PARAM, and XSecure_AesKeyZero().
| int XSecure_AesDecryptKat | ( | XSecure_Aes * | AesInstance | ) |
This function performs decryption known answer test(KAT) on AES engine.
| AesInstance | Pointer to the XSecure_Aes instance |
Write AES key
Configure AES engine to decryption
Update AAD
Update input and output addresses to AES engine
Verify the GCM Tag
Validate the decrypted data with expected data provided
References XSECURE_AES_KAT_BUSY, XSECURE_AES_KAT_DATA_MISMATCH_ERROR, XSECURE_AES_KAT_DECRYPT_INIT_FAILED_ERROR, XSECURE_AES_KAT_DECRYPT_UPDATE_FAILED_ERROR, XSECURE_AES_KAT_GCM_TAG_MISMATCH_ERROR, XSECURE_AES_KAT_UPDATE_AAD_FAILED_ERROR, XSECURE_AES_KAT_WRITE_KEY_FAILED_ERROR, XSECURE_AES_STATE_MISMATCH_ERROR, XSECURE_AES_USER_KEY_7, XSecure_AesDecryptFinal(), XSecure_AesDecryptInit(), XSecure_AesDecryptUpdate(), XSECURE_AESKAT_INVALID_PARAM, XSecure_AesKeyZero(), XSecure_AesUpdateAad(), XSecure_AesWriteKey(), XSecure_ConfigureDmaByteSwap(), XSECURE_ENABLE_BYTE_SWAP, XSecure_GetKatMessage(), XSECURE_KAT_AAD_SIZE_IN_BYTES, XSECURE_KAT_MSG_LEN_IN_BYTES, and XSECURE_KAT_MSG_LEN_IN_WORDS.
| int XSecure_AesEncryptKat | ( | XSecure_Aes * | AesInstance | ) |
This function performs encryption known answer test(KAT) on AES engine.
| AesInstance | Pointer to the XSecure_Aes instance |
Write AES key
Configure AES engine to encryption
Update AAD
Update input and output addresses to AES engine
Update output address to AES engine to store GCM Tag
Validate the encrypted data with expected data provided
Validate the GCM Tag
References XSECURE_AES_KAT_BUSY, XSECURE_AES_KAT_DATA_MISMATCH_ERROR, XSECURE_AES_KAT_ENCRYPT_FINAL_FAILED_ERROR, XSECURE_AES_KAT_ENCRYPT_INIT_FAILED_ERROR, XSECURE_AES_KAT_ENCRYPT_UPDATE_FAILED_ERROR, XSECURE_AES_KAT_UPDATE_AAD_FAILED_ERROR, XSECURE_AES_KAT_WRITE_KEY_FAILED_ERROR, XSECURE_AES_STATE_MISMATCH_ERROR, XSECURE_AES_USER_KEY_7, XSecure_AesEncryptFinal(), XSecure_AesEncryptInit(), XSecure_AesEncryptUpdate(), XSECURE_AESKAT_INVALID_PARAM, XSecure_AesKeyZero(), XSecure_AesUpdateAad(), XSecure_AesWriteKey(), XSecure_ConfigureDmaByteSwap(), XSECURE_ENABLE_BYTE_SWAP, XSecure_GetKatMessage(), XSECURE_KAT_AAD_SIZE_IN_BYTES, XSECURE_KAT_GCM_TAG_MISMATCH_ERROR, XSECURE_KAT_MSG_LEN_IN_BYTES, and XSECURE_KAT_MSG_LEN_IN_WORDS.
| int XSecure_EllipticPwct | ( | XSecure_EllipticCrvTyp | Curvetype, |
| u64 | DAddr, | ||
| XSecure_EllipticKeyAddr * | PubKeyAddr | ||
| ) |
This function performs ECC pairwise consistency test on ECC core.
| Curvetype | Type of ECC curve used for authentication |
| DAddr | Address of ECC private key |
| PubKeyAddr | Address of ECC public key |
Get size as per the curve type
Generate signature for given Hash and curve type
Verify the signature
References XSecure_EllipticHashData::Addr, K, XSecure_EllipticHashData::Len, XSecure_EllipticSignAddr::SignR, XSecure_EllipticSignAddr::SignS, XSECURE_ECC_NIST_P192, XSECURE_ECC_NIST_P224, XSECURE_ECC_NIST_P256, XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, XSECURE_ECC_P192_SIZE_IN_BYTES, XSECURE_ECC_P224_SIZE_IN_BYTES, XSECURE_ECC_P256_SIZE_IN_BYTES, XSECURE_ECC_P384_SIZE_IN_BYTES, XSECURE_ECC_P521_SIZE_IN_BYTES, XSECURE_ELLIPTIC_KAT_64BIT_SIGN_VERIFY_ERROR, XSECURE_ELLIPTIC_KAT_GENERATE_SIGN_64BIT_ERROR, XSECURE_ELLIPTIC_KAT_INVLD_CRV_ERROR, XSecure_EllipticGenerateSignature_64Bit(), XSecure_EllipticVerifySign_64Bit(), and XSecure_GetKatEccEphemeralKey().
| int XSecure_EllipticSignGenerateKat | ( | XSecure_EllipticCrvClass | CrvClass | ) |
This function performs ECC sign generate known answer test(KAT) on ECC core.
| CrvClass | Type of ECC curve class either prime or binary class |
Generates signature for the provided hash and curve type and then perform KAT using that signature.
References D, K, XSecure_EllipticSign::SignR, XSecure_EllipticSign::SignS, XSECURE_ECC_NIST_P384, XSECURE_ECC_P384_SIZE_IN_BYTES, XSECURE_ELLIPTIC_KAT_GENERATE_SIGN_ERROR, XSECURE_ELLIPTIC_KAT_GENERATE_SIGNR_ERROR, XSECURE_ELLIPTIC_KAT_INVLD_CRV_ERROR, XSecure_EllipticGenerateSignature(), XSecure_GetKatEccEphemeralKey(), XSecure_GetKatEccExpSign(), and XSecure_GetKatEccPrivateKey().
| int XSecure_EllipticVerifySignKat | ( | XSecure_EllipticCrvClass | CrvClass | ) |
This function performs ECC sign verify known answer test(KAT) on ECC core.
| CrvClass | Type of ECC curve class either prime or binary curve |
References XSecure_EllipticKey::Qx, XSecure_EllipticKey::Qy, XSecure_EllipticSign::SignR, XSecure_EllipticSign::SignS, XSECURE_ECC_NIST_P384, XSECURE_ELLIPTIC_KAT_INVLD_CRV_ERROR, XSECURE_ELLIPTIC_KAT_KEY_NOTVALID_ERROR, XSECURE_ELLIPTIC_KAT_SIGN_VERIFY_ERROR, XSecure_EllipticValidateKey(), XSecure_EllipticVerifySign(), XSecure_GetKatEccExpSign(), and XSecure_GetKatEccPublicKey().
| u8 * XSecure_GetKatAesKey | ( | void | ) |
| u8 * XSecure_GetKatEccEphemeralKey | ( | XSecure_EllipticCrvTyp | CrvType | ) |
This function returns ECC ephemeral key to perform KAT.
| CrvType | ECC curve type |
References K, XSECURE_ECC_NIST_P192, XSECURE_ECC_NIST_P224, XSECURE_ECC_NIST_P256, XSECURE_ECC_NIST_P384, and XSECURE_ECC_NIST_P521.
Referenced by XSecure_EllipticPwct(), and XSecure_EllipticSignGenerateKat().
| XSecure_EllipticSign * XSecure_GetKatEccExpSign | ( | XSecure_EllipticCrvClass | CrvClass | ) |
This function returns ECC expected signature to perform KAT.
| CrvClass | ECC curve class |
References XSecure_EllipticSign::SignR, XSecure_EllipticSign::SignS, XSECURE_ECC_P384_SIZE_IN_BYTES, and XSECURE_ECC_PRIME.
Referenced by XSecure_EllipticSignGenerateKat(), and XSecure_EllipticVerifySignKat().
| u8 * XSecure_GetKatEccPrivateKey | ( | XSecure_EllipticCrvClass | CrvClass | ) |
This function returns ECC private key to perform KAT.
| CrvClass | ECC curve class |
References D, and XSECURE_ECC_PRIME.
Referenced by XSecure_EllipticSignGenerateKat().
| XSecure_EllipticKey * XSecure_GetKatEccPublicKey | ( | XSecure_EllipticCrvClass | CrvClass | ) |
This function returns ECC public key to perform KAT.
| CrvClass | ECC curve class |
References XSecure_EllipticKey::Qx, XSecure_EllipticKey::Qy, XSECURE_ECC_P384_SIZE_IN_BYTES, and XSECURE_ECC_PRIME.
Referenced by XSecure_EllipticVerifySignKat().
| u8 * XSecure_GetKatMessage | ( | void | ) |
This function returns message to perform KAT.
Referenced by XSecure_AesDecryptKat(), XSecure_AesEncryptKat(), XSecure_HmacKat(), XSecure_RsaPwct(), and XSecure_Sha384Kat().
| u32 * XSecure_GetKatRsaCtData | ( | void | ) |
This function returns cipher text data for RSA KAT.
Referenced by XSecure_RsaPrivateDecryptKat().
| u32 * XSecure_GetKatRsaData | ( | void | ) |
This function returns data for RSA KAT.
Referenced by XSecure_RsaPrivateDecryptKat().
| u32 * XSecure_GetKatRsaModExt | ( | void | ) |
This function returns public pre-calculated exponential (R^2 Mod N) value for RSA KAT.
Referenced by XSecure_RsaPrivateDecryptKat().
| u32 * XSecure_GetKatRsaModulus | ( | void | ) |
This function returns modulus for RSA KAT.
Referenced by XSecure_RsaPrivateDecryptKat().
| u32 * XSecure_GetKatRsaPrivateExp | ( | void | ) |
This function returns private exponent for RSA KAT.
References XSECURE_RSA_2048_SIZE_WORDS.
Referenced by XSecure_RsaPrivateDecryptKat().
| u8 * XSecure_GetKatSha3ExpHash | ( | void | ) |
This function returns expected SHA3 hash for KAT.
| int XSecure_HmacKat | ( | XSecure_Sha * | SecureSha | ) |
This function performs KAT on HMAC (SHA3-384).
| SecureSha3 | Pointer to SHA3 instance |
References XSecure_GetKatAesKey(), XSecure_GetKatMessage(), XSECURE_HMAC_KAT_ERROR, XSECURE_HMAC_KAT_FINAL_ERROR, XSECURE_HMAC_KAT_INIT_ERROR, XSECURE_HMAC_KAT_UPDATE_ERROR, XSecure_HmacFinal(), XSecure_HmacInit(), XSecure_HmacUpdate(), XSECURE_KAT_KEY_SIZE_IN_BYTES, and XSECURE_KAT_MSG_LEN_IN_BYTES.
| int XSecure_HssSha2256Kat | ( | XSecure_Sha * | ShaInstPtr, |
| XPmcDma * | DmaPtr | ||
| ) |
This function performs KAT on HSS SHA2 256.
| ShaInstPtr | Pointer to the XSecure_Sha instance |
| DmaPtr | Pointer to the XPmcDma instance |
References XSECURE_HSS_PUBLIC_KEY_TOTAL_SIZE, XSECURE_HSS_SHA2_256_KAT_ERROR, XSecure_HssFinish(), XSecure_HssInit(), and XSecure_LmsHashMessage().
| int XSecure_HssShake256Kat | ( | XSecure_Sha * | ShaInstPtr, |
| XPmcDma * | DmaPtr | ||
| ) |
This function performs KAT on HSS SHAKE 256.
| ShaInstPtr | Pointer to the XSecure_Sha instance |
| DmaPtr | Pointer to the XPmcDma instance |
References XSECURE_HSS_PUBLIC_KEY_TOTAL_SIZE, XSECURE_HSS_SHAKE_256_KAT_ERROR, XSecure_HssFinish(), XSecure_HssInit(), XSecure_LmsHashMessage(), and XSECURE_SHAKE_256.
| int XSecure_KatIpiHandler | ( | XPlmi_Cmd * | Cmd | ) |
This function calls respective IPI handler based on the API_ID.
| Cmd | is pointer to the command structure |
Call the respective API handler according to API ID
SHA IPI event handling
References XSECURE_API, XSECURE_API_AES_DECRYPT_CM_KAT, XSECURE_API_AES_DECRYPT_KAT, XSECURE_API_AES_ENCRYPT_KAT, XSECURE_API_ELLIPTIC_SIGN_GEN_KAT, XSECURE_API_ELLIPTIC_SIGN_VERIFY_KAT, XSECURE_API_ID_MASK, XSECURE_API_RSA_PRIVATE_DEC_KAT, XSECURE_API_RSA_PUB_ENC_KAT, XSECURE_API_SHA3_KAT, XSecure_EllipticSignGenKat(), XSecure_EllipticSignVerifyKat(), XSecure_GetAesInstance(), XSecure_GetSha3Instance(), XSecure_IpiEventHandling(), XSecure_MakeResFree(), XSecure_Printf, and XSecure_RsaPrivateDecKat().
Referenced by XSecure_KatPlatIpiHandler().
| int XSecure_KatPlatIpiHandler | ( | XPlmi_Cmd * | Cmd | ) |
This function calls respective IPI handler based on the API_ID.
| Cmd | is pointer to the command structure |
SHA IPI event handling
References XSECURE_API, XSECURE_API_ID_MASK, XSECURE_API_SHA2_KAT, XSECURE_API_TRNG_KAT, XSecure_GetSha2Instance(), XSecure_IpiEventHandling(), XSecure_KatIpiHandler(), XSecure_MakeResFree(), and XSecure_TrngKat().
| int XSecure_LmsSha2256Kat | ( | XSecure_Sha * | ShaInstPtr, |
| XPmcDma * | DmaPtr | ||
| ) |
This function performs KAT on LMS - SHA2 256.
| ShaInstPtr | Pointer to the XSecure_Sha instance |
| DmaPtr | Pointer to the XPmcDma instance |
References XSecure_LmsSignatureVerification().
| int XSecure_LmsShake256Kat | ( | XSecure_Sha * | ShaInstPtr, |
| XPmcDma * | DmaPtr | ||
| ) |
This function performs KAT on LMS SHAKE 256.
| ShaInstPtr | Pointer to the XSecure_Sha instance |
| DmaPtr | Pointer to the XPmcDma instance |
References XSecure_LmsSignatureVerification().
| int XSecure_RsaPrivateDecryptKat | ( | void | ) |
This function performs private decrypt KAT on RSA core.
Initialize RSA
Perform RSA private decrypt operation
Validate the decrypted data with the expected data provided
References XSecure_GetKatRsaCtData(), XSecure_GetKatRsaData(), XSecure_GetKatRsaModExt(), XSecure_GetKatRsaModulus(), XSecure_GetKatRsaPrivateExp(), XSECURE_RSA_2048_KEY_SIZE, XSECURE_RSA_2048_SIZE_WORDS, XSECURE_RSA_KAT_DECRYPT_DATA_MISMATCH_ERROR, XSECURE_RSA_KAT_DECRYPT_FAILED_ERROR, XSECURE_RSA_KAT_ENCRYPT_DATA_MISMATCH_ERROR, XSECURE_RSA_KAT_INIT_ERROR, XSecure_RsaInitialize(), and XSecure_RsaPrivateDecrypt().
| int XSecure_RsaPublicEncryptKat | ( | void | ) |
This function performs KAT on RSA core.
Initialize the RSA instance
Perform the public encrypt operation
Validate the encrypted data with the expected data provided
References XSECURE_KAT_RSA_PUB_EXP, XSECURE_RSA_2048_KEY_SIZE, XSECURE_RSA_2048_SIZE_WORDS, XSECURE_RSA_KAT_ENCRYPT_DATA_MISMATCH_ERROR, XSECURE_RSA_KAT_ENCRYPT_FAILED_ERROR, XSECURE_RSA_KAT_INIT_ERROR, XSecure_RsaInitialize(), and XSecure_RsaPublicEncrypt().
| int XSecure_RsaPwct | ( | XSecure_RsaPrivKey * | PrivKey, |
| XSecure_RsaPubKey * | PubKey, | ||
| void * | ShaInstancePtr, | ||
| XSecure_ShaMode | Shatype | ||
| ) |
This function performs pairwise consistency test for generated RSA key pair using OAEP encrypt and decrypt operation.
| PrivKey | Pointer to the XSecure_RsaKey |
| PubKey | Pointer to the XSecure_RsaPubKey |
| ShaInstancePtr | Pointer to the SHA instance used during OAEP encoding for MGF |
| Shatype | is SHA algorithm type used for MGF |
References XSecure_RsaOaepParam::InputDataAddr, XSecure_RsaOaepParam::InputDataSize, XSecure_Rsa::Mod, XSecure_RsaOaepParam::OutputDataAddr, XSecure_RsaOaepParam::OutputDataSize, XSecure_RsaOaepParam::ShaInstancePtr, XSecure_RsaOaepParam::ShaType, XSecure_GetKatMessage(), XSECURE_KAT_MSG_LEN_IN_BYTES, XSECURE_RSA_KEY_GEN_SIZE_IN_BYTES, XSECURE_RSA_PUB_EXP_SIZE, XSECURE_RSA_PWCT_MEM_CMP_FAILED_ERROR, XSecure_RsaInitialize(), XSecure_RsaOaepDecrypt(), and XSecure_RsaOaepEncrypt().
| int XSecure_Sha2256Kat | ( | XSecure_Sha * | SecureSha2 | ) |
This function performs known answer test(KAT) on SHA-2 crypto engine.
| SecureSha2 | Pointer to the XSecure_Sha instance |
References XSecure_SetReset(), and XSECURE_SHA2_256_HASH_LEN.
| int XSecure_Sha384Kat | ( | void | ) |
This function performs KAT on SHA-384.
References XSecure_GetKatMessage(), XSECURE_KAT_MSG_LEN_IN_BYTES, and XSECURE_SHA384_KAT_ERROR.
| int XSecure_Sha3Kat | ( | XSecure_Sha3 * | SecureSha3 | ) |
This function performs known answer test(KAT) on SHA crypto engine.
| SecureSha3 | Pointer to the XSecure_Sha3 instance |
Configure SSS and start SHA-3 engine
Update SHA3 engine with input data
Update SHA3 engine with padded data if required and reads the hash
Validate the generated hash with the provided expected hash
References XSECURE_KAT_MSG_LEN_IN_BYTES, XSecure_SetReset(), XSECURE_SHA3_KAT_BUSY, and XSecure_Sha3Hash().
| int XSecure_ShakeKat | ( | XSecure_Sha * | SecureShake | ) |
This function performs known answer test(KAT) on SHAKE crypto engine.
| SecureShake | Pointer to the XSecure_Sha instance |
References XSecure_SetReset(), XSECURE_SHAKE_256, and XSECURE_SHAKE_256_HASH_LEN.
| int XSecure_UpdateKatStatusIpiHandler | ( | XPlmi_Cmd * | Cmd | ) |
This function calls respective IPI handler based on the API_ID.
| Cmd | is pointer to the command structure |
References XSECURE_API, XSECURE_API_KAT_CLEAR, XSECURE_API_KAT_SET, XSECURE_API_UPDATE_CPM5N_KAT_STATUS, XSECURE_API_UPDATE_DDR_KAT_STATUS, XSECURE_API_UPDATE_HNIC_KAT_STATUS, XSECURE_API_UPDATE_PCIDE_KAT_STATUS, XSECURE_API_UPDATE_PKI_KAT_STATUS, XSECURE_DDR_KAT_MASK_MUL, XSECURE_DDR_MAX_SUPPORT, XSECURE_DEF_KAT_MASK, XSECURE_KAT_HDR_LEN, XSECURE_KAT_MAX_CMD_LEN, XSECURE_MAX_KAT_MASK_LEN, and XSecure_Printf.