Kconfig 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. # SPDX-License-Identifier: GPL-2.0
  2. menu "Crypto library routines"
  3. config CRYPTO_HASH_INFO
  4. bool
  5. config CRYPTO_LIB_UTILS
  6. tristate
  7. config CRYPTO_LIB_AES
  8. tristate
  9. config CRYPTO_LIB_AES_ARCH
  10. bool
  11. depends on CRYPTO_LIB_AES && !UML && !KMSAN
  12. default y if ARM
  13. default y if ARM64
  14. default y if PPC && (SPE || (PPC64 && VSX))
  15. default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
  16. RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
  17. default y if S390
  18. default y if SPARC64
  19. default y if X86
  20. config CRYPTO_LIB_AESCFB
  21. tristate
  22. select CRYPTO_LIB_AES
  23. select CRYPTO_LIB_UTILS
  24. config CRYPTO_LIB_AESGCM
  25. tristate
  26. select CRYPTO_LIB_AES
  27. select CRYPTO_LIB_GF128MUL
  28. select CRYPTO_LIB_UTILS
  29. config CRYPTO_LIB_ARC4
  30. tristate
  31. config CRYPTO_LIB_GF128MUL
  32. tristate
  33. config CRYPTO_LIB_BLAKE2B
  34. tristate
  35. help
  36. The BLAKE2b library functions. Select this if your module uses any of
  37. the functions from <crypto/blake2b.h>.
  38. config CRYPTO_LIB_BLAKE2B_ARCH
  39. bool
  40. depends on CRYPTO_LIB_BLAKE2B && !UML
  41. default y if ARM && KERNEL_MODE_NEON
  42. # BLAKE2s support is always built-in, so there's no CRYPTO_LIB_BLAKE2S option.
  43. config CRYPTO_LIB_BLAKE2S_ARCH
  44. bool
  45. depends on !UML
  46. default y if ARM
  47. default y if X86_64
  48. config CRYPTO_LIB_CHACHA
  49. tristate
  50. select CRYPTO_LIB_UTILS
  51. help
  52. Enable the ChaCha library interface. Select this if your module uses
  53. chacha_crypt() or hchacha_block().
  54. config CRYPTO_LIB_CHACHA_ARCH
  55. bool
  56. depends on CRYPTO_LIB_CHACHA && !UML && !KMSAN
  57. default y if ARM
  58. default y if ARM64 && KERNEL_MODE_NEON
  59. default y if MIPS && CPU_MIPS32_R2
  60. default y if PPC64 && CPU_LITTLE_ENDIAN && VSX
  61. default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
  62. RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
  63. default y if S390
  64. default y if X86_64
  65. config CRYPTO_LIB_CURVE25519
  66. tristate
  67. select CRYPTO_LIB_UTILS
  68. help
  69. The Curve25519 library functions. Select this if your module uses any
  70. of the functions from <crypto/curve25519.h>.
  71. config CRYPTO_LIB_CURVE25519_ARCH
  72. bool
  73. depends on CRYPTO_LIB_CURVE25519 && !UML && !KMSAN
  74. default y if ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
  75. default y if PPC64 && CPU_LITTLE_ENDIAN
  76. default y if X86_64
  77. config CRYPTO_LIB_CURVE25519_GENERIC
  78. bool
  79. depends on CRYPTO_LIB_CURVE25519
  80. default y if !CRYPTO_LIB_CURVE25519_ARCH || ARM || X86_64
  81. config CRYPTO_LIB_DES
  82. tristate
  83. config CRYPTO_LIB_MD5
  84. tristate
  85. help
  86. The MD5 and HMAC-MD5 library functions. Select this if your module
  87. uses any of the functions from <crypto/md5.h>.
  88. config CRYPTO_LIB_MD5_ARCH
  89. bool
  90. depends on CRYPTO_LIB_MD5 && !UML
  91. default y if MIPS && CPU_CAVIUM_OCTEON
  92. default y if PPC
  93. default y if SPARC64
  94. config CRYPTO_LIB_MLDSA
  95. tristate
  96. select CRYPTO_LIB_SHA3
  97. help
  98. The ML-DSA library functions. Select this if your module uses any of
  99. the functions from <crypto/mldsa.h>.
  100. config CRYPTO_LIB_NH
  101. tristate
  102. help
  103. Implementation of the NH almost-universal hash function, specifically
  104. the variant of NH used in Adiantum.
  105. config CRYPTO_LIB_NH_ARCH
  106. bool
  107. depends on CRYPTO_LIB_NH && !UML && !KMSAN
  108. default y if ARM && KERNEL_MODE_NEON
  109. default y if ARM64 && KERNEL_MODE_NEON
  110. default y if X86_64
  111. config CRYPTO_LIB_POLY1305
  112. tristate
  113. help
  114. The Poly1305 library functions. Select this if your module uses any
  115. of the functions from <crypto/poly1305.h>.
  116. config CRYPTO_LIB_POLY1305_ARCH
  117. bool
  118. depends on CRYPTO_LIB_POLY1305 && !UML && !KMSAN
  119. default y if ARM
  120. default y if ARM64 && KERNEL_MODE_NEON
  121. default y if MIPS
  122. # The PPC64 code needs to be fixed to work in softirq context.
  123. default y if PPC64 && CPU_LITTLE_ENDIAN && VSX && BROKEN
  124. default y if RISCV
  125. default y if X86_64
  126. # This symbol controls the inclusion of the Poly1305 generic code. This differs
  127. # from most of the other algorithms, which handle the generic code
  128. # "automatically" via __maybe_unused. This is needed so that the Adiantum code,
  129. # which calls the poly1305_core_*() functions directly, can enable them.
  130. config CRYPTO_LIB_POLY1305_GENERIC
  131. bool
  132. depends on CRYPTO_LIB_POLY1305
  133. # Enable if there's no arch impl or the arch impl requires the generic
  134. # impl as a fallback. (Or if selected explicitly.)
  135. default y if !CRYPTO_LIB_POLY1305_ARCH || PPC64
  136. config CRYPTO_LIB_POLY1305_RSIZE
  137. int
  138. default 2 if MIPS || RISCV
  139. default 11 if X86_64
  140. default 9 if ARM || ARM64
  141. default 1
  142. config CRYPTO_LIB_POLYVAL
  143. tristate
  144. help
  145. The POLYVAL library functions. Select this if your module uses any of
  146. the functions from <crypto/polyval.h>.
  147. config CRYPTO_LIB_POLYVAL_ARCH
  148. bool
  149. depends on CRYPTO_LIB_POLYVAL && !UML
  150. default y if ARM64 && KERNEL_MODE_NEON
  151. default y if X86_64
  152. config CRYPTO_LIB_CHACHA20POLY1305
  153. tristate
  154. select CRYPTO_LIB_CHACHA
  155. select CRYPTO_LIB_POLY1305
  156. select CRYPTO_LIB_UTILS
  157. config CRYPTO_LIB_SHA1
  158. tristate
  159. help
  160. The SHA-1 and HMAC-SHA1 library functions. Select this if your module
  161. uses any of the functions from <crypto/sha1.h>.
  162. config CRYPTO_LIB_SHA1_ARCH
  163. bool
  164. depends on CRYPTO_LIB_SHA1 && !UML
  165. default y if ARM
  166. default y if ARM64 && KERNEL_MODE_NEON
  167. default y if MIPS && CPU_CAVIUM_OCTEON
  168. default y if PPC
  169. default y if S390
  170. default y if SPARC64
  171. default y if X86_64
  172. config CRYPTO_LIB_SHA256
  173. tristate
  174. help
  175. The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
  176. Select this if your module uses any of these functions from
  177. <crypto/sha2.h>.
  178. config CRYPTO_LIB_SHA256_ARCH
  179. bool
  180. depends on CRYPTO_LIB_SHA256 && !UML
  181. default y if ARM && !CPU_V7M
  182. default y if ARM64
  183. default y if MIPS && CPU_CAVIUM_OCTEON
  184. default y if PPC && SPE
  185. default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
  186. RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
  187. default y if S390
  188. default y if SPARC64
  189. default y if X86_64
  190. config CRYPTO_LIB_SHA512
  191. tristate
  192. help
  193. The SHA-384, SHA-512, HMAC-SHA384, and HMAC-SHA512 library functions.
  194. Select this if your module uses any of these functions from
  195. <crypto/sha2.h>.
  196. config CRYPTO_LIB_SHA512_ARCH
  197. bool
  198. depends on CRYPTO_LIB_SHA512 && !UML
  199. default y if ARM && !CPU_V7M
  200. default y if ARM64
  201. default y if MIPS && CPU_CAVIUM_OCTEON
  202. default y if RISCV && 64BIT && TOOLCHAIN_HAS_VECTOR_CRYPTO && \
  203. RISCV_EFFICIENT_VECTOR_UNALIGNED_ACCESS
  204. default y if S390
  205. default y if SPARC64
  206. default y if X86_64
  207. config CRYPTO_LIB_SHA3
  208. tristate
  209. select CRYPTO_LIB_UTILS
  210. help
  211. The SHA3 library functions. Select this if your module uses any of
  212. the functions from <crypto/sha3.h>.
  213. config CRYPTO_LIB_SHA3_ARCH
  214. bool
  215. depends on CRYPTO_LIB_SHA3 && !UML
  216. default y if ARM64 && KERNEL_MODE_NEON
  217. default y if S390
  218. config CRYPTO_LIB_SM3
  219. tristate
  220. source "lib/crypto/tests/Kconfig"
  221. endmenu