Lines Matching refs:test_data
438 const struct hash_test_data *test_data = NULL; in test_hash_result() local
448 test_data = &hash_data_set[i]; in test_hash_result()
449 if (test_data->algo == 0) { in test_hash_result()
454 dev = crypto_get_device(test_data->algo); in test_hash_result()
457 test_data->algo_name, in test_hash_result()
458 test_data->mode_name); in test_hash_result()
462 csha_ctx.algo = test_data->algo; in test_hash_result()
463 csha_ctx.length = test_data->data_len; in test_hash_result()
466 if (test_data->key) { in test_hash_result()
468 (u8 *)test_data->key, in test_hash_result()
469 test_data->key_len); in test_hash_result()
470 ret |= crypto_hmac_update(dev, (void *)test_data->data, in test_hash_result()
471 test_data->data_len); in test_hash_result()
479 ret |= crypto_sha_update(dev, (void *)test_data->data, in test_hash_result()
480 test_data->data_len); in test_hash_result()
490 test_hash_perf(dev, test_data->algo, in test_hash_result()
491 test_data->key, test_data->key_len, &MBps); in test_hash_result()
492 print_result_MBps(test_data->algo_name, test_data->mode_name, in test_hash_result()
493 "", MBps, test_data->hash, out, in test_hash_result()
494 test_data->hash_len); in test_hash_result()
501 test_data->algo_name, test_data->mode_name); in test_hash_result()
507 const struct cipher_test_data *test_data = NULL; in test_cipher_result() local
517 test_data = &cipher_data_set[i]; in test_cipher_result()
518 if (test_data->algo == 0) { in test_cipher_result()
523 dev = crypto_get_device(test_data->algo); in test_cipher_result()
526 test_data->algo_name, test_data->mode_name); in test_cipher_result()
532 ctx.algo = test_data->algo; in test_cipher_result()
533 ctx.mode = test_data->mode; in test_cipher_result()
534 ctx.key = test_data->key; in test_cipher_result()
535 ctx.twk_key = test_data->twk_key; in test_cipher_result()
536 ctx.key_len = test_data->key_len; in test_cipher_result()
537 ctx.iv = test_data->iv; in test_cipher_result()
538 ctx.iv_len = test_data->iv_len; in test_cipher_result()
546 ret = crypto_mac(dev, &ctx, test_data->plain, in test_cipher_result()
547 test_data->plain_len, out); in test_cipher_result()
550 test_data->plain, test_data->plain_len, in test_cipher_result()
551 test_data->aad, test_data->aad_len, in test_cipher_result()
554 ret = crypto_cipher(dev, &ctx, test_data->plain, in test_cipher_result()
555 out, test_data->plain_len, true); in test_cipher_result()
559 if (test_data->tag && in test_cipher_result()
560 memcmp(test_data->tag, tag, test_data->tag_len) != 0) { in test_cipher_result()
562 dump_hex("expect", test_data->tag, test_data->tag_len); in test_cipher_result()
563 dump_hex("actual", tag, test_data->tag_len); in test_cipher_result()
567 print_result_MBps(test_data->algo_name, test_data->mode_name, in test_cipher_result()
568 "encrypt", MBps, test_data->cipher, out, in test_cipher_result()
569 test_data->cipher_len); in test_cipher_result()
573 ret = crypto_cipher(dev, &ctx, test_data->cipher, in test_cipher_result()
574 out, test_data->cipher_len, false); in test_cipher_result()
578 print_result_MBps(test_data->algo_name, in test_cipher_result()
579 test_data->mode_name, in test_cipher_result()
581 test_data->plain, out, in test_cipher_result()
582 test_data->plain_len); in test_cipher_result()
589 test_data->algo_name, test_data->mode_name, ret); in test_cipher_result()
595 const struct rsa_test_data *test_data = NULL; in test_rsa_result() local
619 test_data = &rsa_data_set[i]; in test_rsa_result()
620 if (test_data->algo == 0) { in test_rsa_result()
625 dev = crypto_get_device(test_data->algo); in test_rsa_result()
628 test_data->algo_name, test_data->mode_name); in test_rsa_result()
634 rsa_key.algo = test_data->algo; in test_rsa_result()
635 rsa_key.n = (u32 *)test_data->n; in test_rsa_result()
636 rsa_key.e = (u32 *)test_data->d; in test_rsa_result()
638 rsa_key.c = (u32 *)test_data->c; in test_rsa_result()
643 (u8 *)test_data->sign_in, hard_out); in test_rsa_result()
649 print_result_ms(test_data->algo_name, test_data->mode_name, in test_rsa_result()
650 "sign", time_cost, test_data->sign_out, in test_rsa_result()
651 hard_out, test_data->n_len); in test_rsa_result()
656 memcpy(e_tmp, test_data->e, test_data->e_len); in test_rsa_result()
657 rsa_key.algo = test_data->algo; in test_rsa_result()
658 rsa_key.n = (u32 *)test_data->n; in test_rsa_result()
661 rsa_key.c = (u32 *)test_data->c; in test_rsa_result()
666 (u8 *)test_data->sign_out, hard_out); in test_rsa_result()
673 print_result_ms(test_data->algo_name, test_data->mode_name, in test_rsa_result()
674 "verify", time_cost, test_data->sign_in, in test_rsa_result()
675 hard_out, test_data->n_len); in test_rsa_result()
688 test_data->algo_name, test_data->mode_name); in test_rsa_result()
694 const struct ec_test_data *test_data = NULL; in test_ec_result() local
702 test_data = &ec_data_set[i]; in test_ec_result()
703 if (test_data->algo == 0) { in test_ec_result()
708 dev = crypto_get_device(test_data->algo); in test_ec_result()
711 test_data->algo_name, ""); in test_ec_result()
717 ec_key.algo = test_data->algo; in test_ec_result()
718 ec_key.x = (u32 *)test_data->pub_x; in test_ec_result()
719 ec_key.y = (u32 *)test_data->pub_y; in test_ec_result()
723 (u8 *)test_data->hash_in, in test_ec_result()
724 test_data->hash_in_len, in test_ec_result()
725 (u8 *)test_data->sign_in); in test_ec_result()
733 test_data->algo_name, "verify", time_cost); in test_ec_result()
740 printf("%s test error!\n", test_data->algo_name); in test_ec_result()