diff --git a/README.md b/README.md index e6902b5..c1fca7d 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ The following list is a small part of the available, but the most often required | ---- | -------- | | `LTC_NO_TEST` | Remove all algorithm self-tests from the library | | `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) | -| `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for generating bigger RSA keys, change this at compile-time. | | `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* | | `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* | | `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* | diff --git a/demos/demo_dynamic.py b/demos/demo_dynamic.py index dbfb10a..a0699e4 100644 --- a/demos/demo_dynamic.py +++ b/demos/demo_dynamic.py @@ -150,7 +150,7 @@ if SHOW_SELECTED_CONSTANTS: b'ENDIAN_LITTLE', b'ENDIAN_64BITWORD', b'PK_PUBLIC', - b'MAX_RSA_SIZE', + b'LTC_MILLER_RABIN_REPS', b'CTR_COUNTER_BIG_ENDIAN', ] for name in names: diff --git a/src/headers/tomcrypt_custom.h b/src/headers/tomcrypt_custom.h index 66c6afc..923400a 100644 --- a/src/headers/tomcrypt_custom.h +++ b/src/headers/tomcrypt_custom.h @@ -425,19 +425,6 @@ #define LTC_ECC_TIMING_RESISTANT #endif -/* define these PK sizes out of LTC_NO_PK - * to have them always defined - */ -#if defined(LTC_MRSA) -/* Min and Max RSA key sizes (in bits) */ -#ifndef MIN_RSA_SIZE -#define MIN_RSA_SIZE 1024 -#endif -#ifndef MAX_RSA_SIZE -#define MAX_RSA_SIZE 4096 -#endif -#endif - /* PKCS #1 (RSA) and #5 (Password Handling) stuff */ #ifndef LTC_NO_PKCS diff --git a/src/misc/crypt/crypt_constants.c b/src/misc/crypt/crypt_constants.c index 496d257..a7418d5 100644 --- a/src/misc/crypt/crypt_constants.c +++ b/src/misc/crypt/crypt_constants.c @@ -77,8 +77,6 @@ static const crypt_constant _crypt_constants[] = { #ifdef LTC_MRSA {"LTC_MRSA", 1}, - _C_STRINGIFY(MIN_RSA_SIZE), - _C_STRINGIFY(MAX_RSA_SIZE), #else {"LTC_MRSA", 0}, #endif diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 065f733..8ba6ab1 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -32,10 +32,6 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) LTC_ARGCHK(ltc_mp.name != NULL); LTC_ARGCHK(key != NULL); - if ((size < (MIN_RSA_SIZE/8)) || (size > (MAX_RSA_SIZE/8))) { - return CRYPT_INVALID_KEYSIZE; - } - if ((e < 3) || ((e & 1) == 0)) { return CRYPT_INVALID_ARG; } diff --git a/tests/rsa_test.c b/tests/rsa_test.c index 79f49ca..998bdda 100644 --- a/tests/rsa_test.c +++ b/tests/rsa_test.c @@ -313,10 +313,10 @@ static int _rsa_key_cmp(const int should_type, const rsa_key *should, const rsa_ static int _rsa_issue_301(int prng_idx) { rsa_key key, key_in; - unsigned char buf[MAX_RSA_SIZE]; + unsigned char buf[4096]; unsigned long len; - DO(rsa_make_key(&yarrow_prng, prng_idx, MAX_RSA_SIZE/8, 65537, &key)); + DO(rsa_make_key(&yarrow_prng, prng_idx, sizeof(buf)/8, 65537, &key)); len = sizeof(buf); DO(rsa_export(buf, &len, PK_PRIVATE, &key));