How to declare 2048 bit key in RSA

I want to implement RSA algorithm using C language. I have read the size of primes in RSA like p and q are 2048 bits long. How to declare such 2048 bit values in C. As i know that the data types like int , long ,long long int even are less than 64 bits. Please suggest.

• You could use a bignum library (or just use an array of unsigned char's/int's/whatever, and implement the multiprecision math yourself, however that's rarely worth the effort). – poncho Jul 9 '20 at 1:44

1. This is what you asked:

How to declare such 2048 bit values in C. As i know that the data types like int , long ,long long int even are less than 64 bits. Please suggest.


3 This is how to declare such 2048 bit values in C using The GNU MP Bignum Library .

// this is the big number p
mpz_t p;

// initialize  the big number p
mpz_inits (p, NULL);

// declaration or assignment of p

• I modify it. I think the question is that How to declare 2048 bit key in RSA" in the C language., I give a method in C. Please check it 。 – 孙海城 Jul 9 '20 at 5:34