Botan  2.8.0
Crypto and TLS for C++11
workfactor.h
Go to the documentation of this file.
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 
13 namespace Botan {
14 
15 /**
16 * Estimate work factor for discrete logarithm
17 * @param prime_group_size size of the group in bits
18 * @return estimated security level for this group
19 */
20 BOTAN_PUBLIC_API(2,0) size_t dl_work_factor(size_t prime_group_size);
21 
22 /**
23 * Return the appropriate exponent size to use for a particular prime
24 * group. This is twice the size of the estimated cost of breaking the
25 * key using an index calculus attack; the assumption is that if an
26 * arbitrary discrete log on a group of size bits would take about 2^n
27 * effort, and thus using an exponent of size 2^(2*n) implies that all
28 * available attacks are about as easy (as e.g Pollard's kangaroo
29 * algorithm can compute the DL in sqrt(x) operations) while minimizing
30 * the exponent size for performance reasons.
31 */
32 BOTAN_PUBLIC_API(2,0) size_t dl_exponent_size(size_t prime_group_size);
33 
34 /**
35 * Estimate work factor for integer factorization
36 * @param n_bits size of modulus in bits
37 * @return estimated security level for this modulus
38 */
39 BOTAN_PUBLIC_API(2,0) size_t if_work_factor(size_t n_bits);
40 
41 /**
42 * Estimate work factor for EC discrete logarithm
43 * @param prime_group_size size of the group in bits
44 * @return estimated security level for this group
45 */
46 BOTAN_PUBLIC_API(2,0) size_t ecp_work_factor(size_t prime_group_size);
47 
48 }
49 
50 #endif
size_t if_work_factor(size_t bits)
Definition: workfactor.cpp:38
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
size_t ecp_work_factor(size_t bits)
Definition: workfactor.cpp:14
Definition: alg_id.cpp:13
size_t dl_exponent_size(size_t bits)
Definition: workfactor.cpp:51
size_t dl_work_factor(size_t bits)
Definition: workfactor.cpp:45