![]() |
xilsecure
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XSecure_Rsa |
| The RSA driver instance data structure. More... | |
Macros | |
| #define | XSECURE_RSA_FAILED 0x1U |
| RSA Failed Error Code. More... | |
| #define | XSECURE_RSA_DATA_VALUE_ERROR 0x2U |
| for RSA private decryption data should be lesser than modulus More... | |
| #define | XSECURE_RSA_ZEROIZE_ERROR 0x80U |
| for RSA zeroization Error More... | |
| #define | XSECURE_HASH_TYPE_SHA3 (48U) |
| SHA-3 hash size. More... | |
| #define | XSECURE_FSBL_SIG_SIZE (512U) |
| FSBL signature size. More... | |
| #define | XSECURE_RSA_MAX_BUFF (6U) |
| RSA RAM Write Buffers. More... | |
| #define | XSECURE_RSA_MAX_RD_WR_CNT (22U) |
| No of writes or reads to RSA RAM Buffers. More... | |
| #define | XSECURE_RSA_BYTE_MASK (0XFFU) |
| RSA BYTE MASK. More... | |
| #define | XSECURE_RSA_BYTE_SHIFT (8U) |
| RSA BYTE. More... | |
| #define | XSECURE_RSA_HWORD_SHIFT (16U) |
| RSA HWORD. More... | |
| #define | XSECURE_RSA_SWORD_SHIFT (24U) |
| RSA SWORD. More... | |
| #define | XSECURE_RSA_512_KEY_SIZE (512U/8U) |
| RSA 512 key size. More... | |
| #define | XSECURE_RSA_576_KEY_SIZE (576U/8U) |
| RSA 576 key size. More... | |
| #define | XSECURE_RSA_704_KEY_SIZE (704U/8U) |
| RSA 704 key size. More... | |
| #define | XSECURE_RSA_768_KEY_SIZE (768U/8U) |
| RSA 768 key size. More... | |
| #define | XSECURE_RSA_992_KEY_SIZE (992U/8U) |
| RSA 992 key size. More... | |
| #define | XSECURE_RSA_1024_KEY_SIZE (1024U/8U) |
| RSA 1024 key size. More... | |
| #define | XSECURE_RSA_1152_KEY_SIZE (1152U/8U) |
| RSA 1152 key size. More... | |
| #define | XSECURE_RSA_1408_KEY_SIZE (1408U/8U) |
| RSA 1408 key size. More... | |
| #define | XSECURE_RSA_1536_KEY_SIZE (1536U/8U) |
| RSA 1536 key size. More... | |
| #define | XSECURE_RSA_1984_KEY_SIZE (1984U/8U) |
| RSA 1984 key size. More... | |
| #define | XSECURE_RSA_2048_KEY_SIZE (2048U/8U) |
| RSA 2048 key size. More... | |
| #define | XSECURE_RSA_3072_KEY_SIZE (3072U/8U) |
| RSA 3072 key size. More... | |
| #define | XSECURE_RSA_4096_KEY_SIZE (4096U/8U) |
| RSA 4096 key size. More... | |
| #define | XSECURE_RSA_512_SIZE_WORDS (16) |
| RSA 512 Size in words. More... | |
| #define | XSECURE_RSA_576_SIZE_WORDS (18) |
| RSA 576 Size in words. More... | |
| #define | XSECURE_RSA_704_SIZE_WORDS (22) |
| RSA 704 Size in words. More... | |
| #define | XSECURE_RSA_768_SIZE_WORDS (24) |
| RSA 768 Size in words. More... | |
| #define | XSECURE_RSA_992_SIZE_WORDS (31) |
| RSA 992 Size in words. More... | |
| #define | XSECURE_RSA_1024_SIZE_WORDS (32) |
| RSA 1024 Size in words. More... | |
| #define | XSECURE_RSA_1152_SIZE_WORDS (36) |
| RSA 1152 Size in words. More... | |
| #define | XSECURE_RSA_1408_SIZE_WORDS (44) |
| RSA 1408 Size in words. More... | |
| #define | XSECURE_RSA_1536_SIZE_WORDS (48) |
| RSA 1536 Size in words. More... | |
| #define | XSECURE_RSA_1984_SIZE_WORDS (62) |
| RSA 1984 Size in words. More... | |
| #define | XSECURE_RSA_2048_SIZE_WORDS (64) |
| RSA 2048 Size in words. More... | |
| #define | XSECURE_RSA_3072_SIZE_WORDS (96) |
| RSA 3072 Size in words. More... | |
| #define | XSECURE_RSA_4096_SIZE_WORDS (128U) |
| RSA 4096 Size in words. More... | |
| #define | XSECURE_CSU_RSA_RAM_EXPO (0U) |
| bit for RSA RAM Exponent More... | |
| #define | XSECURE_CSU_RSA_RAM_MOD (1U) |
| bit for RSA RAM modulus More... | |
| #define | XSECURE_CSU_RSA_RAM_DIGEST (2U) |
| bit for RSA RAM Digest More... | |
| #define | XSECURE_CSU_RSA_RAM_SPAD (3U) |
| bit for RSA RAM SPAD More... | |
| #define | XSECURE_CSU_RSA_RAM_RES_Y (4U) |
| bit for RSA RAM Result(Y) More... | |
| #define | XSECURE_CSU_RSA_RAM_RES_Q (5U) |
| bit for RSA RAM Result(Q) More... | |
| #define | XSECURE_RSA_SIGN_ENC 0U |
| RSA encryption flag. More... | |
| #define | XSECURE_RSA_SIGN_DEC 1U |
| RSA decryption flag. More... | |
Enumerations | |
| enum | XSecure_RsaState { XSECURE_RSA_UNINITIALIZED = 0x0, XSECURE_RSA_INITIALIZED, XSECURE_RSA_UNINITIALIZED = 0, XSECURE_RSA_INITIALIZED } |
Functions | |
| u32 | XSecure_RsaCfgInitialize (XSecure_Rsa *InstancePtr) |
| This function stores the base address of RSA core registers. More... | |
| u32 | XSecure_RsaOperation (XSecure_Rsa *InstancePtr, u8 *Input, u8 *Result, u8 EncDecFlag, u32 Size) |
| This function handles the all RSA operations with provided inputs. More... | |
| u8 * | XSecure_RsaGetTPadding (void) |
| This function returns PKCS padding as per the silicon version. More... | |
Control Register | |
The Control register (CR) controls the major functions of the device. It is used to set the function to be implemented by the RSA device in the next iteration. Control Register Bit Definition | |
| #define | XSECURE_CSU_RSA_CONTROL_512 (0x00U) |
| RSA 512 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_576 (0x10U) |
| RSA 576 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_704 (0x20U) |
| RSA 704 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_768 (0x30U) |
| RSA 768 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_992 (0x40U) |
| RSA 992 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_1024 (0x50U) |
| RSA 1024 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_1152 (0x60U) |
| RSA 1152 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_1408 (0x70U) |
| RSA 1408 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_1536 (0x80U) |
| RSA 1536 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_1984 (0x90U) |
| RSA 1984 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_2048 (0xA0U) |
| RSA 2048 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_3072 (0xB0U) |
| RSA 3072 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_4096 (0xC0U) |
| RSA 4096 Length Code. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_DCA (0x08U) |
| Abort Operation. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_NOP (0x00U) |
| No Operation. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_EXP (0x01U) |
| Exponentiation Opcode. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_EXP_PRE (0x05U) |
| Expo. More... | |
| #define | XSECURE_CSU_RSA_CONTROL_MASK |
RSA status Register | |
The Status Register(SR) indicates the current state of RSA device. Status Register Bit Definition | |
| #define | XSECURE_CSU_RSA_STATUS_DONE (0x1U) |
| Operation Done. More... | |
| #define | XSECURE_CSU_RSA_STATUS_BUSY (0x2U) |
| RSA busy. More... | |
| #define | XSECURE_CSU_RSA_STATUS_ERROR (0x4U) |
| Error. More... | |
| #define | XSECURE_CSU_RSA_STATUS_PROG_CNT (0xF8U) |
| Progress Counter. More... | |
| #define XSECURE_CSU_RSA_CONTROL_1024 (0x50U) |
RSA 1024 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_1152 (0x60U) |
RSA 1152 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_1408 (0x70U) |
RSA 1408 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_1536 (0x80U) |
RSA 1536 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_1984 (0x90U) |
RSA 1984 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_2048 (0xA0U) |
RSA 2048 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_3072 (0xB0U) |
RSA 3072 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_4096 (0xC0U) |
RSA 4096 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_512 (0x00U) |
RSA 512 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_576 (0x10U) |
RSA 576 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_704 (0x20U) |
RSA 704 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_768 (0x30U) |
RSA 768 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_992 (0x40U) |
RSA 992 Length Code.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_DCA (0x08U) |
Abort Operation.
| #define XSECURE_CSU_RSA_CONTROL_EXP (0x01U) |
Exponentiation Opcode.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_CONTROL_EXP_PRE (0x05U) |
| #define XSECURE_CSU_RSA_CONTROL_NOP (0x00U) |
No Operation.
| #define XSECURE_CSU_RSA_RAM_DIGEST (2U) |
bit for RSA RAM Digest
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_RAM_EXPO (0U) |
bit for RSA RAM Exponent
| #define XSECURE_CSU_RSA_RAM_MOD (1U) |
bit for RSA RAM modulus
| #define XSECURE_CSU_RSA_RAM_RES_Q (5U) |
bit for RSA RAM Result(Q)
| #define XSECURE_CSU_RSA_RAM_RES_Y (4U) |
bit for RSA RAM Result(Y)
| #define XSECURE_CSU_RSA_RAM_SPAD (3U) |
bit for RSA RAM SPAD
| #define XSECURE_CSU_RSA_STATUS_BUSY (0x2U) |
RSA busy.
| #define XSECURE_CSU_RSA_STATUS_DONE (0x1U) |
Operation Done.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_STATUS_ERROR (0x4U) |
Error.
Referenced by XSecure_RsaOperation().
| #define XSECURE_CSU_RSA_STATUS_PROG_CNT (0xF8U) |
Progress Counter.
| #define XSECURE_FSBL_SIG_SIZE (512U) |
FSBL signature size.
| #define XSECURE_HASH_TYPE_SHA3 (48U) |
SHA-3 hash size.
| #define XSECURE_RSA_1024_KEY_SIZE (1024U/8U) |
RSA 1024 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1024_SIZE_WORDS (32) |
RSA 1024 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1152_KEY_SIZE (1152U/8U) |
RSA 1152 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1152_SIZE_WORDS (36) |
RSA 1152 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1408_KEY_SIZE (1408U/8U) |
RSA 1408 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1408_SIZE_WORDS (44) |
RSA 1408 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1536_KEY_SIZE (1536U/8U) |
RSA 1536 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1536_SIZE_WORDS (48) |
RSA 1536 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1984_KEY_SIZE (1984U/8U) |
RSA 1984 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_1984_SIZE_WORDS (62) |
RSA 1984 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_2048_KEY_SIZE (2048U/8U) |
RSA 2048 key size.
| #define XSECURE_RSA_2048_SIZE_WORDS (64) |
RSA 2048 Size in words.
| #define XSECURE_RSA_3072_KEY_SIZE (3072U/8U) |
RSA 3072 key size.
| #define XSECURE_RSA_3072_SIZE_WORDS (96) |
RSA 3072 Size in words.
| #define XSECURE_RSA_4096_KEY_SIZE (4096U/8U) |
RSA 4096 key size.
| #define XSECURE_RSA_4096_SIZE_WORDS (128U) |
RSA 4096 Size in words.
| #define XSECURE_RSA_512_KEY_SIZE (512U/8U) |
RSA 512 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_512_SIZE_WORDS (16) |
RSA 512 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_576_KEY_SIZE (576U/8U) |
RSA 576 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_576_SIZE_WORDS (18) |
RSA 576 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_704_KEY_SIZE (704U/8U) |
RSA 704 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_704_SIZE_WORDS (22) |
RSA 704 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_768_KEY_SIZE (768U/8U) |
RSA 768 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_768_SIZE_WORDS (24) |
RSA 768 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_992_KEY_SIZE (992U/8U) |
RSA 992 key size.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_992_SIZE_WORDS (31) |
RSA 992 Size in words.
Referenced by XSecure_RsaOperation().
| #define XSECURE_RSA_BYTE_MASK (0XFFU) |
RSA BYTE MASK.
| #define XSECURE_RSA_BYTE_SHIFT (8U) |
RSA BYTE.
| #define XSECURE_RSA_DATA_VALUE_ERROR 0x2U |
for RSA private decryption data should be lesser than modulus
| #define XSECURE_RSA_FAILED 0x1U |
RSA Failed Error Code.
| #define XSECURE_RSA_HWORD_SHIFT (16U) |
RSA HWORD.
| #define XSECURE_RSA_MAX_BUFF (6U) |
RSA RAM Write Buffers.
| #define XSECURE_RSA_MAX_RD_WR_CNT (22U) |
No of writes or reads to RSA RAM Buffers.
| #define XSECURE_RSA_SIGN_DEC 1U |
RSA decryption flag.
| #define XSECURE_RSA_SIGN_ENC 0U |
RSA encryption flag.
| #define XSECURE_RSA_SWORD_SHIFT (24U) |
RSA SWORD.
| #define XSECURE_RSA_ZEROIZE_ERROR 0x80U |
for RSA zeroization Error
| enum XSecure_RsaState |
| u32 XSecure_RsaCfgInitialize | ( | XSecure_Rsa * | InstancePtr | ) |
This function stores the base address of RSA core registers.
| InstancePtr | Pointer to the XSecure_Rsa instance |
| InstancePtr | Pointer to the XSecure_Rsa instance. |
Validate the input arguments
Set RSA in use flag
References XSecure_Rsa::BaseAddress, XSecure_CryptoCheck(), XSECURE_CSU_RSA_BASE, and XSECURE_RSA_INVALID_PARAM.
Referenced by XSecure_RsaInitialize_64Bit().
| u8* XSecure_RsaGetTPadding | ( | void | ) |
This function returns PKCS padding as per the silicon version.
Referenced by XSecure_RsaSignVerification_64Bit().
| u32 XSecure_RsaOperation | ( | XSecure_Rsa * | InstancePtr, |
| u8 * | Input, | ||
| u8 * | Result, | ||
| u8 | EncDecFlag, | ||
| u32 | Size | ||
| ) |
This function handles the all RSA operations with provided inputs.
| InstancePtr | Pointer to the XSecure_Rsa instance. |
| Input | Pointer to the buffer which contains the input data to be decrypted. |
| Result | Pointer to the buffer where resultant decrypted data to be stored. |
| EncDecFlag | Indicates encryption or decryption |
| Size | Indicates key size |
References XSecure_Rsa::BaseAddress, XSecure_Rsa::EncDec, XSecure_Rsa::ModExt, XSecure_Rsa::SizeInWords, XSECURE_CSU_RSA_CONTROL_1024, XSECURE_CSU_RSA_CONTROL_1152, XSECURE_CSU_RSA_CONTROL_1408, XSECURE_CSU_RSA_CONTROL_1536, XSECURE_CSU_RSA_CONTROL_1984, XSECURE_CSU_RSA_CONTROL_2048, XSECURE_CSU_RSA_CONTROL_3072, XSECURE_CSU_RSA_CONTROL_4096, XSECURE_CSU_RSA_CONTROL_512, XSECURE_CSU_RSA_CONTROL_576, XSECURE_CSU_RSA_CONTROL_704, XSECURE_CSU_RSA_CONTROL_768, XSECURE_CSU_RSA_CONTROL_992, XSECURE_CSU_RSA_CONTROL_EXP, XSECURE_CSU_RSA_CONTROL_EXP_PRE, XSECURE_CSU_RSA_CONTROL_OFFSET, XSECURE_CSU_RSA_RAM_DIGEST, XSECURE_CSU_RSA_STATUS_DONE, XSECURE_CSU_RSA_STATUS_ERROR, XSECURE_CSU_RSA_STATUS_OFFSET, XSECURE_RSA_1024_KEY_SIZE, XSECURE_RSA_1024_SIZE_WORDS, XSECURE_RSA_1152_KEY_SIZE, XSECURE_RSA_1152_SIZE_WORDS, XSECURE_RSA_1408_KEY_SIZE, XSECURE_RSA_1408_SIZE_WORDS, XSECURE_RSA_1536_KEY_SIZE, XSECURE_RSA_1536_SIZE_WORDS, XSECURE_RSA_1984_KEY_SIZE, XSECURE_RSA_1984_SIZE_WORDS, XSECURE_RSA_2048_KEY_SIZE, XSECURE_RSA_2048_SIZE_WORDS, XSECURE_RSA_3072_KEY_SIZE, XSECURE_RSA_3072_SIZE_WORDS, XSECURE_RSA_4096_KEY_SIZE, XSECURE_RSA_4096_SIZE_WORDS, XSECURE_RSA_512_KEY_SIZE, XSECURE_RSA_512_SIZE_WORDS, XSECURE_RSA_576_KEY_SIZE, XSECURE_RSA_576_SIZE_WORDS, XSECURE_RSA_704_KEY_SIZE, XSECURE_RSA_704_SIZE_WORDS, XSECURE_RSA_768_KEY_SIZE, XSECURE_RSA_768_SIZE_WORDS, XSECURE_RSA_992_KEY_SIZE, XSECURE_RSA_992_SIZE_WORDS, XSECURE_RSA_SIGN_DEC, XSECURE_RSA_SIGN_ENC, XSecure_RsaZeroize(), XSECURE_TIMEOUT_MAX, and XSECURE_WORD_SIZE.