![]() |
xilpki
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XPki_Request_Info |
| PKI Request info struct. More... | |
Macros | |
| #define | XPKI_INVALID_PARAM 0x2U |
| Error codes. More... | |
| #define | XPKI_ERROR_UNALIGN_ADDR 0x3U |
| For unaligned address. More... | |
| #define | XPKI_INVALID_QUEUE_ID 0x4U |
| Invalid Queue ID. More... | |
| #define | XPKI_UNSUPPORTED_OPS 0x5U |
| Unsupported operation. More... | |
| #define | XPKI_QUEUE_FULL 0x6U |
| Queue full. More... | |
| #define | XPKI_SLOT_SIZE_ERR 0x7U |
| For incompatiable slot size. More... | |
| #define | XPKI_INVALID_REQ_ID 0x8U |
| Invalid request ID. More... | |
| #define | XPKI_SIGN_COPY_ERR 0x9U |
| Failed to copy the signature into the user pointed buffer. More... | |
| #define | XPKI_PRIV_KEY_COPY_ERR 0xAU |
| Failed to copy the private-key into the user pointed buffer. More... | |
| #define | XPKI_PUB_KEY_COPY_ERR 0xBU |
| Failed to copy the public-key into the user pointed buffer. More... | |
| #define | NIST_P192_LEN_BYTES 24U |
| Bytes. More... | |
| #define | NIST_P384_LEN_BYTES 48U |
| Bytes. More... | |
| #define | NIST_P256_LEN_BYTES 32U |
| Bytes. More... | |
| #define | NIST_P521_LEN_BYTES 66U |
| Bytes. More... | |
Functions | |
| void | XPki_Reset (void) |
| This function reset the PKI module. More... | |
| void | XPki_SoftReset (void) |
| This function performs the PKI module soft reset. More... | |
| int | XPki_Initialize (XPki_Instance *InstancePtr) |
| This function performs the PKI module initialization. More... | |
| int | XPki_EcdsaGenerateKeyPair (XPki_Instance *InstancePtr, XPki_EcdsaCrvType CrvType, XPki_EcdsaKey *PubKey, u8 *PrivKey) |
| This function Generate key pairs for the ECC curves NIST-P192, P256, P384, and P521. More... | |
| int | XPki_EcdsaVerifySignKat (XPki_Instance *InstancePtr, XPki_EcdsaCrvInfo *CrvInfo) |
| This function performs ECC sign verify known answer test(KAT) More... | |
| int | XPki_EcdsaSignGenerateKat (XPki_Instance *InstancePtr, XPki_EcdsaCrvInfo *CrvInfo) |
| This function performs ECC sign generate known answer test(KAT) More... | |
| int | XPki_EcdsaPwct (XPki_Instance *InstancePtr, XPki_EcdsaCrvInfo *CrvInfo, XPki_EcdsaKey *PubKey, u8 *PrivKey) |
| This function performs ECC pairwise consistency test on ECC Curves. More... | |
| int | XPki_TrngGenerateRandomNum (u8 GenSize, u8 *RandBuf) |
| This function is used to generate the Random number for the give size. More... | |
| int | XilPki_EnQueue (XPki_Instance *InstancePtr, XPki_Request_Info *Request_InfoPtr, u32 *RequestID) |
| This function is used to submit the crypto operation to the PKI Queue. More... | |
| int | XilPki_DeQueue (XPki_Instance *InstancePtr, XPki_Request_Info *Request_InfoPtr, u32 RequestID) |
| This function is used to get the crypto operation results from the PKI Queue. More... | |
| void | XPki_Close (void) |
| This function is used to disable access to the PKI Hardware. More... | |
Variables | |
| void * | XPki_Request_Info::PtrInputData |
| Pointer to the input data. More... | |
| void * | XPki_Request_Info::PtrOutputData |
| Pointer to the outout data. More... | |
| Xpki_OpsType | XPki_Request_Info::OpsType |
| ECC operation type. More... | |
| void(* | XPki_Request_Info::XPki_CompletionCallBack )(u32 RequestID, u32 Status) |
| Request completion callback function pointer. More... | |
| #define NIST_P192_LEN_BYTES 24U |
Bytes.
| #define NIST_P256_LEN_BYTES 32U |
Bytes.
| #define NIST_P384_LEN_BYTES 48U |
Bytes.
| #define NIST_P521_LEN_BYTES 66U |
Bytes.
| #define XPKI_ERROR_UNALIGN_ADDR 0x3U |
For unaligned address.
| #define XPKI_INVALID_PARAM 0x2U |
Error codes.
Invalid parameters
Referenced by XilPki_DeQueue(), XilPki_EnQueue(), and XPki_Initialize().
| #define XPKI_INVALID_QUEUE_ID 0x4U |
Invalid Queue ID.
| #define XPKI_INVALID_REQ_ID 0x8U |
Invalid request ID.
| #define XPKI_PRIV_KEY_COPY_ERR 0xAU |
Failed to copy the private-key into the user pointed buffer.
| #define XPKI_PUB_KEY_COPY_ERR 0xBU |
Failed to copy the public-key into the user pointed buffer.
| #define XPKI_QUEUE_FULL 0x6U |
Queue full.
Referenced by XilPki_EnQueue().
| #define XPKI_SIGN_COPY_ERR 0x9U |
Failed to copy the signature into the user pointed buffer.
| #define XPKI_SLOT_SIZE_ERR 0x7U |
For incompatiable slot size.
| #define XPKI_UNSUPPORTED_OPS 0x5U |
Unsupported operation.
Referenced by XilPki_EnQueue().
| enum XPki_EcdsaCrv |
| enum XPki_EcdsaCrvType |
| enum Xpki_OpsType |
PKI ECC supported operation.
| int XilPki_DeQueue | ( | XPki_Instance * | InstancePtr, |
| XPki_Request_Info * | Request_InfoPtr, | ||
| u32 | RequestID | ||
| ) |
This function is used to get the crypto operation results from the PKI Queue.
| InstancePtr | Pointer to the XPki instance |
| Request_InfoPtr | Pointer to the queue info structure |
| RequestID | Unique request ID Filled by the XilPki_EnQueue() API. |
References XPKI_INVALID_PARAM.
Referenced by XPki_EcdsaGenerateKeyPair(), XPki_EcdsaPwct(), and XPki_EcdsaSignGenerateKat().
| int XilPki_EnQueue | ( | XPki_Instance * | InstancePtr, |
| XPki_Request_Info * | Request_InfoPtr, | ||
| u32 * | RequestID | ||
| ) |
This function is used to submit the crypto operation to the PKI Queue.
| InstancePtr | Pointer to the XPki instance |
| Request_InfoPtr | Pointer to the queue info structure |
| RequestID | Pointer to the RequestID. if the request is successfully submitted it filled with unique id |
References XPki_Request_Info::OpsType, PKI_MAX_OPS, XPKI_INVALID_PARAM, XPKI_QUEUE_FULL, and XPKI_UNSUPPORTED_OPS.
Referenced by XPki_EcdsaGenerateKeyPair(), XPki_EcdsaPwct(), XPki_EcdsaSignGenerateKat(), and XPki_EcdsaVerifySignKat().
| void XPki_Close | ( | void | ) |
This function is used to disable access to the PKI Hardware.
| int XPki_EcdsaGenerateKeyPair | ( | XPki_Instance * | InstancePtr, |
| XPki_EcdsaCrvType | CrvType, | ||
| XPki_EcdsaKey * | PubKey, | ||
| u8 * | PrivKey | ||
| ) |
This function Generate key pairs for the ECC curves NIST-P192, P256, P384, and P521.
| InstancePtr | Pointer to the XPki instance |
| CrvType | Type of ECC curve(NIST-P192,P256,P384, and P521) |
| PubKey | Pointer to the pulic-key buffer |
| PrivKey | Pointer to the private-key buffer |
References ECC_NIST_P192, ECC_NIST_P256, ECC_NIST_P384, XPki_Request_Info::OpsType, PKI_ECC_NIST_P192_KEY_PRIV_GEN, PKI_ECC_NIST_P192_KEY_PUB_GEN, PKI_ECC_NIST_P256_KEY_PRIV_GEN, PKI_ECC_NIST_P256_KEY_PUB_GEN, PKI_ECC_NIST_P384_KEY_PRIV_GEN, PKI_ECC_NIST_P384_KEY_PUB_GEN, PKI_ECC_NIST_P521_KEY_PRIV_GEN, PKI_ECC_NIST_P521_KEY_PUB_GEN, XPki_Request_Info::PtrInputData, XPki_Request_Info::PtrOutputData, XilPki_DeQueue(), XilPki_EnQueue(), and XPki_Request_Info::XPki_CompletionCallBack.
| int XPki_EcdsaPwct | ( | XPki_Instance * | InstancePtr, |
| XPki_EcdsaCrvInfo * | CrvInfo, | ||
| XPki_EcdsaKey * | PubKey, | ||
| u8 * | PrivKey | ||
| ) |
This function performs ECC pairwise consistency test on ECC Curves.
| InstancePtr | Pointer to the XPki instance |
| CrvInfo | Type of ECC curve class either prime or binary class and curve type(NIST-P192,P256,P384, and P521) |
| PubKey | ECC public key |
| PrivKey | ECC private key |
References ECC_NIST_P192, ECC_NIST_P256, ECC_NIST_P384, XPki_Request_Info::OpsType, PKI_ECC_NIST_P192_SIGN, PKI_ECC_NIST_P192_SIGN_VERIFY, PKI_ECC_NIST_P256_SIGN, PKI_ECC_NIST_P256_SIGN_VERIFY, PKI_ECC_NIST_P384_SIGN, PKI_ECC_NIST_P384_SIGN_VERIFY, PKI_ECC_NIST_P521_SIGN, PKI_ECC_NIST_P521_SIGN_VERIFY, XPki_Request_Info::PtrInputData, XPki_Request_Info::PtrOutputData, XilPki_DeQueue(), XilPki_EnQueue(), and XPki_Request_Info::XPki_CompletionCallBack.
| int XPki_EcdsaSignGenerateKat | ( | XPki_Instance * | InstancePtr, |
| XPki_EcdsaCrvInfo * | CrvInfo | ||
| ) |
This function performs ECC sign generate known answer test(KAT)
| InstancePtr | Pointer to the XPki instance |
| CrvInfo | Type of ECC curve class either prime or binary class and curve type(NIST-P192,P256,P384, and P521) |
References ECC_NIST_P192, ECC_NIST_P256, ECC_NIST_P384, XPki_Request_Info::OpsType, PKI_ECC_NIST_P192_SIGN, PKI_ECC_NIST_P256_SIGN, PKI_ECC_NIST_P384_SIGN, PKI_ECC_NIST_P521_SIGN, XPki_Request_Info::PtrInputData, XPki_Request_Info::PtrOutputData, XilPki_DeQueue(), XilPki_EnQueue(), and XPki_Request_Info::XPki_CompletionCallBack.
| int XPki_EcdsaVerifySignKat | ( | XPki_Instance * | InstancePtr, |
| XPki_EcdsaCrvInfo * | CrvInfo | ||
| ) |
This function performs ECC sign verify known answer test(KAT)
| InstancePtr | Pointer to the XPki instance |
| CrvInfo | Type of ECC curve class either prime/binary curve and curve type(NIST-P192,P256,P384, and P521) |
References ECC_NIST_P192, ECC_NIST_P256, ECC_NIST_P384, XPki_Request_Info::OpsType, PKI_ECC_NIST_P192_SIGN_VERIFY, PKI_ECC_NIST_P256_SIGN_VERIFY, PKI_ECC_NIST_P384_SIGN_VERIFY, PKI_ECC_NIST_P521_SIGN_VERIFY, XPki_Request_Info::PtrInputData, XilPki_EnQueue(), and XPki_Request_Info::XPki_CompletionCallBack.
| int XPki_Initialize | ( | XPki_Instance * | InstancePtr | ) |
This function performs the PKI module initialization.
| InstancePtr | Pointer to the XPki instance |
References XPKI_INVALID_PARAM, XPki_Reset(), and XPki_SoftReset().
| void XPki_Reset | ( | void | ) |
This function reset the PKI module.
Referenced by XPki_Initialize().
| void XPki_SoftReset | ( | void | ) |
This function performs the PKI module soft reset.
Referenced by XPki_Initialize().
| int XPki_TrngGenerateRandomNum | ( | u8 | GenSize, |
| u8 * | RandBuf | ||
| ) |
This function is used to generate the Random number for the give size.
| GenSize | Required Random Number length in bytes. |
| RandBuf | Pointer to store the Random Number. |
| Xpki_OpsType XPki_Request_Info::OpsType |
ECC operation type.
Referenced by XilPki_EnQueue(), XPki_EcdsaGenerateKeyPair(), XPki_EcdsaPwct(), XPki_EcdsaSignGenerateKat(), and XPki_EcdsaVerifySignKat().
| void* XPki_Request_Info::PtrInputData |
Pointer to the input data.
Referenced by XPki_EcdsaGenerateKeyPair(), XPki_EcdsaPwct(), XPki_EcdsaSignGenerateKat(), and XPki_EcdsaVerifySignKat().
| void* XPki_Request_Info::PtrOutputData |
Pointer to the outout data.
Referenced by XPki_EcdsaGenerateKeyPair(), XPki_EcdsaPwct(), and XPki_EcdsaSignGenerateKat().
| void(* XPki_Request_Info::XPki_CompletionCallBack)(u32 RequestID, u32 Status) |
Request completion callback function pointer.
Referenced by XPki_EcdsaGenerateKeyPair(), XPki_EcdsaPwct(), XPki_EcdsaSignGenerateKat(), and XPki_EcdsaVerifySignKat().