Lines Matching refs:test_data
403 const struct hash_test_data *test_data = NULL; in test_hash_result() local
413 test_data = &hash_data_set[i]; in test_hash_result()
414 if (test_data->algo == 0) { in test_hash_result()
419 dev = crypto_get_device(test_data->algo); in test_hash_result()
422 test_data->algo_name, in test_hash_result()
423 test_data->mode_name); in test_hash_result()
427 csha_ctx.algo = test_data->algo; in test_hash_result()
428 csha_ctx.length = test_data->data_len; in test_hash_result()
431 if (test_data->key) { in test_hash_result()
433 (u8 *)test_data->key, in test_hash_result()
434 test_data->key_len); in test_hash_result()
435 ret |= crypto_hmac_update(dev, (void *)test_data->data, in test_hash_result()
436 test_data->data_len); in test_hash_result()
444 ret |= crypto_sha_update(dev, (void *)test_data->data, in test_hash_result()
445 test_data->data_len); in test_hash_result()
455 test_hash_perf(dev, test_data->algo, in test_hash_result()
456 test_data->key, test_data->key_len, &MBps); in test_hash_result()
457 print_result_MBps(test_data->algo_name, test_data->mode_name, in test_hash_result()
458 "", MBps, test_data->hash, out, in test_hash_result()
459 test_data->hash_len); in test_hash_result()
466 test_data->algo_name, test_data->mode_name); in test_hash_result()
472 const struct cipher_test_data *test_data = NULL; in test_cipher_result() local
482 test_data = &cipher_data_set[i]; in test_cipher_result()
483 if (test_data->algo == 0) { in test_cipher_result()
488 dev = crypto_get_device(test_data->algo); in test_cipher_result()
491 test_data->algo_name, test_data->mode_name); in test_cipher_result()
497 ctx.algo = test_data->algo; in test_cipher_result()
498 ctx.mode = test_data->mode; in test_cipher_result()
499 ctx.key = test_data->key; in test_cipher_result()
500 ctx.twk_key = test_data->twk_key; in test_cipher_result()
501 ctx.key_len = test_data->key_len; in test_cipher_result()
502 ctx.iv = test_data->iv; in test_cipher_result()
503 ctx.iv_len = test_data->iv_len; in test_cipher_result()
511 ret = crypto_mac(dev, &ctx, test_data->plain, in test_cipher_result()
512 test_data->plain_len, out); in test_cipher_result()
515 test_data->plain, test_data->plain_len, in test_cipher_result()
516 test_data->aad, test_data->aad_len, in test_cipher_result()
519 ret = crypto_cipher(dev, &ctx, test_data->plain, in test_cipher_result()
520 out, test_data->plain_len, true); in test_cipher_result()
524 if (test_data->tag && in test_cipher_result()
525 memcmp(test_data->tag, tag, test_data->tag_len) != 0) { in test_cipher_result()
527 dump_hex("expect", test_data->tag, test_data->tag_len); in test_cipher_result()
528 dump_hex("actual", tag, test_data->tag_len); in test_cipher_result()
532 print_result_MBps(test_data->algo_name, test_data->mode_name, in test_cipher_result()
533 "encrypt", MBps, test_data->cipher, out, in test_cipher_result()
534 test_data->cipher_len); in test_cipher_result()
538 ret = crypto_cipher(dev, &ctx, test_data->cipher, in test_cipher_result()
539 out, test_data->cipher_len, false); in test_cipher_result()
543 print_result_MBps(test_data->algo_name, in test_cipher_result()
544 test_data->mode_name, in test_cipher_result()
546 test_data->plain, out, in test_cipher_result()
547 test_data->plain_len); in test_cipher_result()
554 test_data->algo_name, test_data->mode_name, ret); in test_cipher_result()
560 const struct rsa_test_data *test_data = NULL; in test_rsa_result() local
584 test_data = &rsa_data_set[i]; in test_rsa_result()
585 if (test_data->algo == 0) { in test_rsa_result()
590 dev = crypto_get_device(test_data->algo); in test_rsa_result()
593 test_data->algo_name, test_data->mode_name); in test_rsa_result()
599 rsa_key.algo = test_data->algo; in test_rsa_result()
600 rsa_key.n = (u32 *)test_data->n; in test_rsa_result()
601 rsa_key.e = (u32 *)test_data->d; in test_rsa_result()
603 rsa_key.c = (u32 *)test_data->c; in test_rsa_result()
608 (u8 *)test_data->sign_in, hard_out); in test_rsa_result()
614 print_result_ms(test_data->algo_name, test_data->mode_name, in test_rsa_result()
615 "sign", time_cost, test_data->sign_out, in test_rsa_result()
616 hard_out, test_data->n_len); in test_rsa_result()
621 memcpy(e_tmp, test_data->e, test_data->e_len); in test_rsa_result()
622 rsa_key.algo = test_data->algo; in test_rsa_result()
623 rsa_key.n = (u32 *)test_data->n; in test_rsa_result()
626 rsa_key.c = (u32 *)test_data->c; in test_rsa_result()
631 (u8 *)test_data->sign_out, hard_out); in test_rsa_result()
638 print_result_ms(test_data->algo_name, test_data->mode_name, in test_rsa_result()
639 "verify", time_cost, test_data->sign_in, in test_rsa_result()
640 hard_out, test_data->n_len); in test_rsa_result()
653 test_data->algo_name, test_data->mode_name); in test_rsa_result()