Lines Matching refs:t

85 		const wycheproof_ecdsa_test *t = wycheproof_ecdsa_all_tests[i];  in check_wycheproof_ecdsa()  local
89 if (t == NULL){ in check_wycheproof_ecdsa()
98 ret = import_params(&params, t->curve); in check_wycheproof_ecdsa()
106 …ret = ec_pub_key_import_from_aff_buf(&pub_key, &params, t->pubkey, (u8)(t->pubkeylen), t->sig_alg); in check_wycheproof_ecdsa()
114 …ret = ec_verify(t->sig, (u8)(t->siglen), &pub_key, t->msg, t->msglen, t->sig_alg, t->hash, NULL, 0… in check_wycheproof_ecdsa()
116 if ((t->result == 1) && ret) { in check_wycheproof_ecdsa()
117 …[-] Error when verifying ECDSA test %d / %s (verification NOK while must be valid)\n", i, t->name); in check_wycheproof_ecdsa()
118 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdsa()
123 if ((t->result == -1) && !ret) { in check_wycheproof_ecdsa()
124 …-] Error when verifying ECDSA test %d / %s (verification OK while must be invalid)\n", i, t->name); in check_wycheproof_ecdsa()
125 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdsa()
130 if (t->result == 0) { in check_wycheproof_ecdsa()
138 ext_printf("\t[~] ECDSA test %d / %s (verification %d while acceptable)\n", i, t->name, ret); in check_wycheproof_ecdsa()
139 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_ecdsa()
169 const wycheproof_eddsa_test *t = wycheproof_eddsa_all_tests[i]; in check_wycheproof_eddsa() local
177 if (t == NULL){ in check_wycheproof_eddsa()
189 ret = import_params(&params, t->curve); in check_wycheproof_eddsa()
197 ret = eddsa_import_pub_key(&pub_key, t->pubkey, (u8)(t->pubkeylen), &params, t->sig_alg); in check_wycheproof_eddsa()
204 ret = eddsa_import_priv_key(&priv_key, t->privkey, (u8)(t->privkeylen), &params, t->sig_alg); in check_wycheproof_eddsa()
218 ret = eddsa_export_pub_key(&pub_key, exported_pub_key, (u8)(t->pubkeylen)); in check_wycheproof_eddsa()
225 ret = are_equal(t->pubkey, &exported_pub_key, (u8)(t->pubkeylen), &check); OPENMP_EG(ret, err); in check_wycheproof_eddsa()
232 …ret = ec_verify(t->sig, (u8)(t->siglen), &pub_key, t->msg, t->msglen, t->sig_alg, t->hash, NULL, 0… in check_wycheproof_eddsa()
234 if ((t->result == 1) && ret) { in check_wycheproof_eddsa()
235 …[-] Error when verifying EDDSA test %d / %s (verification NOK while must be valid)\n", i, t->name); in check_wycheproof_eddsa()
236 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_eddsa()
241 if ((t->result == -1) && !ret) { in check_wycheproof_eddsa()
242 …-] Error when verifying EDDSA test %d / %s (verification OK while must be invalid)\n", i, t->name); in check_wycheproof_eddsa()
243 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_eddsa()
248 if (t->result == 0) { in check_wycheproof_eddsa()
257 ext_printf("\t[~] EDDSA test %d / %s (verification %d while acceptable)\n", i, t->name, ret); in check_wycheproof_eddsa()
258 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_eddsa()
290 const wycheproof_xdh_test *t = wycheproof_xdh_all_tests[i]; in check_wycheproof_xdh() local
296 if (t == NULL){ in check_wycheproof_xdh()
305 if(t->xdh_alg == X25519){ in check_wycheproof_xdh()
306 OPENMP_MUST_HAVE(((t->curve) == &wei25519_str_params), ret, err); in check_wycheproof_xdh()
311 if(t->xdh_alg == X448){ in check_wycheproof_xdh()
312 OPENMP_MUST_HAVE(((t->curve) == &wei448_str_params), ret, err); in check_wycheproof_xdh()
322 if(t->privkeylen != alglen){ in check_wycheproof_xdh()
323 if(t->result != -1){ in check_wycheproof_xdh()
324 …ext_printf("[-] Error: XDH tests error, unkown private key length %d with valid result\n", t->priv… in check_wycheproof_xdh()
325 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
333 if(t->peerpubkeylen != alglen){ in check_wycheproof_xdh()
334 if(t->result != -1){ in check_wycheproof_xdh()
335 …] Error: XDH tests error, unkown peer public key length %d with valid result\n", t->peerpubkeylen); in check_wycheproof_xdh()
336 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
344 if(t->sharedsecretlen != alglen){ in check_wycheproof_xdh()
345 if(t->result != -1){ in check_wycheproof_xdh()
346 …ext_printf("[-] Error: XDH tests error, unkown shared secret length %d with valid result\n", t->sh… in check_wycheproof_xdh()
347 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
355 if((t->ourpubkeylen != 0) && (t->ourpubkeylen != alglen)){ in check_wycheproof_xdh()
356 if(t->result != -1){ in check_wycheproof_xdh()
357 …ext_printf("[-] Error: XDH tests error, unkown our public key length %d with valid result\n", t->o… in check_wycheproof_xdh()
358 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
367 if(t->xdh_alg == X25519){ in check_wycheproof_xdh()
369 ret = x25519_init_pub_key(t->privkey, pubkey_check); in check_wycheproof_xdh()
372 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
376 if(t->ourpubkeylen != 0){ in check_wycheproof_xdh()
378 ret = are_equal(t->ourpubkey, pubkey_check, alglen, &check); OPENMP_EG(ret, err); in check_wycheproof_xdh()
381 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
387 ret = x25519_derive_secret(t->privkey, t->peerpubkey, sharedsecret_check); in check_wycheproof_xdh()
390 if(t->result == 0){ in check_wycheproof_xdh()
394 …ext_printf("\t[~] XDH test %d / %s (shared secret derivation NOK while acceptable)\n", i, t->name); in check_wycheproof_xdh()
395 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_xdh()
401 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
405 if(t->result == -1){ in check_wycheproof_xdh()
407 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
412 ret = are_equal(t->sharedsecret, sharedsecret_check, alglen, &check); OPENMP_EG(ret, err); in check_wycheproof_xdh()
415 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
422 if(t->xdh_alg == X448){ in check_wycheproof_xdh()
424 ret = x448_init_pub_key(t->privkey, pubkey_check); in check_wycheproof_xdh()
427 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
431 if(t->ourpubkeylen != 0){ in check_wycheproof_xdh()
433 ret = are_equal(t->ourpubkey, pubkey_check, alglen, &check); OPENMP_EG(ret, err); in check_wycheproof_xdh()
436 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
442 ret = x448_derive_secret(t->privkey, t->peerpubkey, sharedsecret_check); in check_wycheproof_xdh()
445 if(t->result == 0){ in check_wycheproof_xdh()
449 …ext_printf("\t[~] XDH test %d / %s (shared secret derivation NOK while acceptable)\n", i, t->name); in check_wycheproof_xdh()
450 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_xdh()
456 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
459 if(t->result == -1){ in check_wycheproof_xdh()
461 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
466 ret = are_equal(t->sharedsecret, sharedsecret_check, alglen, &check); OPENMP_EG(ret, err); in check_wycheproof_xdh()
469 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_xdh()
477 if (t->result == 0) { in check_wycheproof_xdh()
481 ext_printf("\t[~] XDH test %d / %s (shared secret OK while acceptable)\n", i, t->name); in check_wycheproof_xdh()
482 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_xdh()
554 const wycheproof_ecdh_test *t = wycheproof_ecdh_all_tests[i]; in check_wycheproof_ecdh() local
566 if (t == NULL){ in check_wycheproof_ecdh()
583 ret = import_params(&params, t->curve); in check_wycheproof_ecdh()
608 …ret = ec_priv_key_import_from_buf(&priv_key, &params, t->privkey, (u8)(t->privkeylen), t->ecdh_alg… in check_wycheproof_ecdh()
615 if(t->ourpubkeylen != 0){ in check_wycheproof_ecdh()
617 …t = ec_pub_key_import_from_aff_buf(&ourpub_key, &params, t->ourpubkey, (u8)(t->ourpubkeylen), t->e… in check_wycheproof_ecdh()
618 if (ret && (t->result >= 0)) { in check_wycheproof_ecdh()
620 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
647 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
654 if(t->compressed > 0){ in check_wycheproof_ecdh()
656 …t = uncompress_ecc_point(&params, t->peerpubkey, (u8)(t->peerpubkeylen), serialized_pub_key, seria… in check_wycheproof_ecdh()
657 if ((ret) && (t->result >= 0)) { in check_wycheproof_ecdh()
659 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
666 if((t->peerpubkeylen != serialized_pub_key_size) && (t->result >= 0)){ in check_wycheproof_ecdh()
667 …CDH tests error when checking our public key size, got %d instead of %d\n", t->peerpubkeylen, seri… in check_wycheproof_ecdh()
668 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
672 …ret = local_memcpy(serialized_pub_key, t->peerpubkey, serialized_pub_key_size); OPENMP_EG(ret, err… in check_wycheproof_ecdh()
676 if ((ret) && (t->result >= 0)) { in check_wycheproof_ecdh()
678 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
682 if((!ret) && (t->result == -1)){ in check_wycheproof_ecdh()
684 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
688 if(t->result == -1){ in check_wycheproof_ecdh()
691 if(sharedsecretsize != t->sharedsecretlen){ in check_wycheproof_ecdh()
692 …CDH tests error, bad shared secret size %d instead of %d\n", sharedsecretsize, t->sharedsecretlen); in check_wycheproof_ecdh()
693 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
698 …ret = are_equal(sharedsecret_check, t->sharedsecret, sharedsecretsize, &check); OPENMP_EG(ret, err… in check_wycheproof_ecdh()
701 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
706 if (t->result == 0) { in check_wycheproof_ecdh()
710 ext_printf("\t[~] ECDH test %d / %s (shared secret OK while acceptable)\n", i, t->name); in check_wycheproof_ecdh()
711 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_ecdh()
743 const wycheproof_hmac_test *t = wycheproof_hmac_all_tests[i]; in check_wycheproof_hmac() local
747 if (t == NULL){ in check_wycheproof_hmac()
758 ret = hmac(t->key, t->keylen, t->hash, t->msg, t->msglen, hmac_res, &hlen); in check_wycheproof_hmac()
761 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_hmac()
765 if((hlen < t->taglen) && (t->result >= 0)){ in check_wycheproof_hmac()
766 ext_printf("[-] Error: HMAC tests error: size error %d < %d\n", hlen, t->taglen); in check_wycheproof_hmac()
767 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_hmac()
772 ret = are_equal(hmac_res, t->tag, t->taglen, &check); OPENMP_EG(ret, err); in check_wycheproof_hmac()
773 if((!check) && (t->result >= 0)){ in check_wycheproof_hmac()
775 ext_printf(" (comment = %s)\n", t->comment); in check_wycheproof_hmac()
780 if (t->result == 0) { in check_wycheproof_hmac()
784 ext_printf("\t[~] HMAC test %d / %s (shared secret OK while acceptable)\n", i, t->name); in check_wycheproof_hmac()
785 ext_printf("\t (comment = %s)\n", t->comment); in check_wycheproof_hmac()