Botan 3.4.0
Crypto and TLS for C&
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
13namespace 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*/
20size_t BOTAN_TEST_API 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*/
32size_t BOTAN_TEST_API 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*/
39size_t BOTAN_TEST_API 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*/
46size_t ecp_work_factor(size_t prime_group_size);
47
48} // namespace Botan
49
50#endif
#define BOTAN_TEST_API
Definition compiler.h:51
size_t ecp_work_factor(size_t bits)
size_t dl_work_factor(size_t bits)
size_t dl_exponent_size(size_t bits)
size_t if_work_factor(size_t bits)