![]() |
xilsecure
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XSecure_ElliptcPrivateKeyGen |
| Ecc private key generation parameters. More... | |
| struct | XSecure_EllipticKey |
| Structure for pointers of public key curve points. More... | |
| struct | XSecure_EllipticSign |
| Structure for pointers of signature components. More... | |
| struct | XSecure_EllipticKeyAddr |
| Structure for addresses of public key curve points. More... | |
| struct | XSecure_EllipticSignAddr |
| Structure for addresses of signature components. More... | |
| struct | XSecure_EllipticHashData |
| Structure for input parameters Hash and Length for Elliptic Sign generation. More... | |
Macros | |
| #define | XSECURE_ECC_TRNG_DF_LENGTH (2U) |
| Default length of xilsecure ecc true random number generator. More... | |
| #define | XSECURE_ECC_TRNG_RANDOM_NUM_GEN_LEN (60U) |
| Length of xilsecure ecc true random number generator. More... | |
| #define | XSECURE_ECDSA_ALGN_CRV_SIZE_IN_BYTES (2U) |
| Align ECDSA curve size in bytes. More... | |
| #define | XSECURE_ECDSA_BITS_IN_BYTES (8U) |
| Bits in bytes. More... | |
| #define | XSECURE_ECC_P384_SIZE_IN_BYTES (48U) |
| Size of NIST P-384 curve in bytes. More... | |
| #define | XSECURE_ECC_P521_SIZE_IN_BYTES (66U) |
| Size of NIST P-521 curve in bytes. More... | |
| #define | XSECURE_ECC_P256_SIZE_IN_BYTES (32U) |
| Size of NIST P-256 curve in bytes. More... | |
| #define | XSECURE_ECC_P192_SIZE_IN_BYTES (24U) |
| Size of NIST P-192 curve in bytes. More... | |
| #define | XSECURE_ECC_P224_SIZE_IN_BYTES (28U) |
| Size of NIST P-224 curve in bytes. More... | |
| #define | XSECURE_ECDSA_P521_ALIGN_BYTES (2U) |
| Size of NIST P-521 curve is 66 bytes. More... | |
| #define | XSECURE_ELLIPTIC_LITTLE_ENDIAN (0U) |
| Operates APIs on little endian format. More... | |
Functions | |
| EcdsaCrvInfo * | XSecure_EllipticGetCrvData (XSecure_EllipticCrvTyp CrvTyp) |
| This function gets the curve related information. More... | |
| int | XSecure_EllipticPrvtKeyGenerate (XSecure_EllipticCrvTyp CrvType, XSecure_ElliptcPrivateKeyGen *PrivateKey) |
| This function generates 48-byte key for P-384 curve using TRNG. More... | |
| int | XSecure_EllipticGenerateEphemeralKey (XSecure_EllipticCrvTyp CrvType, u32 EphemeralKeyAddr) |
| This function generates 48-byte ephemeral key for P-384 curve using TRNG. More... | |
| int | XSecure_EllipticGenEphemeralNSign (XSecure_EllipticCrvTyp CrvType, const u8 *Hash, u32 HashLen, u8 *PrvtKey, u8 *Signature) |
| This function generates the signature on provided hash using ecc. More... | |
| int | XSecure_EcdhGetSecret (XSecure_EllipticCrvTyp CrvType, u64 PrvtKeyAddr, u64 PubKeyAddr, u64 SharedSecretAddr) |
| This is a wrapper function which calls the IPCores API to perform ECDH and generate shared secret. More... | |
| int | XSecure_PlatEllipticIpiHandler (XPlmi_Cmd *Cmd) |
| This function calls respective IPI handler based on the API_ID. More... | |
| int | XSecure_EllipticGenerateKey_64Bit (XSecure_EllipticCrvTyp CrvType, const u64 DAddr, const XSecure_EllipticKeyAddr *KeyAddr) |
| This function generates Public Key for a given curve type using private key where both keys located at 64 bit address. More... | |
| int | XSecure_EllipticGenerateKey (XSecure_EllipticCrvTyp CrvType, const u8 *D, const XSecure_EllipticKey *Key) |
| This function generates Public Key for a given curve type. More... | |
| int | XSecure_EllipticGenerateSignature_64Bit (XSecure_EllipticCrvTyp CrvType, const XSecure_EllipticHashData *HashInfo, const u64 DAddr, const u64 KAddr, const XSecure_EllipticSignAddr *SignAddr) |
| This function generates signature for a given hash and curve type where data is located at 64-bit address. More... | |
| int | XSecure_EllipticGenerateSignature (XSecure_EllipticCrvTyp CrvType, const u8 *Hash, const u32 HashLen, const u8 *D, const u8 *K, const XSecure_EllipticSign *Sign) |
| This function generates signature for a given hash and curve type. More... | |
| int | XSecure_EllipticValidateKey_64Bit (XSecure_EllipticCrvTyp CrvType, const XSecure_EllipticKeyAddr *KeyAddr) |
| This function validates the public key for a given curve type where key is located at 64-bit address. More... | |
| int | XSecure_EllipticValidateKey (XSecure_EllipticCrvTyp CrvType, const XSecure_EllipticKey *Key) |
| This function validates the public key for a given curve type. More... | |
| int | XSecure_EllipticVerifySign_64Bit (XSecure_EllipticCrvTyp CrvType, const XSecure_EllipticHashData *HashInfo, const XSecure_EllipticKeyAddr *KeyAddr, const XSecure_EllipticSignAddr *SignAddr) |
| This function verifies the signature for a given hash, key and curve type where data is located at 64-bit address. More... | |
| int | XSecure_EllipticVerifySign (XSecure_EllipticCrvTyp CrvType, const u8 *Hash, const u32 HashLen, const XSecure_EllipticKey *Key, const XSecure_EllipticSign *Sign) |
| This function verifies the signature for a given hash, key and curve type. More... | |
| void | XSecure_PutData (const u32 Size, u8 *Dst, const u64 SrcAddr) |
| This function copies data from 32/64 bit address to local buffer. More... | |
| void | XSecure_GetData (const u32 Size, const u8 *Src, const u64 DstAddr) |
| This function copies data to 32/64 bit address from local buffer. More... | |
| void | XSecure_FixEndiannessNCopy (const u32 Size, u64 DstAddr, const u64 SrcAddr) |
| This function copies data to destination based on library endianness selection. More... | |
| u32 | XSecure_EllipticGetCrvSize (const XSecure_EllipticCrvTyp CrvType) |
| This function gets curve size in bytes. More... | |
| int | XSecure_EllipticIpiHandler (XPlmi_Cmd *Cmd) |
| This function calls respective IPI handler based on the API_ID. More... | |
| u32 | XSecure_EllipticCrvsGetCount (void) |
| This function calculates the total number of curves supported. More... | |
Supported ECC curves | |
| #define | XSECURE_ECC_SUPPORT_NIST_P384 |
| < Macros to enable /disable support of NIST P-384 and NIST P-521 curve More... | |
| #define XSECURE_ECC_P192_SIZE_IN_BYTES (24U) |
Size of NIST P-192 curve in bytes.
Referenced by XSecure_EllipticPwct().
| #define XSECURE_ECC_P224_SIZE_IN_BYTES (28U) |
Size of NIST P-224 curve in bytes.
Referenced by XSecure_EllipticPwct().
| #define XSECURE_ECC_P256_SIZE_IN_BYTES (32U) |
Size of NIST P-256 curve in bytes.
Referenced by XSecure_EcdhGetSecret(), and XSecure_EllipticPwct().
| #define XSECURE_ECC_P384_SIZE_IN_BYTES (48U) |
Size of NIST P-384 curve in bytes.
Referenced by XSecure_EcdhGetSecret(), XSecure_EllipticGenEphemeralNSign(), XSecure_EllipticGenerateEphemeralKey(), XSecure_EllipticPrvtKeyGenerate(), XSecure_EllipticPwct(), XSecure_EllipticSignGenerateKat(), XSecure_GetKatEccExpSign(), and XSecure_GetKatEccPublicKey().
| #define XSECURE_ECC_P521_SIZE_IN_BYTES (66U) |
Size of NIST P-521 curve in bytes.
Referenced by XSecure_EcdhGetSecret(), XSecure_EllipticGenerateKey_64Bit(), XSecure_EllipticGenerateSignature(), XSecure_EllipticGenerateSignature_64Bit(), XSecure_EllipticPwct(), XSecure_EllipticValidateKey_64Bit(), XSecure_EllipticVerifySign(), and XSecure_EllipticVerifySign_64Bit().
| #define XSECURE_ECC_SUPPORT_NIST_P384 |
< Macros to enable /disable support of NIST P-384 and NIST P-521 curve
| #define XSECURE_ECC_TRNG_DF_LENGTH (2U) |
Default length of xilsecure ecc true random number generator.
Referenced by XSecure_EllipticPrvtKeyGenerate().
| #define XSECURE_ECC_TRNG_RANDOM_NUM_GEN_LEN (60U) |
Length of xilsecure ecc true random number generator.
Referenced by XSecure_EllipticGenerateEphemeralKey(), and XSecure_EllipticPrvtKeyGenerate().
| #define XSECURE_ECDSA_ALGN_CRV_SIZE_IN_BYTES (2U) |
Align ECDSA curve size in bytes.
Referenced by XSecure_EllipticGetCrvSize().
| #define XSECURE_ECDSA_BITS_IN_BYTES (8U) |
Bits in bytes.
Referenced by XSecure_EllipticGetCrvSize().
| #define XSECURE_ECDSA_P521_ALIGN_BYTES (2U) |
Size of NIST P-521 curve is 66 bytes.
This macro is used to make the address word aligned
Referenced by XSecure_EcdhGetSecret(), XSecure_EllipticGenerateKey_64Bit(), XSecure_EllipticGenerateSignature_64Bit(), XSecure_EllipticValidateKey_64Bit(), and XSecure_EllipticVerifySign_64Bit().
| #define XSECURE_ELLIPTIC_LITTLE_ENDIAN (0U) |
Operates APIs on little endian format.
Referenced by XSecure_FixEndiannessNCopy(), XSecure_GetData(), and XSecure_PutData().
| int XSecure_EcdhGetSecret | ( | XSecure_EllipticCrvTyp | CrvType, |
| u64 | PrvtKeyAddr, | ||
| u64 | PubKeyAddr, | ||
| u64 | SharedSecretAddr | ||
| ) |
This is a wrapper function which calls the IPCores API to perform ECDH and generate shared secret.
| CrvType | Curve Type of the keys used to generate shared secret |
| PrvtKeyAddr | 64-bit address of the private key |
| PubKeyAddr | 64-bit address of public key |
| SharedSecretAddr | 64-bit address of buffer for storing shared secret |
Zeroize local copy of key
Zeroize local copy of shared secret
References XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKeyAddr::Qy, XSecure_CryptoCheck(), XSECURE_ECC_NIST_P256, XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, XSECURE_ECC_P256_SIZE_IN_BYTES, XSECURE_ECC_P384_SIZE_IN_BYTES, XSECURE_ECC_P521_SIZE_IN_BYTES, XSecure_ECCRandInit(), XSECURE_ECDSA_P521_ALIGN_BYTES, XSECURE_ELLIPTIC_INVALID_PARAM, XSecure_EllipticGetCrvData(), XSecure_GetData(), XSecure_PutData(), XSecure_ReleaseReset(), and XSecure_SetReset().
| u32 XSecure_EllipticCrvsGetCount | ( | void | ) |
This function calculates the total number of curves supported.
Referenced by XSecure_EllipticGetCrvData().
| int XSecure_EllipticGenEphemeralNSign | ( | XSecure_EllipticCrvTyp | CrvType, |
| const u8 * | Hash, | ||
| u32 | HashLen, | ||
| u8 * | PrvtKey, | ||
| u8 * | Signature | ||
| ) |
This function generates the signature on provided hash using ecc.
| CrvType | specifies the type of the ECC curve. |
| Hash | is the pointer to the hash of the data to be signed |
| HashLen | is the length of the hash. |
| PrvtKey | is the pointer to ECC private key. |
| Signature | is the pointer to the buffer where the ECC signature shall be stored. |
Generate Ephemeral Key using TRNG for generating ECDSA signature
Generate Signature using Private Key to the provided hash
Clear ephemeral key and private key
References XSECURE_ECC_NIST_P521, XSECURE_ECC_P384_SIZE_IN_BYTES, XSECURE_ELLIPTIC_INVALID_PARAM, XSecure_EllipticGenerateEphemeralKey(), and XSecure_EllipticGenerateSignature().
| int XSecure_EllipticGenerateEphemeralKey | ( | XSecure_EllipticCrvTyp | CrvType, |
| u32 | EphemeralKeyAddr | ||
| ) |
This function generates 48-byte ephemeral key for P-384 curve using TRNG.
| CrvType | Specifies the type of the ECC curve. |
| EphemeralKeyAddr | Address of ephemeral key |
References XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, XSECURE_ECC_P384_SIZE_IN_BYTES, XSECURE_ECC_PRVT_KEY_GEN_ERR, XSECURE_ECC_TRNG_RANDOM_NUM_GEN_LEN, XSECURE_ELLIPTIC_INVALID_PARAM, XSecure_EllipticGetCrvData(), XSecure_GetData(), XSecure_GetRandomNum(), XSecure_ReleaseReset(), and XSecure_SetReset().
Referenced by XSecure_EllipticGenEphemeralNSign().
| int XSecure_EllipticGenerateKey | ( | XSecure_EllipticCrvTyp | CrvType, |
| const u8 * | D, | ||
| const XSecure_EllipticKey * | Key | ||
| ) |
This function generates Public Key for a given curve type.
| CrvType | Is a type of elliptic curve |
| D | Pointer to static private key |
| Key | Pointer to public key |
Generate public key with provided private key and curve type
References XSecure_EllipticKey::Qx, XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKey::Qy, XSecure_EllipticKeyAddr::Qy, XSECURE_ECC_NIST_P192, XSECURE_ECC_NIST_P224, XSECURE_ECC_NIST_P256, XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, XSECURE_ELLIPTIC_INVALID_PARAM, and XSecure_EllipticGenerateKey_64Bit().
| int XSecure_EllipticGenerateKey_64Bit | ( | XSecure_EllipticCrvTyp | CrvType, |
| const u64 | DAddr, | ||
| const XSecure_EllipticKeyAddr * | KeyAddr | ||
| ) |
This function generates Public Key for a given curve type using private key where both keys located at 64 bit address.
| CrvType | Is a type of elliptic curve |
| DAddr | Address of static private key |
| KeyAddr | Pointer to public key address |
Generate public key with provided private key and curve type
References D, XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKeyAddr::Qy, XSecure_CryptoCheck(), XSECURE_ECC_NIST_P521, XSECURE_ECC_P521_SIZE_IN_BYTES, XSecure_ECCRandInit(), XSECURE_ECDSA_P521_ALIGN_BYTES, XSECURE_ELLIPTIC_GEN_KEY_ERR, XSECURE_ELLIPTIC_INVALID_PARAM, XSecure_GetData(), XSecure_PutData(), XSecure_ReleaseReset(), and XSecure_SetReset().
Referenced by XSecure_EllipticGenerateKey().
| int XSecure_EllipticGenerateSignature | ( | XSecure_EllipticCrvTyp | CrvType, |
| const u8 * | Hash, | ||
| const u32 | HashLen, | ||
| const u8 * | D, | ||
| const u8 * | K, | ||
| const XSecure_EllipticSign * | Sign | ||
| ) |
This function generates signature for a given hash and curve type.
| CrvType | Type of elliptic curve |
| Hash | Pointer to the hash for which sign has to be generated |
| HashLen | Length of the hash in bytes |
| D | Pointer to the static private key |
| K | Ephemeral private key |
| Sign | Pointer to the signature |
Generate signature with provided hash, private key, ephemeral key and curve type
References XSecure_EllipticHashData::Addr, XSecure_EllipticHashData::Len, XSecure_EllipticSign::SignR, XSecure_EllipticSignAddr::SignR, XSecure_EllipticSign::SignS, 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_P521_SIZE_IN_BYTES, XSECURE_ELLIPTIC_INVALID_PARAM, and XSecure_EllipticGenerateSignature_64Bit().
Referenced by XSecure_EllipticGenEphemeralNSign(), and XSecure_EllipticSignGenerateKat().
| int XSecure_EllipticGenerateSignature_64Bit | ( | XSecure_EllipticCrvTyp | CrvType, |
| const XSecure_EllipticHashData * | HashInfo, | ||
| const u64 | DAddr, | ||
| const u64 | KAddr, | ||
| const XSecure_EllipticSignAddr * | SignAddr | ||
| ) |
This function generates signature for a given hash and curve type where data is located at 64-bit address.
| CrvType | Type of elliptic curve |
| HashInfo | Pointer to Hash Data i.e. Hash Address and length |
| DAddr | Address of the static private key |
| KAddr | Ephemeral private key |
| SignAddr | Pointer to signature address |
Generate signature with provided hash, private key, ephemeral key and curve type.
References XSecure_EllipticHashData::Addr, EcdsaCrvInfo::Bits, D, K, XSecure_EllipticHashData::Len, XSecure_EllipticSignAddr::SignR, XSecure_EllipticSignAddr::SignS, XSecure_CryptoCheck(), XSECURE_ECC_NIST_P521, XSECURE_ECC_P521_SIZE_IN_BYTES, XSecure_ECCRandInit(), XSECURE_ECDSA_P521_ALIGN_BYTES, XSECURE_ELLIPTIC_GEN_SIGN_BAD_RAND_NUM, XSECURE_ELLIPTIC_GEN_SIGN_INCORRECT_HASH_LEN, XSECURE_ELLIPTIC_INVALID_PARAM, XSecure_GetData(), XSecure_PutData(), XSecure_ReleaseReset(), and XSecure_SetReset().
Referenced by XSecure_EllipticGenerateSignature(), and XSecure_EllipticPwct().
| EcdsaCrvInfo * XSecure_EllipticGetCrvData | ( | XSecure_EllipticCrvTyp | CrvTyp | ) |
This function gets the curve related information.
| CrvTyp | Type of the elliptic curve |
Get the curve data
References XSECURE_ECC_NIST_P192, XSECURE_ECC_NIST_P224, XSECURE_ECC_NIST_P256, XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, and XSecure_EllipticCrvsGetCount().
Referenced by XSecure_EcdhGetSecret(), XSecure_EllipticGenerateEphemeralKey(), XSecure_EllipticGetCrvSize(), and XSecure_EllipticPrvtKeyGenerate().
| u32 XSecure_EllipticGetCrvSize | ( | const XSecure_EllipticCrvTyp | CrvType | ) |
This function gets curve size in bytes.
| CrvType | Is a type of elliptic curve |
Get curve size
References EcdsaCrvInfo::Bits, XSECURE_ECDSA_ALGN_CRV_SIZE_IN_BYTES, XSECURE_ECDSA_BITS_IN_BYTES, and XSecure_EllipticGetCrvData().
| int XSecure_EllipticIpiHandler | ( | 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
References XSECURE_API, XSECURE_API_ELLIPTIC_GENERATE_KEY, XSECURE_API_ELLIPTIC_GENERATE_SIGN, XSECURE_API_ELLIPTIC_VALIDATE_KEY, XSECURE_API_ELLIPTIC_VERIFY_SIGN, XSECURE_API_ID_MASK, and XSecure_Printf.
| int XSecure_EllipticPrvtKeyGenerate | ( | XSecure_EllipticCrvTyp | CrvType, |
| XSecure_ElliptcPrivateKeyGen * | PrivateKey | ||
| ) |
This function generates 48-byte key for P-384 curve using TRNG.
| CrvType | specifies the type of the ECC curve. |
| PrivateKey | is the pointer to XSecure_ElliptcPrivateKeyGen |
References XSecure_ElliptcPrivateKeyGen::KeyOutPutAddr, XSecure_ElliptcPrivateKeyGen::PerStringAddr, XSecure_ElliptcPrivateKeyGen::SeedAddr, XSecure_ElliptcPrivateKeyGen::SeedLength, XSECURE_CLEAR_BIT, XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, XSECURE_ECC_P384_SIZE_IN_BYTES, XSECURE_ECC_PRVT_KEY_GEN_ERR, XSECURE_ECC_TRNG_DF_LENGTH, XSECURE_ECC_TRNG_RANDOM_NUM_GEN_LEN, XSECURE_ELLIPTIC_INVALID_PARAM, XSecure_EllipticGetCrvData(), XSecure_GetData(), XSecure_GetTrngInstance(), XSecure_ReleaseReset(), XSecure_SetReset(), XSECURE_TRNG_USER_CFG_SEED_LIFE, and XSecure_UpdateTrngCryptoStatus().
| int XSecure_EllipticValidateKey | ( | XSecure_EllipticCrvTyp | CrvType, |
| const XSecure_EllipticKey * | Key | ||
| ) |
This function validates the public key for a given curve type.
| CrvType | Type of elliptic curve |
| Key | Pointer to the public key |
Validate the public key for a given curve type
References XSecure_EllipticKey::Qx, XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKey::Qy, XSecure_EllipticKeyAddr::Qy, XSECURE_ECC_NIST_P192, XSECURE_ECC_NIST_P224, XSECURE_ECC_NIST_P256, XSECURE_ECC_NIST_P384, XSECURE_ECC_NIST_P521, XSECURE_ELLIPTIC_INVALID_PARAM, and XSecure_EllipticValidateKey_64Bit().
| int XSecure_EllipticValidateKey_64Bit | ( | XSecure_EllipticCrvTyp | CrvType, |
| const XSecure_EllipticKeyAddr * | KeyAddr | ||
| ) |
This function validates the public key for a given curve type where key is located at 64-bit address.
| CrvType | Type of elliptic curve |
| KeyAddr | Pointer to public key address |
Validate the public key for a given curve type
References XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKeyAddr::Qy, XSecure_CryptoCheck(), XSECURE_ECC_NIST_P521, XSECURE_ECC_P521_SIZE_IN_BYTES, XSECURE_ECDSA_P521_ALIGN_BYTES, XSECURE_ELLIPTIC_INVALID_PARAM, XSECURE_ELLIPTIC_KEY_NOT_ON_CRV, XSECURE_ELLIPTIC_KEY_WRONG_ORDER, XSECURE_ELLIPTIC_KEY_ZERO, XSecure_PutData(), XSecure_ReleaseReset(), and XSecure_SetReset().
Referenced by XSecure_EllipticValidateKey().
| int XSecure_EllipticVerifySign | ( | XSecure_EllipticCrvTyp | CrvType, |
| const u8 * | Hash, | ||
| const u32 | HashLen, | ||
| const XSecure_EllipticKey * | Key, | ||
| const XSecure_EllipticSign * | Sign | ||
| ) |
This function verifies the signature for a given hash, key and curve type.
| CrvType | Type of elliptic curve |
| Hash | Pointer to the hash for which sign has to be generated |
| HashLen | Length of hash in bytes |
| Key | Pointer to the public key |
| Sign | Pointer to the signature |
Verify signature with provided hash, public key and curve type
References XSecure_EllipticHashData::Addr, XSecure_EllipticHashData::Len, XSecure_EllipticKey::Qx, XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKey::Qy, XSecure_EllipticKeyAddr::Qy, XSecure_EllipticSign::SignR, XSecure_EllipticSignAddr::SignR, XSecure_EllipticSign::SignS, 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_P521_SIZE_IN_BYTES, XSECURE_ELLIPTIC_INVALID_PARAM, and XSecure_EllipticVerifySign_64Bit().
| int XSecure_EllipticVerifySign_64Bit | ( | XSecure_EllipticCrvTyp | CrvType, |
| const XSecure_EllipticHashData * | HashInfo, | ||
| const XSecure_EllipticKeyAddr * | KeyAddr, | ||
| const XSecure_EllipticSignAddr * | SignAddr | ||
| ) |
This function verifies the signature for a given hash, key and curve type where data is located at 64-bit address.
| CrvType | Type of elliptic curve |
| HashInfo | Pointer to Hash Data i.e. Hash Address and length |
| KeyAddr | Pointer to public key address |
| SignAddr | Pointer to signature address |
Verify signature with provided hash, public key and curve type
References XSecure_EllipticHashData::Addr, EcdsaCrvInfo::Bits, XSecure_EllipticHashData::Len, XSecure_EllipticKeyAddr::Qx, XSecure_EllipticKeyAddr::Qy, XSecure_EllipticSignAddr::SignR, XSecure_EllipticSignAddr::SignS, XSecure_CryptoCheck(), XSECURE_ECC_NIST_P521, XSECURE_ECC_P521_SIZE_IN_BYTES, XSECURE_ECDSA_P521_ALIGN_BYTES, XSECURE_ELLIPTIC_BAD_SIGN, XSECURE_ELLIPTIC_INVALID_PARAM, XSECURE_ELLIPTIC_VER_SIGN_INCORRECT_HASH_LEN, XSECURE_ELLIPTIC_VER_SIGN_R_ORDER_ERROR, XSECURE_ELLIPTIC_VER_SIGN_R_ZERO, XSECURE_ELLIPTIC_VER_SIGN_S_ORDER_ERROR, XSECURE_ELLIPTIC_VER_SIGN_S_ZERO, XSecure_PutData(), XSecure_ReleaseReset(), and XSecure_SetReset().
Referenced by XSecure_EllipticPwct(), and XSecure_EllipticVerifySign().
| void XSecure_FixEndiannessNCopy | ( | const u32 | Size, |
| u64 | DstAddr, | ||
| const u64 | SrcAddr | ||
| ) |
This function copies data to destination based on library endianness selection.
- Changes the endianness when library is operating in little endian
- Copies data without changing any endianness when library is
operating in big endain.
| Size | Length of data in bytes |
| SrcAddr | Address of the source buffer |
| DstAddr | Destination address |
References XSECURE_ELLIPTIC_LITTLE_ENDIAN.
| void XSecure_GetData | ( | const u32 | Size, |
| const u8 * | Src, | ||
| const u64 | DstAddr | ||
| ) |
This function copies data to 32/64 bit address from local buffer.
| Size | Length of data in bytes |
| Src | Pointer to the source buffer |
| DstAddr | Destination address |
Copies data to provided address from local buffer based on the endianness configured
References XSECURE_ELLIPTIC_LITTLE_ENDIAN.
Referenced by XSecure_EcdhGetSecret(), XSecure_EllipticGenerateEphemeralKey(), XSecure_EllipticGenerateKey_64Bit(), XSecure_EllipticGenerateSignature_64Bit(), and XSecure_EllipticPrvtKeyGenerate().
| int XSecure_PlatEllipticIpiHandler | ( | 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_GEN_SHARED_SECRET, XSECURE_API_ID_MASK, XSecure_GenSharedSecret(), and XSecure_Printf.
| void XSecure_PutData | ( | const u32 | Size, |
| u8 * | Dst, | ||
| const u64 | SrcAddr | ||
| ) |
This function copies data from 32/64 bit address to local buffer.
| Size | Length of data in bytes |
| Dst | Pointer to the destination buffer |
| SrcAddr | Source address |
Copies data from provided address to local buffer based on the endianness configured
References XSECURE_ELLIPTIC_LITTLE_ENDIAN.
Referenced by XSecure_EcdhGetSecret(), XSecure_EllipticGenerateKey_64Bit(), XSecure_EllipticGenerateSignature_64Bit(), XSecure_EllipticValidateKey_64Bit(), and XSecure_EllipticVerifySign_64Bit().