Kconfig 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. menuconfig RT_USING_HWCRYPTO
  2. bool "Using Hardware Crypto drivers"
  3. default n
  4. help
  5. Enable the hardware crypto abstraction layer so SoC accelerators can
  6. register cipher/hash/RNG engines and high-level components can route
  7. requests through them. Select this when your platform provides AES,
  8. HASH, RNG or big-number engines and you want to offload work from the
  9. CPU; disable it to keep the image lean on chips without crypto IP.
  10. if RT_USING_HWCRYPTO
  11. config RT_HWCRYPTO_DEFAULT_NAME
  12. string "Hardware crypto device name"
  13. default "hwcryto"
  14. help
  15. Default device name announced via `rt_hwcrypto_dev_register`. You
  16. may override it if multiple accelerators coexist or you need a
  17. deterministic node name for auto-binding.
  18. config RT_HWCRYPTO_IV_MAX_SIZE
  19. int "IV max size"
  20. default "16"
  21. help
  22. Maximum initialization-vector length (bytes) allocated in the
  23. generic session context. Set this to match the longest IV your
  24. hardware supports (for example 16 for AES) to avoid truncation.
  25. config RT_HWCRYPTO_KEYBIT_MAX_SIZE
  26. int "Key max bit length"
  27. default 256
  28. help
  29. Upper bound on key size (bits) that the framework will accept.
  30. Increase this if your accelerator supports longer RSA/ECC keys.
  31. config RT_HWCRYPTO_USING_GCM
  32. bool "Using Hardware GCM"
  33. default n
  34. help
  35. Advertise AES-GCM authenticated encryption support. Only enable if
  36. the hardware can perform GHASH + counter mode internally.
  37. config RT_HWCRYPTO_USING_AES
  38. bool "Using Hardware AES"
  39. default n
  40. help
  41. Enable AES cipher acceleration (key setup + block operations). You
  42. should only turn this on when the SoC AES engine is initialized
  43. elsewhere in BSP code.
  44. if RT_HWCRYPTO_USING_AES
  45. config RT_HWCRYPTO_USING_AES_ECB
  46. bool "Using Hardware AES ECB mode"
  47. default y
  48. help
  49. Allow AES ECB operations. Keep it on unless your hardware
  50. lacks ECB (rare) or you want to trim dead code.
  51. config RT_HWCRYPTO_USING_AES_CBC
  52. bool "Using Hardware AES CBC mode"
  53. default n
  54. help
  55. Enable AES CBC mode helpers when the peripheral can chain IVs.
  56. config RT_HWCRYPTO_USING_AES_CFB
  57. bool "Using Hardware AES CFB mode"
  58. default n
  59. help
  60. Advertise AES CFB streaming cipher support if the hardware
  61. exposes it; leave disabled otherwise.
  62. config RT_HWCRYPTO_USING_AES_CTR
  63. bool "Using Hardware AES CTR mode"
  64. default n
  65. help
  66. Enable AES counter mode processing for peripherals that can
  67. increment counters internally.
  68. config RT_HWCRYPTO_USING_AES_OFB
  69. bool "Using Hardware AES OFB mode"
  70. default n
  71. help
  72. Provide AES OFB (output feedback) mode wrappers. Only useful
  73. when the engine implements OFB directly.
  74. endif
  75. config RT_HWCRYPTO_USING_DES
  76. bool "Using Hardware DES"
  77. default n
  78. help
  79. Toggle hardware DES acceleration. DES is legacy; enable it only
  80. for compatibility with existing protocols.
  81. if RT_HWCRYPTO_USING_DES
  82. config RT_HWCRYPTO_USING_DES_ECB
  83. bool "Using Hardware DES ECB mode"
  84. default y
  85. help
  86. Support DES ECB mode if the IP block offers it.
  87. config RT_HWCRYPTO_USING_DES_CBC
  88. bool "Using Hardware DES CBC mode"
  89. default n
  90. help
  91. Enable DES CBC helper functions when the peripheral supports
  92. feedback chaining.
  93. endif
  94. config RT_HWCRYPTO_USING_3DES
  95. bool "Using Hardware 3DES"
  96. default n
  97. help
  98. Enable triple-DES acceleration (single/dual key). Required when
  99. interacting with older security modules.
  100. if RT_HWCRYPTO_USING_3DES
  101. config RT_HWCRYPTO_USING_3DES_ECB
  102. bool "Using Hardware 3DES ECB mode"
  103. default y
  104. help
  105. Provide 3DES ECB support if your IP implements it.
  106. config RT_HWCRYPTO_USING_3DES_CBC
  107. bool "Using Hardware 3DES CBC mode"
  108. default n
  109. help
  110. Provide 3DES CBC helpers for devices that offer feedback
  111. chaining.
  112. endif
  113. config RT_HWCRYPTO_USING_RC4
  114. bool "Using Hardware RC4"
  115. default n
  116. help
  117. Enable the RC4 stream cipher hooks. Only rare legacy hardware
  118. still implements RC4; keep disabled otherwise.
  119. config RT_HWCRYPTO_USING_MD5
  120. bool "Using Hardware MD5"
  121. default n
  122. help
  123. Register MD5 digest offload support. Use this only if the SoC
  124. exposes a hash module with MD5 capability.
  125. config RT_HWCRYPTO_USING_SHA1
  126. bool "Using Hardware SHA1"
  127. default n
  128. help
  129. Enable SHA-1 hashing acceleration. SHA-1 is deprecated for secure
  130. applications but may be required for compatibility.
  131. config RT_HWCRYPTO_USING_SHA2
  132. bool "Using Hardware SHA2"
  133. default n
  134. help
  135. Turn on SHA-2 (224/256/384/512) acceleration. Select the exact
  136. digests below to match your IP core.
  137. if RT_HWCRYPTO_USING_SHA2
  138. config RT_HWCRYPTO_USING_SHA2_224
  139. bool "Using Hardware SHA2_224 mode"
  140. default n
  141. help
  142. Provide SHA-224 digest routines if hardware supports them.
  143. config RT_HWCRYPTO_USING_SHA2_256
  144. bool "Using Hardware SHA2_256 mode"
  145. default y
  146. help
  147. Enable SHA-256, the most commonly required SHA-2 variant.
  148. config RT_HWCRYPTO_USING_SHA2_384
  149. bool "Using Hardware SHA2_384 mode"
  150. default n
  151. help
  152. Toggle SHA-384 support when present to support TLS-style HMAC.
  153. config RT_HWCRYPTO_USING_SHA2_512
  154. bool "Using Hardware SHA2_512 mode"
  155. default n
  156. help
  157. Expose SHA-512 digest if your accelerator implements 512-bit
  158. compression functions.
  159. endif
  160. config RT_HWCRYPTO_USING_RNG
  161. bool "Using Hardware RNG"
  162. default n
  163. help
  164. Enable the true/fast random number generator interface so the RNG
  165. peripheral can feed entropy to TLS stacks or secure boot.
  166. config RT_HWCRYPTO_USING_CRC
  167. bool "Using Hardware CRC"
  168. default n
  169. help
  170. Expose hardware CRC units and allow selecting supported
  171. polynomials below. Useful for communication stacks that need
  172. high-throughput CRC calculation.
  173. if RT_HWCRYPTO_USING_CRC
  174. config RT_HWCRYPTO_USING_CRC_07
  175. bool "Using Hardware CRC-8 0x07 polynomial"
  176. default n
  177. help
  178. Turn on support for the CRC-8 polynomial 0x07 (ATM/SMBus).
  179. config RT_HWCRYPTO_USING_CRC_8005
  180. bool "Using Hardware CRC-16 0x8005 polynomial"
  181. default n
  182. help
  183. Enable CRC-16/IBM polynomial acceleration.
  184. config RT_HWCRYPTO_USING_CRC_1021
  185. bool "Using Hardware CRC-16 0x1021 polynomial"
  186. default n
  187. help
  188. Enable CRC-16/CCITT-FALSE polynomial support.
  189. config RT_HWCRYPTO_USING_CRC_3D65
  190. bool "Using Hardware CRC-16 0x3D65 polynomial"
  191. default n
  192. help
  193. Enable CRC-16/USB polynomial (0x3D65) support.
  194. config RT_HWCRYPTO_USING_CRC_04C11DB7
  195. bool "Using Hardware CRC-32 0x04C11DB7 polynomial"
  196. default n
  197. help
  198. Enable CRC-32/IEEE polynomial support for Ethernet-like CRCs.
  199. endif
  200. config RT_HWCRYPTO_USING_BIGNUM
  201. bool "Using Hardware bignum"
  202. default n
  203. help
  204. Allow hardware accelerators to handle modular exponentiation and
  205. other big-number math (RSA, DH, ECC). Enable when your SoC
  206. includes a crypto accelerator with public-key instructions.
  207. if RT_HWCRYPTO_USING_BIGNUM
  208. config RT_HWCRYPTO_USING_BIGNUM_EXPTMOD
  209. bool "Using Hardware bignum expt_mod operation"
  210. default y
  211. help
  212. Provide modular exponentiation support (RSA decrypt/sign).
  213. config RT_HWCRYPTO_USING_BIGNUM_MULMOD
  214. bool "Using Hardware bignum mul_mod operation"
  215. default y
  216. help
  217. Enable modular multiplication for ECC/DH operations.
  218. config RT_HWCRYPTO_USING_BIGNUM_MUL
  219. bool "Using Hardware bignum mul operation"
  220. default n
  221. help
  222. Advertise raw big-number multiply support when hardware can do
  223. wide integer multiplication.
  224. config RT_HWCRYPTO_USING_BIGNUM_ADD
  225. bool "Using Hardware bignum add operation"
  226. default n
  227. help
  228. Enable big-number addition helpers when provided by silicon.
  229. config RT_HWCRYPTO_USING_BIGNUM_SUB
  230. bool "Using Hardware bignum sub operation"
  231. default n
  232. help
  233. Expose big-number subtraction support if available.
  234. endif
  235. endif
  236. if RT_USING_DM && RT_USING_HWCRYPTO
  237. osource "$(SOC_DM_HWCRYPTO_DIR)/Kconfig"
  238. endif