BigIntConfig.in 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #
  2. # For a description of the syntax of this configuration file,
  3. # see scripts/config/Kconfig-language.txt
  4. #
  5. menu "BigInt Options"
  6. depends on !CONFIG_SSL_SKELETON_MODE
  7. choice
  8. prompt "Reduction Algorithm"
  9. default CONFIG_BIGINT_BARRETT
  10. config CONFIG_BIGINT_CLASSICAL
  11. bool "Classical"
  12. help
  13. Classical uses standard division. It has no limitations and is
  14. theoretically the slowest due to the divisions used. For this particular
  15. implementation it is surprisingly quite fast.
  16. config CONFIG_BIGINT_MONTGOMERY
  17. bool "Montgomery"
  18. help
  19. Montgomery uses simple addition and multiplication to achieve its
  20. performance. In this implementation it is slower than classical,
  21. and it has the limitation that 0 <= x, y < m, and so is not used
  22. when CRT is active.
  23. This option will not be normally selected.
  24. config CONFIG_BIGINT_BARRETT
  25. bool "Barrett"
  26. help
  27. Barrett performs expensive precomputation before reduction and partial
  28. multiplies for computational speed. It can't be used with some of the
  29. calculations when CRT is used, and so defaults to classical when this
  30. occurs.
  31. It is about 40% faster than Classical/Montgomery with the expense of
  32. about 2kB, and so this option is normally selected.
  33. endchoice
  34. config CONFIG_BIGINT_CRT
  35. bool "Chinese Remainder Theorem (CRT)"
  36. default y
  37. help
  38. Allow the Chinese Remainder Theorem (CRT) to be used.
  39. Uses a number of extra coefficients from the private key to improve the
  40. performance of a decryption. This feature is one of the most
  41. significant performance improvements (it reduces a decryption time by
  42. over 3 times).
  43. This option should be selected.
  44. config CONFIG_BIGINT_KARATSUBA
  45. bool "Karatsuba Multiplication"
  46. default n
  47. help
  48. Allow Karasuba multiplication to be used.
  49. Uses 3 multiplications (plus a number of additions/subtractions)
  50. instead of 4. Multiplications are O(N^2) but addition/subtraction
  51. is O(N) hence for large numbers is beneficial. For this project, the
  52. effect was only useful for 4096 bit keys. As these aren't likely to
  53. be used, the feature is disabled by default.
  54. It costs about 2kB to enable it.
  55. config MUL_KARATSUBA_THRESH
  56. int "Karatsuba Multiplication Theshold"
  57. default 20
  58. depends on CONFIG_BIGINT_KARATSUBA
  59. help
  60. The minimum number of components needed before Karasuba muliplication
  61. is used.
  62. This is very dependent on the speed/implementation of bi_add()/
  63. bi_subtract(). There is a bit of trial and error here and will be
  64. at a different point for different architectures.
  65. config SQU_KARATSUBA_THRESH
  66. int "Karatsuba Square Threshold"
  67. default 40
  68. depends on CONFIG_BIGINT_KARATSUBA && CONFIG_BIGINT_SQUARE
  69. help
  70. The minimum number of components needed before Karatsuba squaring
  71. is used.
  72. This is very dependent on the speed/implementation of bi_add()/
  73. bi_subtract(). There is a bit of trial and error here and will be
  74. at a different point for different architectures.
  75. config CONFIG_BIGINT_SLIDING_WINDOW
  76. bool "Sliding Window Exponentiation"
  77. default y
  78. help
  79. Allow Sliding-Window Exponentiation to be used.
  80. Potentially processes more than 1 bit at a time when doing
  81. exponentiation. The sliding-window technique reduces the number of
  82. precomputations compared to other precomputed techniques.
  83. It results in a considerable performance improvement with it enabled
  84. (it halves the decryption time) and so should be selected.
  85. config CONFIG_BIGINT_SQUARE
  86. bool "Square Algorithm"
  87. default y
  88. help
  89. Allow squaring to be used instead of a multiplication.
  90. Squaring is theoretically 50% faster than a standard multiply
  91. (but is actually about 25% faster).
  92. It gives a 20% speed improvement and so should be selected.
  93. config CONFIG_BIGINT_CHECK_ON
  94. bool "BigInt Integrity Checking"
  95. default n if !CONFIG_DEBUG
  96. default y if CONFIG_DEBUG
  97. help
  98. This is used when developing bigint algorithms. It performs a sanity
  99. check on all operations at the expense of speed.
  100. This option is only selected when developing and should normally be
  101. turned off.
  102. endmenu