Lines Matching refs:t
60 const rsa_test *t = tests[i]; in perform_rsa_tests() local
61 u32 modbits = t->modbits; in perform_rsa_tests()
67 ret = rsa_import_pub_key(&pub, t->n, (u16)t->nlen, t->e, (u16)t->elen); EG(ret, err1); in perform_rsa_tests()
68 if(t->dP == NULL){ in perform_rsa_tests()
75 …ret = rsa_import_simple_priv_key(&priv, t->n, (u16)t->nlen, t->d, (u16)t->dlen, NULL, 0, NULL, 0);… in perform_rsa_tests()
77 …ret = rsa_import_simple_priv_key(&priv_pq, t->n, (u16)t->nlen, t->d, (u16)t->dlen, t_->p, (u16)t_-… in perform_rsa_tests()
81 …import_crt_priv_key(&priv, t->p, (u16)t->plen, t->q, (u16)t->qlen, t->dP, (u16)t->dPlen, t->dQ, (u… in perform_rsa_tests()
88 switch(t->type){ in perform_rsa_tests()
92 if(t->salt != NULL){ in perform_rsa_tests()
94 …ret = rsaes_pkcs1_v1_5_encrypt(&pub, t->m, t->mlen, cipher, &clen, modbits, t->salt, t->saltlen); … in perform_rsa_tests()
96 MUST_HAVE((clen == t->reslen), ret, err1); in perform_rsa_tests()
97 ret = are_equal(t->res, cipher, t->reslen, &cmp); EG(ret, err1); in perform_rsa_tests()
102 ret = rsaes_pkcs1_v1_5_decrypt(&priv, t->res, t->reslen, cipher, &clen, modbits); EG(ret, err1); in perform_rsa_tests()
104 MUST_HAVE((clen == t->mlen), ret, err1); in perform_rsa_tests()
105 ret = are_equal(t->m, cipher, t->mlen, &cmp); EG(ret, err1); in perform_rsa_tests()
109 …ret = rsaes_pkcs1_v1_5_decrypt_hardened(&priv, &pub, t->res, t->reslen, cipher, &clen, modbits); E… in perform_rsa_tests()
111 MUST_HAVE((clen == t->mlen), ret, err1); in perform_rsa_tests()
112 ret = are_equal(t->m, cipher, t->mlen, &cmp); EG(ret, err1); in perform_rsa_tests()
119 if(t->salt != NULL){ in perform_rsa_tests()
121 …ret = rsaes_oaep_encrypt(&pub, t->m, t->mlen, cipher, &clen, modbits, NULL, 0, t->hash, t->hash, t… in perform_rsa_tests()
123 MUST_HAVE((clen == t->reslen), ret, err1); in perform_rsa_tests()
124 ret = are_equal(t->res, cipher, t->reslen, &cmp); EG(ret, err1); in perform_rsa_tests()
129 …ret = rsaes_oaep_decrypt(&priv, t->res, t->reslen, cipher, &clen, modbits, NULL, 0, t->hash, t->ha… in perform_rsa_tests()
131 MUST_HAVE((clen == t->mlen), ret, err1); in perform_rsa_tests()
132 ret = are_equal(t->m, cipher, t->mlen, &cmp); EG(ret, err1); in perform_rsa_tests()
136 …t = rsaes_oaep_decrypt_hardened(&priv, &pub, t->res, t->reslen, cipher, &clen, modbits, NULL, 0, t… in perform_rsa_tests()
138 MUST_HAVE((clen == t->mlen), ret, err1); in perform_rsa_tests()
139 ret = are_equal(t->m, cipher, t->mlen, &cmp); EG(ret, err1); in perform_rsa_tests()
146 MUST_HAVE((t->reslen) <= 0xffff, ret, err1); in perform_rsa_tests()
147 …ret = rsassa_pkcs1_v1_5_verify(&pub, t->m, t->mlen, t->res, (u16)(t->reslen), modbits, t->hash); E… in perform_rsa_tests()
149 … ret = rsassa_pkcs1_v1_5_sign(&priv, t->m, t->mlen, sig, &siglen, modbits, t->hash); EG(ret, err1); in perform_rsa_tests()
151 MUST_HAVE((siglen == t->reslen), ret, err1); in perform_rsa_tests()
152 ret = are_equal(t->res, sig, t->reslen, &cmp); EG(ret, err1); in perform_rsa_tests()
155 …ret = rsassa_pkcs1_v1_5_sign_hardened(&priv, &pub, t->m, t->mlen, sig, &siglen, modbits, t->hash);… in perform_rsa_tests()
157 MUST_HAVE((siglen == t->reslen), ret, err1); in perform_rsa_tests()
158 ret = are_equal(t->res, sig, t->reslen, &cmp); EG(ret, err1); in perform_rsa_tests()
163 if(t->salt == NULL){ in perform_rsa_tests()
166 ret = gen_hash_get_hash_sizes(t->hash, &digestsize, &blocksize); EG(ret, err1); in perform_rsa_tests()
167 MUST_HAVE((t->reslen) <= 0xffff, ret, err1); in perform_rsa_tests()
168 …ret = rsassa_pss_verify(&pub, t->m, t->mlen, t->res, (u16)(t->reslen), modbits, t->hash, t->hash, … in perform_rsa_tests()
171 MUST_HAVE((t->reslen) <= 0xffff, ret, err1); in perform_rsa_tests()
172 …ret = rsassa_pss_verify(&pub, t->m, t->mlen, t->res, (u16)(t->reslen), modbits, t->hash, t->hash, … in perform_rsa_tests()
174 if(t->salt != NULL){ in perform_rsa_tests()
178 …ret = rsassa_pss_sign(&priv, t->m, t->mlen, sig, &siglen, modbits, t->hash, t->hash, t->saltlen, t… in perform_rsa_tests()
180 MUST_HAVE((t->reslen) <= 0xffff, ret, err1); in perform_rsa_tests()
181 MUST_HAVE((siglen == (u16)(t->reslen)), ret, err1); in perform_rsa_tests()
182 ret = are_equal(t->res, sig, t->reslen, &cmp); EG(ret, err1); in perform_rsa_tests()
185 …t = rsassa_pss_sign_hardened(&priv, &pub, t->m, t->mlen, sig, &siglen, modbits, t->hash, t->hash, … in perform_rsa_tests()
187 MUST_HAVE((siglen == (u16)(t->reslen)), ret, err1); in perform_rsa_tests()
188 ret = are_equal(t->res, sig, t->reslen, &cmp); EG(ret, err1); in perform_rsa_tests()
200 ext_printf("[-] Test %s failed (modbits = %" PRIu32 ")\n", t->name, t->modbits); in perform_rsa_tests()
204 ext_printf("[+] Test %s passed (modbits = %" PRIu32 ")\n", t->name, t->modbits); in perform_rsa_tests()