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()
303 ret = TEST_true(ossl_rsa_sp800_56b_derive_params_from_pq(key, 8, e, ctx)) in test_check_crt_components()
304 && TEST_BN_eq_word(key->n, N) in test_check_crt_components()
305 && TEST_BN_eq_word(key->dmp1, DP) in test_check_crt_components()
306 && TEST_BN_eq_word(key->dmq1, DQ) in test_check_crt_components()
307 && TEST_BN_eq_word(key->iqmp, QINV) in test_check_crt_components()
308 && TEST_true(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
310 && TEST_true(BN_set_word(key->dmp1, 1)) in test_check_crt_components()
311 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
312 && TEST_true(BN_set_word(key->dmp1, P-1)) in test_check_crt_components()
313 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
314 && TEST_true(BN_set_word(key->dmp1, DP)) in test_check_crt_components()
316 && TEST_true(BN_set_word(key->dmq1, 1)) in test_check_crt_components()
317 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
318 && TEST_true(BN_set_word(key->dmq1, Q-1)) in test_check_crt_components()
319 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
320 && TEST_true(BN_set_word(key->dmq1, DQ)) in test_check_crt_components()
322 && TEST_true(BN_set_word(key->iqmp, 1)) in test_check_crt_components()
323 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
324 && TEST_true(BN_set_word(key->iqmp, P)) in test_check_crt_components()
325 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
326 && TEST_true(BN_set_word(key->iqmp, QINV)) in test_check_crt_components()
328 && TEST_true(BN_set_word(key->dmp1, DP+1)) in test_check_crt_components()
329 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
330 && TEST_true(BN_set_word(key->dmp1, DP)) in test_check_crt_components()
332 && TEST_true(BN_set_word(key->dmq1, DQ-1)) in test_check_crt_components()
333 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
334 && TEST_true(BN_set_word(key->dmq1, DQ)) in test_check_crt_components()
336 && TEST_true(BN_set_word(key->iqmp, QINV+1)) in test_check_crt_components()
337 && TEST_false(ossl_rsa_check_crt_components(key, ctx)) in test_check_crt_components()
338 && TEST_true(BN_set_word(key->iqmp, QINV)) in test_check_crt_components()
340 && TEST_true(ossl_rsa_check_crt_components(key, ctx)); in test_check_crt_components()
343 RSA_free(key); in test_check_crt_components()
375 RSA *key = NULL; in test_invalid_keypair() local
379 ret = TEST_ptr(key = RSA_new()) in test_invalid_keypair()
382 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
386 && TEST_true(RSA_set0_factors(key, p, q)); in test_invalid_keypair()
396 && TEST_true(RSA_set0_key(key, n, e, d)); in test_invalid_keypair()
404 ret = TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 100, 2048)) in test_invalid_keypair()
405 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 112, 1024)) in test_invalid_keypair()
406 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 128, 2048)) in test_invalid_keypair()
407 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, 140, 3072)) in test_invalid_keypair()
409 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, BN_value_one(), in test_invalid_keypair()
413 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
417 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 3072)) in test_invalid_keypair()
418 && TEST_true(ossl_rsa_sp800_56b_check_keypair(key, e, 112, 2048)) in test_invalid_keypair()
421 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
426 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
432 && TEST_false(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) in test_invalid_keypair()
436 RSA_free(key); in test_invalid_keypair()
448 RSA *key = NULL; in test_sp80056b_keygen() local
452 ret = TEST_ptr(key = RSA_new()) in test_sp80056b_keygen()
453 && TEST_true(ossl_rsa_sp800_56b_generate_key(key, sz, NULL, NULL)) in test_sp80056b_keygen()
454 && TEST_true(ossl_rsa_sp800_56b_check_public(key)) in test_sp80056b_keygen()
455 && TEST_true(ossl_rsa_sp800_56b_check_private(key)) in test_sp80056b_keygen()
456 && TEST_true(ossl_rsa_sp800_56b_check_keypair(key, NULL, -1, sz)); in test_sp80056b_keygen()
458 RSA_free(key); in test_sp80056b_keygen()
466 RSA *key = NULL; in test_check_private_key() local
468 ret = TEST_ptr(key = RSA_new()) in test_check_private_key()
470 && TEST_false(ossl_rsa_sp800_56b_check_private(key)) in test_check_private_key()
475 && TEST_true(RSA_set0_key(key, n, e, d)); in test_check_private_key()
483 ret = TEST_true(ossl_rsa_sp800_56b_check_private(key)) in test_check_private_key()
486 && TEST_false(ossl_rsa_sp800_56b_check_private(key)) in test_check_private_key()
489 && TEST_false(ossl_rsa_sp800_56b_check_private(key)); in test_check_private_key()
491 RSA_free(key); in test_check_private_key()
499 RSA *key = NULL; in test_check_public_key() local
501 ret = TEST_ptr(key = RSA_new()) in test_check_public_key()
503 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
507 && TEST_true(RSA_set0_key(key, n, e, NULL)); in test_check_public_key()
514 ret = TEST_true(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
517 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
521 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
525 && TEST_false(ossl_rsa_sp800_56b_check_public(key)) in test_check_public_key()
529 && TEST_false(ossl_rsa_sp800_56b_check_public(key)); in test_check_public_key()
531 RSA_free(key); in test_check_public_key()