Lines Matching defs:bits
13 * When generating an RSA key, you must specify the number of bits in the key. A
31 * The number of bits is specified by the bits argument.
35 static EVP_PKEY *generate_rsa_key_long(OSSL_LIB_CTX *libctx, unsigned int bits)
55 * Here we set the number of bits to use in the RSA key.
58 if (EVP_PKEY_CTX_set_rsa_keygen_bits(genctx, bits) <= 0) {
77 * Generating an RSA key with a number of bits large enough to be secure for
101 * The number of bits is specified by the bits argument.
108 static EVP_PKEY *generate_rsa_key_short(OSSL_LIB_CTX *libctx, unsigned int bits)
113 pkey = EVP_PKEY_Q_keygen(libctx, propq, "RSA", (size_t)bits);
127 int bits = 0;
183 * We can also retrieve the key size in bits for informational purposes.
185 if (EVP_PKEY_get_int_param(pkey, OSSL_PKEY_PARAM_BITS, &bits) == 0) {
186 fprintf(stderr, "Failed to retrieve bits\n");
191 fprintf(stdout, "\nNumber of bits: %d\n\n", bits);
245 unsigned int bits = 4096;
248 /* usage: [-s] [<bits>] */
257 if (bits < 512) {
262 bits = (unsigned int)bits_i;
265 /* Avoid using key sizes less than 2048 bits; see comment at top of file. */
266 if (bits < 2048)
271 pkey = generate_rsa_key_short(libctx, bits);
273 pkey = generate_rsa_key_long(libctx, bits);