1 /* 2 * Public Key Work Factor Functions 3 * (C) 1999-2007 Jack Lloyd 4 * 5 * Botan is released under the Simplified BSD License (see license.txt) 6 */ 7 8 #ifndef BOTAN_WORKFACTOR_H_ 9 #define BOTAN_WORKFACTOR_H_ 10 11 #include <botan/types.h> 12 BOTAN_FUTURE_INTERNAL_HEADER(workfactor.h) 13 14 namespace Botan { 15 16 /** 17 * Estimate work factor for discrete logarithm 18 * @param prime_group_size size of the group in bits 19 * @return estimated security level for this group 20 */ 21 BOTAN_PUBLIC_API(2,0) size_t dl_work_factor(size_t prime_group_size); 22 23 /** 24 * Return the appropriate exponent size to use for a particular prime 25 * group. This is twice the size of the estimated cost of breaking the 26 * key using an index calculus attack; the assumption is that if an 27 * arbitrary discrete log on a group of size bits would take about 2^n 28 * effort, and thus using an exponent of size 2^(2*n) implies that all 29 * available attacks are about as easy (as e.g Pollard's kangaroo 30 * algorithm can compute the DL in sqrt(x) operations) while minimizing 31 * the exponent size for performance reasons. 32 */ 33 BOTAN_PUBLIC_API(2,0) size_t dl_exponent_size(size_t prime_group_size); 34 35 /** 36 * Estimate work factor for integer factorization 37 * @param n_bits size of modulus in bits 38 * @return estimated security level for this modulus 39 */ 40 BOTAN_PUBLIC_API(2,0) size_t if_work_factor(size_t n_bits); 41 42 /** 43 * Estimate work factor for EC discrete logarithm 44 * @param prime_group_size size of the group in bits 45 * @return estimated security level for this group 46 */ 47 BOTAN_PUBLIC_API(2,0) size_t ecp_work_factor(size_t prime_group_size); 48 49 } 50 51 #endif 52