Lines Matching refs:key

224     RSA *key = NULL;  in test_check_private_exponent()  local
228 ret = TEST_ptr(key = RSA_new()) in test_check_private_exponent()
235 && TEST_true(RSA_set0_factors(key, p, q)); in test_check_private_exponent()
248 && TEST_true(RSA_set0_key(key, n, e, d)); in test_check_private_exponent()
256 ret = TEST_false(ossl_rsa_check_private_exponent(key, 8, ctx)) in test_check_private_exponent()
259 && TEST_true(ossl_rsa_check_private_exponent(key, 8, ctx)) in test_check_private_exponent()
261 && TEST_false(ossl_rsa_check_private_exponent(key, 16, ctx)) in test_check_private_exponent()
264 && TEST_false(ossl_rsa_check_private_exponent(key, 8, ctx)) in test_check_private_exponent()
267 && TEST_false(ossl_rsa_check_private_exponent(key, 8, ctx)); in test_check_private_exponent()
269 RSA_free(key); in test_check_private_exponent()
285 RSA *key = NULL; in test_check_crt_components() local
289 ret = TEST_ptr(key = RSA_new()) in test_check_crt_components()
297 && TEST_true(RSA_set0_factors(key, p, q)); in test_check_crt_components()
304 ret = TEST_int_eq(ossl_rsa_sp800_56b_derive_params_from_pq(key, 8, e, ctx), 1) in test_check_crt_components()
305 && TEST_BN_eq_word(key->n, N) in test_check_crt_components()
306 && TEST_BN_eq_word(key->dmp1, DP) in test_check_crt_components()
307 && TEST_BN_eq_word(key->dmq1, DQ) in test_check_crt_components()
308 && TEST_BN_eq_word(key->iqmp, QINV) in test_check_crt_components()
309 && TEST_true(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
311 && TEST_true(BN_set_word(key->dmp1, 1)) in test_check_crt_components()
312 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
313 && TEST_true(BN_set_word(key->dmp1, P-1)) in test_check_crt_components()
314 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
315 && TEST_true(BN_set_word(key->dmp1, DP)) in test_check_crt_components()
317 && TEST_true(BN_set_word(key->dmq1, 1)) in test_check_crt_components()
318 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
319 && TEST_true(BN_set_word(key->dmq1, Q-1)) in test_check_crt_components()
320 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
321 && TEST_true(BN_set_word(key->dmq1, DQ)) in test_check_crt_components()
323 && TEST_true(BN_set_word(key->iqmp, 1)) in test_check_crt_components()
324 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
325 && TEST_true(BN_set_word(key->iqmp, P)) in test_check_crt_components()
326 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
327 && TEST_true(BN_set_word(key->iqmp, QINV)) in test_check_crt_components()
329 && TEST_true(BN_set_word(key->dmp1, DP+1)) in test_check_crt_components()
330 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
331 && TEST_true(BN_set_word(key->dmp1, DP)) in test_check_crt_components()
333 && TEST_true(BN_set_word(key->dmq1, DQ-1)) in test_check_crt_components()
334 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
335 && TEST_true(BN_set_word(key->dmq1, DQ)) in test_check_crt_components()
337 && TEST_true(BN_set_word(key->iqmp, QINV+1)) in test_check_crt_components()
338 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
339 && TEST_true(BN_set_word(key->iqmp, QINV)) in test_check_crt_components()
341 && TEST_true(ossl_rsa_check_crt_components(key, ctx)); in test_check_crt_components()
344 RSA_free(key); in test_check_crt_components()
359 RSA *key = NULL; in test_derive_params_from_pq_fail() local
363 ret = TEST_ptr(key = RSA_new()) in test_derive_params_from_pq_fail()
371 && TEST_true(RSA_set0_factors(key, p, q)); in test_derive_params_from_pq_fail()
378 ret = TEST_int_le(ossl_rsa_sp800_56b_derive_params_from_pq(key, 8, e, ctx), 0); in test_derive_params_from_pq_fail()
381 RSA_free(key); in test_derive_params_from_pq_fail()
413 RSA *key = NULL; in test_invalid_keypair() local
417 ret = TEST_ptr(key = RSA_new()) in test_invalid_keypair()
420 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
424 && TEST_true(RSA_set0_factors(key, p, q)); in test_invalid_keypair()
434 && TEST_true(RSA_set0_key(key, n, e, d)); in test_invalid_keypair()
442 ret = TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 100, 2048)) in test_invalid_keypair()
443 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 112, 1024)) in test_invalid_keypair()
444 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 128, 2048)) in test_invalid_keypair()
445 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 140, 3072)) in test_invalid_keypair()
447 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, BN_value_one(), in test_invalid_keypair()
451 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
455 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 3072)) in test_invalid_keypair()
456 && TEST_true(ossl_rsa_sp800_56b_check_keypair(key, e, 112, 2048)) in test_invalid_keypair()
459 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
463 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2049)) in test_invalid_keypair()
468 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
474 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
478 RSA_free(key); in test_invalid_keypair()
489 RSA *key = NULL; in test_sp80056b_keygen() local
493 ret = TEST_ptr(key = RSA_new()) in test_sp80056b_keygen()
494 && TEST_true(ossl_rsa_sp800_56b_generate_key(key, sz, NULL, NULL)) in test_sp80056b_keygen()
495 && TEST_true(ossl_rsa_sp800_56b_check_public(key)) in test_sp80056b_keygen()
496 && TEST_true(ossl_rsa_sp800_56b_check_private(key)) in test_sp80056b_keygen()
497 && TEST_true(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, sz)); in test_sp80056b_keygen()
499 RSA_free(key); in test_sp80056b_keygen()
507 RSA *key = NULL; in test_check_private_key() local
509 ret = TEST_ptr(key = RSA_new()) in test_check_private_key()
511 && TEST_false(ossl_rsa_sp800_56b_check_private(key)) in test_check_private_key()
516 && TEST_true(RSA_set0_key(key, n, e, d)); in test_check_private_key()
524 ret = TEST_true(ossl_rsa_sp800_56b_check_private(key)) in test_check_private_key()
527 && TEST_false(ossl_rsa_sp800_56b_check_private(key)) in test_check_private_key()
530 && TEST_false(ossl_rsa_sp800_56b_check_private(key)); in test_check_private_key()
532 RSA_free(key); in test_check_private_key()
540 RSA *key = NULL; in test_check_public_key() local
542 ret = TEST_ptr(key = RSA_new()) in test_check_public_key()
544 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
548 && TEST_true(RSA_set0_key(key, n, e, NULL)); in test_check_public_key()
555 ret = TEST_true(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
558 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
562 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
566 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
570 && TEST_false(ossl_rsa_sp800_56b_check_public(key)); in test_check_public_key()
572 RSA_free(key); in test_check_public_key()