Lines Matching refs:rsa
62 "time rsa generation", NULL },
64 "rsa key file", NULL },
68 "rsa key file", NULL },
80 check_rsa(const unsigned char *in, size_t len, RSA *rsa, int padding)
86 res = malloc(RSA_size(rsa));
90 res2 = malloc(RSA_size(rsa));
96 keylen = RSA_private_encrypt(len, in, res, rsa, padding);
100 if (keylen > RSA_size(rsa))
101 errx(1, "keylen > RSA_size(rsa)");
103 keylen = RSA_public_decrypt(keylen, res, res2, rsa, padding);
115 keylen = RSA_public_encrypt(len, in, res, rsa, padding);
119 if (keylen > RSA_size(rsa))
120 errx(1, "keylen > RSA_size(rsa)");
122 keylen = RSA_private_decrypt(keylen, res, res2, rsa, padding);
134 if (RSA_sign(NID_sha1, in, len, res, &len2, rsa) != 1)
137 if (RSA_verify(NID_sha1, in, len, res, len2, rsa) != 1)
156 RSA *rsa;
172 rsa = d2i_RSAPrivateKey(NULL, &p, size);
173 if (rsa == NULL)
176 RSA_set_method(rsa, ENGINE_get_RSA(engine));
179 rsa->flags |= RSA_FLAG_NO_BLINDING;
181 return rsa;
203 RSA *rsa;
240 printf("rsa %s\n", ENGINE_get_RSA(engine)->name);
249 rsa = RSA_new_method(engine);
251 rsa->flags |= RSA_FLAG_NO_BLINDING;
261 rsa = RSA_new_method(engine);
262 if (RSA_generate_key_ex(rsa, 1024, e, NULL) != 1)
264 RSA_free(rsa);
288 rsa = RSA_new_method(engine);
290 rsa->flags |= RSA_FLAG_NO_BLINDING;
295 if (RSA_generate_key_ex(rsa, 1024, e, NULL) != 1)
298 rsa = read_key(engine, time_key);
307 check_rsa(p + (i * size), size, rsa, RSA_PKCS1_PADDING);
316 RSA_free(rsa);
323 rsa = read_key(engine, rsa_key);
337 check_rsa(sha1, sizeof(sha1), rsa, RSA_PKCS1_PADDING);
344 check_rsa(sha1, sizeof(sha1), rsa, RSA_PKCS1_PADDING);
350 check_rsa(des3, sizeof(des3), rsa, RSA_PKCS1_PADDING);
356 check_rsa(aes, sizeof(aes), rsa, RSA_PKCS1_PADDING);
359 RSA_free(rsa);
367 rsa = RSA_new_method(engine);
369 rsa->flags |= RSA_FLAG_NO_BLINDING;
380 if (RSA_generate_key_ex(rsa, n, e, &cb) != 1)
388 check_rsa(sha1, sizeof(sha1), rsa, RSA_PKCS1_PADDING);
391 RSA_free(rsa);