Skip to content

Commit 30b3a9a

Browse files
committed
remove {MIN,MAX}_RSA_SIZE
1 parent 40e4a66 commit 30b3a9a

6 files changed

Lines changed: 3 additions & 23 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ The following list is a small part of the available, but the most often required
4848
| ---- | -------- |
4949
| `LTC_NO_TEST` | Remove all algorithm self-tests from the library |
5050
| `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) |
51-
| `MAX_RSA_SIZE` | Per default set to `4096`, if you need support for generating bigger RSA keys, change this at compile-time. |
5251
| `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* |
5352
| `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* |
5453
| `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* |

demos/demo_dynamic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def inprint(s, indent=0):
150150
b'ENDIAN_LITTLE',
151151
b'ENDIAN_64BITWORD',
152152
b'PK_PUBLIC',
153-
b'MAX_RSA_SIZE',
153+
b'LTC_MILLER_RABIN_REPS',
154154
b'CTR_COUNTER_BIG_ENDIAN',
155155
]
156156
for name in names:

src/headers/tomcrypt_custom.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -425,19 +425,6 @@
425425
#define LTC_ECC_TIMING_RESISTANT
426426
#endif
427427

428-
/* define these PK sizes out of LTC_NO_PK
429-
* to have them always defined
430-
*/
431-
#if defined(LTC_MRSA)
432-
/* Min and Max RSA key sizes (in bits) */
433-
#ifndef MIN_RSA_SIZE
434-
#define MIN_RSA_SIZE 1024
435-
#endif
436-
#ifndef MAX_RSA_SIZE
437-
#define MAX_RSA_SIZE 4096
438-
#endif
439-
#endif
440-
441428
/* PKCS #1 (RSA) and #5 (Password Handling) stuff */
442429
#ifndef LTC_NO_PKCS
443430

src/misc/crypt/crypt_constants.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ static const crypt_constant _crypt_constants[] = {
7777

7878
#ifdef LTC_MRSA
7979
{"LTC_MRSA", 1},
80-
_C_STRINGIFY(MIN_RSA_SIZE),
81-
_C_STRINGIFY(MAX_RSA_SIZE),
8280
#else
8381
{"LTC_MRSA", 0},
8482
#endif

src/pk/rsa/rsa_make_key.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key)
3232
LTC_ARGCHK(ltc_mp.name != NULL);
3333
LTC_ARGCHK(key != NULL);
3434

35-
if ((size < (MIN_RSA_SIZE/8)) || (size > (MAX_RSA_SIZE/8))) {
36-
return CRYPT_INVALID_KEYSIZE;
37-
}
38-
3935
if ((e < 3) || ((e & 1) == 0)) {
4036
return CRYPT_INVALID_ARG;
4137
}

tests/rsa_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ static int _rsa_key_cmp(const int should_type, const rsa_key *should, const rsa_
313313
static int _rsa_issue_301(int prng_idx)
314314
{
315315
rsa_key key, key_in;
316-
unsigned char buf[MAX_RSA_SIZE];
316+
unsigned char buf[4096];
317317
unsigned long len;
318318

319-
DO(rsa_make_key(&yarrow_prng, prng_idx, MAX_RSA_SIZE/8, 65537, &key));
319+
DO(rsa_make_key(&yarrow_prng, prng_idx, sizeof(buf)/8, 65537, &key));
320320

321321
len = sizeof(buf);
322322
DO(rsa_export(buf, &len, PK_PRIVATE, &key));

0 commit comments

Comments
 (0)