You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

51 lines
1.3 KiB

  1. /**
  2. * @file decaf_config.h
  3. * @author Mike Hamburg
  4. *
  5. * @copyright
  6. * Copyright (c) 2015 Cryptography Research, Inc. \n
  7. * Released under the MIT License. See LICENSE.txt for license information.
  8. *
  9. * @brief Configuration for decaf_fast.c
  10. */
  11. #ifndef __DECAF_CONFIG_H__
  12. #define __DECAF_CONFIG_H__ 1
  13. /**
  14. * Use the Montgomery ladder for direct scalarmul.
  15. *
  16. * The Montgomery ladder is faster than Edwards scalarmul, but providing
  17. * the features Decaf supports (cofactor elimination, twist rejection)
  18. * makes it complicated and adds code. Removing the ladder saves a few
  19. * kilobytes at the cost of perhaps 5-10% overhead in direct scalarmul
  20. * time.
  21. */
  22. #define DECAF_USE_MONTGOMERY_LADDER 1
  23. /** The number of comb tables for fixed base scalarmul. */
  24. #define DECAF_COMBS_N 5
  25. /** The number of teeth per comb for fixed base scalarmul. */
  26. #define DECAF_COMBS_T 5
  27. /** The comb spacing fixed base scalarmul. */
  28. #define DECAF_COMBS_S 18
  29. /** Performance tuning: the width of the fixed window for scalar mul. */
  30. #define DECAF_WINDOW_BITS 5
  31. /**
  32. * The number of bits used for the precomputed table in variable-time
  33. * double scalarmul.
  34. */
  35. #define DECAF_WNAF_FIXED_TABLE_BITS 5
  36. /**
  37. * Performance tuning: bits used for the variable table in variable-time
  38. * double scalarmul.
  39. */
  40. #define DECAF_WNAF_VAR_TABLE_BITS 3
  41. #endif /* __DECAF_CONFIG_H__ */