logo资料库

stm32f3/4 系列 加密库(cryp lib)参考手册(内有例程).pdf

第1页 / 共131页
第2页 / 共131页
第3页 / 共131页
第4页 / 共131页
第5页 / 共131页
第6页 / 共131页
第7页 / 共131页
第8页 / 共131页
资料共131页,剩余部分请下载后查看
1 Terminology
Figure 1. Block diagram of a common cipher
2 STM32 cryptographic library package presentation
2.1 Architecture
Figure 2. STM32 cryptographic library architecture
2.2 Package organization
Figure 3. STM32 cryptographic library package organization
2.2.1 Libraries
2.2.2 Project
Figure 4. Project folder organization
2.2.3 Utilities
3 DES and Triple-DES algorithms
3.1 Description
3.2 DES library functions
Table 1. DES algorithm functions (DDD = ECB or CBC)
Table 2. DES ECB algorithm functions
Figure 5. DES DDD(*) flowchart
3.2.1 DES_DDD_Encrypt_Init function
Table 3. DES_DDD_Encrypt_Init
Table 4. DESDDDctx_stt data structure
Table 5. SKflags_et mFlags
3.2.2 DES_DDD_Encrypt_Append function
Table 6. DES_DDD_Encrypt_Append
3.2.3 DES_DDD_Encrypt_Finish function
Table 7. DES_DDD_Encrypt_Finish
3.2.4 DES_DDD_Decrypt_Init function
Table 8. DES_DDD_Decrypt_Init
3.2.5 DES_DDD_Decrypt_Append function
Table 9. DES_DDD_Decrypt_Append
3.2.6 DES_DDD_Decrypt_Finish function
Table 10. DES_DDD_Decrypt_Finish
3.3 TDES library functions
Table 11. TDES algorithm functions (TTT = ECB or CBC)
Table 12. TDES ECB algorithm functions
Figure 6. TDES TTT(*) flowchart
3.3.1 TDES_TTT_Encrypt_Init function
Table 13. TDES_TTT_Encrypt_Init
Table 14. TDESTTTctx_stt data structure
3.3.2 TDES_TTT_Encrypt_Append function
Table 15. TDES_TTT_Encrypt_Append
3.3.3 TDES_TTT_Encrypt_Finish function
Table 16. TDES_TTT_Encrypt_Finish
3.3.4 TDES_TTT_Decrypt_Init function
Table 17. TDES_TTT_Decrypt_Init
3.3.5 TDES_TTT_Decrypt_Append function
Table 18. TDES_TTT_Decrypt_Append
3.3.6 TDES_TTT_Decrypt_Finish function
Table 19. TDES_TTT_Decrypt_Finish
3.4 DES with ECB mode example
4 AES algorithm
4.1 Description
4.2 AES library functions (ECB, CBC and CTR)
Table 20. AES algorithm functions (AAA = ECB, CBC or CTR)
Table 21. AES ECB algorithm functions
Figure 7. AES AAA(*) flowchart
4.2.1 AES_AAA_Encrypt_Init function
Table 22. AES_AAA_Encrypt_Init
Table 23. AESAAActx_stt data structure
4.2.2 AES_AAA_Encrypt_Append function
Table 24. AES_AAA_Encrypt_Append
4.2.3 AES_AAA_Encrypt_Finish function
Table 25. AES_AAA_Encrypt_Finish
4.2.4 AES_AAA_Decrypt_Init function
Table 26. AES_AAA_Decrypt_Init
4.2.5 AES_AAA_Decrypt_Append function
Table 27. AES_AAA_Decrypt_Append
4.2.6 AES_AAA_Decrypt_Finish function
Table 28. AES_AAA_Decrypt_Finish
4.3 AES GCM library functions
Table 29. AES GCM algorithm functions
Figure 8. AES GCM flowchart
4.3.1 AES_GCM_Encrypt_Init function
Table 30. AES_GCM_Encrypt_Init
Table 31. AESGCMctx_stt data structure
4.3.2 AES_GCM_Header_Append function
Table 32. AES_GCM_Header_Append
4.3.3 AES_GCM_Encrypt_Append function
Table 33. AES_GCM_Encrypt_Append
4.3.4 AES_GCM_Encrypt_Finish function
Table 34. AES_GCM_Encrypt_Finish
4.3.5 AES_GCM_Decrypt_Init function
Table 35. AES_GCM_Decrypt_Init
4.3.6 AES_GCM_Decrypt_Append function
Table 36. AES_GCM_Decrypt_Append
4.3.7 AES_GCM_Decrypt_Finish function
Table 37. AES_GCM_Decrypt_Finish
4.4 AES KeyWrap library functions
Table 38. AES KeyWrap algorithm functions
Figure 9. AES_KeyWrap flowchart
4.4.1 AES_KeyWrap_Encrypt_Init function
Table 39. AES_KeyWrap_Encrypt_Init
4.4.2 AES_KeyWrap_Encrypt_Append function
Table 40. AES_KeyWrap_Encrypt_Append
4.4.3 AES_KeyWrap_Encrypt_Finish function
Table 41. AES_KeyWrap_Encrypt_Finish
4.4.4 AES_KeyWrap_Decrypt_Init function
Table 42. AES_KeyWrap_Decrypt_Init
4.4.5 AES_KeyWrap_Decrypt_Append function
Table 43. AES_KeyWrap_Decrypt_Append
4.4.6 AES_KeyWrap_Decrypt_Finish function
Table 44. AES_KeyWrap_Decrypt_Finish
4.5 AES CMAC library functions
Table 45. AES CMAC algorithm functions
Figure 10. AES_CMAC flowchart
4.5.1 AES_CMAC_Encrypt_Init function
Table 46. AES_CMAC_Encrypt_Init
Table 47. AESCMACctx_stt data structure
4.5.2 AES_CMAC_Encrypt_Append function
Table 48. AES_CMAC_Encrypt_Append
4.5.3 AES_CMAC_Encrypt_Finish function
Table 49. AES_CMAC_Encrypt_Finish
4.5.4 AES_CMAC_Decrypt_Init function
Table 50. AES_CMAC_Decrypt_Init
4.5.5 AES_CMAC_Decrypt_Append function
Table 51. AES_CMAC_Decrypt_Append
4.5.6 AES_CMAC_Decrypt_Finish function
Table 52. AES_CMAC_Decrypt_Finish
4.6 AES CCM library functions
Table 53. AES CCM algorithm functions
Figure 11. AES_CCM flowchart
4.6.1 AES_CCM_Encrypt_Init function
Table 54. AES_CCM_Encrypt_Init
Table 55. AESCCMctx_stt data structure
4.6.2 AES_CCM_Header_Append function
Table 56. AES_CCM_Header_Append
4.6.3 AES_CCM_Encrypt_Append function
Table 57. AES_CCM_Encrypt_Append
4.6.4 AES_CCM_Encrypt_Finish function
Table 58. AES_CCM_Encrypt_Finish
4.6.5 AES_CCM_Decrypt_Init function
Table 59. AES_CCM_Decrypt_Init
4.6.6 AES_CCM_Decrypt_Append function
Table 60. AES_CCM_Decrypt_Append
4.6.7 AES_CCM_Decrypt_Finish function
Table 61. AES_CCM_Decrypt_Finish
4.7 AES CBC enciphering and deciphering example
5 ARC4 algorithm
5.1 Description
5.2 ARC4 library functions
Table 62. ARC4 algorithm functions
Figure 12. ARC4 flowchart
5.2.1 ARC4_Encrypt_Init function
Table 63. ARC4_Encrypt_Init
5.2.2 ARC4_Encrypt_Append function
Table 64. ARC4_Encrypt_Append
Table 65. ARC4ctx_stt data structure
5.2.3 ARC4_Encrypt_Finish function
Table 66. ARC4_Encrypt_Finish
5.2.4 ARC4_Decrypt_Init function
Table 67. ARC4_Decrypt_Init
5.2.5 ARC4_Decrypt_Append function
Table 68. ARC4_Decrypt_Append
5.2.6 ARC4_Decrypt_Finish function
Table 69. ARC4_Decrypt_Finish
5.3 ARC4 example
6 RNG algorithm
6.1 Description
6.2 RNG library functions
Table 70. RNG algorithm functions
Figure 13. RNG flowchart
6.2.1 RNGreseed function
Table 71. RNGreseed
Table 72. RNGreInput_stt struct reference
Table 73. RNGstate_stt struct reference
6.2.2 RNGinit function
Table 74. RNGinit
Table 75. RNGstate_stt struct reference
6.2.3 RNGfree function
Table 76. RNGfree
6.2.4 RNGgenBytes function
Table 77. RNGgenBytes
6.2.5 RNGgenWords function
Table 78. RNGgenWords
6.3 RNG example
7 HASH algorithm
7.1 Description
7.2 HASH library functions
Table 79. HASH algorithm functions (HHH = MD5, SHA1, SHA224 or SHA256)
Table 80. HASH SHA1 algorithm functions
Figure 14. Hash HHH flowchart
7.2.1 HHH_Init function
Table 81. HHH_Init
Table 82. HASHctx_stt struct reference
Table 83. HashFlags_et mFlags
7.2.2 HHH_Append function
Table 84. HHH_Append
7.2.3 HHH_Finish function
Table 85. HHH_Finish
7.2.4 HMAC_HHH_Init function
Table 86. HMAC_HHH_Init
Table 87. HMACctx_stt struct reference
7.2.5 HMAC_HHH_Append function
Table 88. HMAC_HHH_Append
7.2.6 HMAC_HHH_Finish function
Table 89. HMAC_HHH_Finish
7.3 HASH SHA1 example
8 RSA algorithm
8.1 Description
8.2 RSA library functions
Table 90. RSA algorithm functions
Figure 15. RSA flowchart
8.2.1 RSA_PKCS1v15_Sign function
Table 91. RSA_PKCS1v15_Sign function
Table 92. RSAprivKey_stt data structure
Table 93. membuf_stt data structure
8.2.2 RSA_PKCS1v15_Verify function
Table 94. RSA_PKCS1v15_Verify function
Table 95. RSApubKey_stt data structure
8.3 RSA Signature generation/verification example
9 ECC algorithm
9.1 Description
9.2 ECC library functions
Table 96. ECC algorithm functions
Figure 16. ECC Sign flowchart
Figure 17. ECC Verify flowchart
Figure 18. ECC key generator flowchart
9.2.1 ECCinitEC function
Table 97. ECCinitEC function
Table 98. EC_stt data structure
9.2.2 ECCfreeEC function
Table 99. ECCfreeEC function
9.2.3 ECCinitPoint function
Table 100. ECCinitPoint function
Table 101. ECpoint_stt data structure
9.2.4 ECCfreePoint function
Table 102. ECCfreePoint function
9.2.5 ECCsetPointCoordinate function
Table 103. ECCsetPointCoordinate function
9.2.6 ECCgetPointCoordinate function
Table 104. ECCgetPointCoordinate function
9.2.7 ECCgetPointFlag function
Table 105. ECCgetPointFlag function
9.2.8 ECCsetPointFlag function
Table 106. ECCsetPointFlag function
9.2.9 ECCcopyPoint function
Table 107. ECCcopyPoint function
9.2.10 ECCinitPrivKey function
Table 108. ECCinitPrivKey function
Table 109. ECCprivKey_stt data structure
9.2.11 ECCfreePrivKey function
Table 110. ECCfreePrivKey function
9.2.12 ECCsetPrivKeyValue function
Table 111. ECCsetPrivKeyValue function
9.2.13 ECCgetPrivKeyValue function
Table 112. ECCgetPrivKeyValue function
9.2.14 ECCscalarMul function
Table 113. ECCscalarMul function
9.2.15 ECCsetPointGenerator function
Table 114. ECCsetPointGenerator function
9.2.16 ECDSAinitSign function
Table 115. ECDSAinitSign function
9.2.17 ECDSAfreeSign function
Table 116. ECDSAfreeSign function
9.2.18 ECDSAsetSignature function
Table 117. ECDSAsetSignature function
9.2.19 ECDSAgetSignature function
Table 118. ECDSAgetSignature function
9.2.20 ECDSAverify function
Table 119. ECDSAverify function
9.2.21 ECCvalidatePubKey function
Table 120. ECCvalidatePubKey function
9.2.22 ECCkeyGen function
Table 121. ECCkeyGen function
9.2.23 ECDSAsign function
Table 122. ECDSAsign function
9.3 ECC example
10 STM32 encryption library settings
10.1 Configuration parameters
Table 123. Library build options
10.2 STM32_CryptoLibraryVersion
Table 124. STM32_CryptoLibraryVersion
11 Cryptographic library performance and memory requirements
11.1 Symmetric key algorithms performance results
11.1.1 Software optimized for speed
Table 125. Performance of symmetric key encryption algo. optimized for speed
Table 126. Code size required by symmetric key encryption algo
11.1.2 Hardware enhanced
Table 127. Symmetric key encrypt. algo. performance with HW acceleration
Table 128. Code size for symmetric key encryption algo. with HW acceleration
11.2 Authenticated encryption algorithms performance results
11.2.1 Software optimized for speed
Table 129. Clock cycles for authenticated encryption algorithms optimized for speed
Table 130. Code size for authenticated encryption algorithms optimized for speed
11.2.2 Hardware enhanced
Table 131. Clock cycles for authenticated encryption algorithms & HW acceleration
Table 132. Code size for authenticated encryption algorithm & HW acceleration
11.3 AES key wrap results
11.3.1 Software optimized for speed
Table 133. AES Key Wrap/Unwrap in software
Table 134. Code size for AES key wrap/unwrap in software
11.3.2 Hardware enhanced
Table 135. AES key wrap/unwrap with HW acceleration
Table 136. Code size for AES key wrap/unwrap with HW acceleration
11.4 HASH and HMAC algorithm results
11.4.1 Software optimized for speed
Table 137. Clock cycles for HASH and HMAC algorithms optimized for speed
Table 138. Clock cycles for HASH and HMAC algorithms with SW acceleration
11.4.2 Hardware enhanced
Table 139. Clock cycles required by HASH/HMAC algorithms with HW acceleration
Table 140. Code size required by HASH/HMAC algorithms
11.5 RSA results
Table 141. RSA performance with optimization for speed
Table 142. Code size required by RSA algorithms
11.6 ECC results
Table 143. Number of cycles for ECC operations with for speed optimization
Table 144. Code size for ECC operations with speed optimization
12 Revision history
Table 145. Document revision history
UM0586 User manual STM32 Cryptographic Library Introduction This manual describes the API of the STM32 cryptographic library (STM32-CRYP-LIB) that supports the following cryptographic algorithms:  ECB (Electronic Codebook Mode) CBC (Cipher-Block Chaining) with support for ciphertext stealing CTR (CounTer Mode) CCM (Counter with CBC-MAC) GCM (Galois Counter Mode) CMAC KEY WRAP AES-128, AES-192, AES-256 bits. Supported modes are: – – – – – – – ARC4 DES, TripleDES. Supported modes are: ECB (Electronic Codebook Mode) – – CBC (Cipher-Block Chaining) HASH functions with HMAC support: – MD5 – – – Random engine based on DRBG-AES-128 RSA signature functions with PKCS#1v1.5 ECC (Elliptic Curve Cryptography): – – – Key generation Scalar multiplication (the base for ECDH) ECDSA       SHA-1 SHA-224 SHA-256 These cryptographic algorithms can run in the series STM32F1, STM32 L1, STM32F2, STM32F4, STM32F0 and STM32F3 with hardware enhancement accelerators. September 2013 DocID14989 Rev 4 1/131 www.st.com
Contents Contents UM0586 1 2 3 4 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 STM32 cryptographic library package presentation . . . . . . . . . . . . . . 12 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.1 Package organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2 2.2.1 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.2 2.2.3 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 DES and Triple-DES algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.1 3.2 DES library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 DES_DDD_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.2.1 DES_DDD_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.2 3.2.3 DES_DDD_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 DES_DDD_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.4 3.2.5 DES_DDD_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2.6 DES_DDD_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 TDES library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3.1 TDES_TTT_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 TDES_TTT_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.2 TDES_TTT_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.3 3.3.4 TDES_TTT_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 TDES_TTT_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.3.5 3.3.6 TDES_TTT_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 DES with ECB mode example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.3 3.4 AES algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 AES library functions (ECB, CBC and CTR) . . . . . . . . . . . . . . . . . . . . . . 31 4.2 AES_AAA_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.2.1 4.2.2 AES_AAA_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 35 AES_AAA_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.2.3 4.2.4 AES_AAA_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2/131 DocID14989 Rev 4
UM0586 Contents AES_AAA_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 37 4.2.5 4.2.6 AES_AAA_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 AES GCM library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 AES_GCM_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.1 AES_GCM_Header_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.3.2 4.3.3 AES_GCM_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 43 AES_GCM_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.3.4 AES_GCM_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.3.5 4.3.6 AES_GCM_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.3.7 AES_GCM_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 AES KeyWrap library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 AES_KeyWrap_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.4.1 AES_KeyWrap_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . 50 4.4.2 4.4.3 AES_KeyWrap_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . 50 AES_KeyWrap_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.4.4 AES_KeyWrap_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . 52 4.4.5 4.4.6 AES_KeyWrap_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . 52 AES CMAC library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 AES_CMAC_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4.5.1 4.5.2 AES_CMAC_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . 56 AES_CMAC_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.5.3 AES_CMAC_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.5.4 4.5.5 AES_CMAC_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . 58 4.5.6 AES_CMAC_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . 58 AES CCM library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 4.6.1 AES_CCM_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 AES_CCM_Header_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4.6.2 AES_CCM_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4.6.3 4.6.4 AES_CCM_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 AES_CCM_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.6.5 4.6.6 AES_CCM_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.6.7 AES_CCM_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 AES CBC enciphering and deciphering example . . . . . . . . . . . . . . . . . . . 67 4.3 4.4 4.5 4.6 4.7 5 ARC4 algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 5.1 DocID14989 Rev 4 3/131
Contents UM0586 5.2 5.3 ARC4 library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 ARC4_Encrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 5.2.1 5.2.2 ARC4_Encrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 ARC4_Encrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 5.2.3 ARC4_Decrypt_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.2.4 5.2.5 ARC4_Decrypt_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.2.6 ARC4_Decrypt_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 ARC4 example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 RNG algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 6.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 RNG library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 6.2 RNGreseed function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 6.2.1 6.2.2 RNGinit function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 RNGfree function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 6.2.3 RNGgenBytes function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 6.2.4 6.2.5 RNGgenWords function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 RNG example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 6.3 HASH algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.1 HASH library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 7.2 7.2.1 HHH_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 HHH_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 7.2.2 HHH_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 7.2.3 7.2.4 HMAC_HHH_Init function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 HMAC_HHH_Append function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 7.2.5 7.2.6 HMAC_HHH_Finish function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 HASH SHA1 example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 7.3 RSA algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 RSA library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.2 8.2.1 RSA_PKCS1v15_Sign function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 8.2.2 RSA_PKCS1v15_Verify function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 RSA Signature generation/verification example . . . . . . . . . . . . . . . . . . . . 95 8.3 6 7 8 4/131 DocID14989 Rev 4
UM0586 9 10 11 Contents ECC algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 9.1 9.2 ECC library functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 ECCinitEC function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 9.2.1 9.2.2 ECCfreeEC function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 ECCinitPoint function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 9.2.3 ECCfreePoint function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 9.2.4 9.2.5 ECCsetPointCoordinate function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 ECCgetPointCoordinate function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 9.2.6 ECCgetPointFlag function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 9.2.7 9.2.8 ECCsetPointFlag function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 ECCcopyPoint function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.2.9 ECCinitPrivKey function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.2.10 9.2.11 ECCfreePrivKey function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 ECCsetPrivKeyValue function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 9.2.12 ECCgetPrivKeyValue function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 9.2.13 9.2.14 ECCscalarMul function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 ECCsetPointGenerator function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.2.15 ECDSAinitSign function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 9.2.16 9.2.17 ECDSAfreeSign function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 ECDSAsetSignature function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9.2.18 ECDSAgetSignature function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 9.2.19 9.2.20 ECDSAverify function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 ECCvalidatePubKey function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 9.2.21 ECCkeyGen function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 9.2.22 9.2.23 ECDSAsign function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 ECC example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 9.3 STM32 encryption library settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 10.1 Configuration parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 10.2 STM32_CryptoLibraryVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 Cryptographic library performance and memory requirements . . . . 118 Symmetric key algorithms performance results . . . . . . . . . . . . . . . . . . . .118 11.1 11.1.1 Software optimized for speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Hardware enhanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 11.1.2 DocID14989 Rev 4 5/131
Contents UM0586 11.2 11.3 Authenticated encryption algorithms performance results . . . . . . . . . . . 123 11.2.1 Software optimized for speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 11.2.2 Hardware enhanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 AES key wrap results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Software optimized for speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 11.3.1 11.3.2 Hardware enhanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 11.4 HASH and HMAC algorithm results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Software optimized for speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Hardware enhanced . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 11.5 RSA results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 11.6 ECC results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 11.4.1 11.4.2 12 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 6/131 DocID14989 Rev 4
UM0586 List of tables List of tables Table 1. Table 2. Table 3. Table 4. Table 5. Table 6. Table 7. Table 8. Table 9. Table 10. Table 11. Table 12. Table 13. Table 14. Table 15. Table 16. Table 17. Table 18. Table 19. Table 20. Table 21. Table 22. Table 23. Table 24. Table 25. Table 26. Table 27. Table 28. Table 29. Table 30. Table 31. Table 32. Table 33. Table 34. Table 35. Table 36. Table 37. Table 38. Table 39. Table 40. Table 41. Table 42. Table 43. Table 44. Table 45. Table 46. Table 47. Table 48. DES algorithm functions (DDD = ECB or CBC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 DES ECB algorithm functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 DES_DDD_Encrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 DESDDDctx_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 SKflags_et mFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 DES_DDD_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 DES_DDD_Encrypt_Finish. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 DES_DDD_Decrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 DES_DDD_Decrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 DES_DDD_Decrypt_Finish. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 TDES algorithm functions (TTT = ECB or CBC). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 TDES ECB algorithm functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 TDES_TTT_Encrypt_Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 TDESTTTctx_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 TDES_TTT_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 TDES_TTT_Encrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 TDES_TTT_Decrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 TDES_TTT_Decrypt_Append. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 TDES_TTT_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 AES algorithm functions (AAA = ECB, CBC or CTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 AES ECB algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 AES_AAA_Encrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 AESAAActx_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 AES_AAA_Encrypt_Append. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 AES_AAA_Encrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 AES_AAA_Decrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 AES_AAA_Decrypt_Append. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 AES_AAA_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 AES GCM algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 AES_GCM_Encrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 AESGCMctx_stt data structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 AES_GCM_Header_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 AES_GCM_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 AES_GCM_Encrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 AES_GCM_Decrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 AES_GCM_Decrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 AES_GCM_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 AES KeyWrap algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 AES_KeyWrap_Encrypt_Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 AES_KeyWrap_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 AES_KeyWrap_Encrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 AES_KeyWrap_Decrypt_Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 AES_KeyWrap_Decrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 AES_KeyWrap_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 AES CMAC algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 AES_CMAC_Encrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 AESCMACctx_stt data structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 AES_CMAC_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 DocID14989 Rev 4 7/131
List of tables UM0586 AES_CMAC_Encrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Table 49. AES_CMAC_Decrypt_Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Table 50. AES_CMAC_Decrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Table 51. AES_CMAC_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Table 52. AES CCM algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Table 53. AES_CCM_Encrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Table 54. AESCCMctx_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Table 55. AES_CCM_Header_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Table 56. AES_CCM_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Table 57. AES_CCM_Encrypt_Finish. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Table 58. AES_CCM_Decrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Table 59. AES_CCM_Decrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Table 60. AES_CCM_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Table 61. ARC4 algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Table 62. ARC4_Encrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Table 63. ARC4_Encrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Table 64. ARC4ctx_stt data structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Table 65. ARC4_Encrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Table 66. ARC4_Decrypt_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Table 67. ARC4_Decrypt_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Table 68. ARC4_Decrypt_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Table 69. RNG algorithm functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Table 70. RNGreseed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Table 71. RNGreInput_stt struct reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Table 72. RNGstate_stt struct reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Table 73. RNGinit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Table 74. RNGstate_stt struct reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Table 75. RNGfree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Table 76. RNGgenBytes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Table 77. RNGgenWords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Table 78. HASH algorithm functions (HHH = MD5, SHA1, SHA224 or SHA256) . . . . . . . . . . . . . . . 82 Table 79. HASH SHA1 algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Table 80. HHH_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Table 81. HASHctx_stt struct reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Table 82. HashFlags_et mFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Table 83. HHH_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Table 84. HHH_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Table 85. HMAC_HHH_Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Table 86. HMACctx_stt struct reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Table 87. HMAC_HHH_Append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Table 88. HMAC_HHH_Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Table 89. RSA algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Table 90. RSA_PKCS1v15_Sign function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Table 91. Table 92. RSAprivKey_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Table 93. membuf_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Table 94. RSA_PKCS1v15_Verify function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 RSApubKey_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Table 95. ECC algorithm functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Table 96. ECCinitEC function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Table 97. Table 98. EC_stt data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Table 99. ECCfreeEC function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Table 100. ECCinitPoint function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 8/131 DocID14989 Rev 4
分享到:
收藏