Home
last modified time | relevance | path

Searched refs:tests (Results 1 – 25 of 75) sorted by relevance

123

/optee_os/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_test.c35 } tests[] = { in ccm_test()
131 for (x = 0; x < (sizeof(tests)/sizeof(tests[0])); x++) { in ccm_test()
142 tests[x].nonce, tests[x].noncelen, in ccm_test()
153 tests[x].nonce, tests[x].noncelen, in ccm_test()
161 …if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, tests[x].headerl… in ccm_test()
178 … if (compare_testvector(buf, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "CCM encrypt data", x)) { in ccm_test()
186 XMEMCPY(tag3, tests[x].tag, tests[x].taglen); in ccm_test()
191 tests[x].nonce, tests[x].noncelen, in ccm_test()
199 …if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, tests[x].headerl… in ccm_test()
217 …if (compare_testvector(buf2, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "CCM decrypt data", x)) { in ccm_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_test.c39 } tests[] = { in gcm_test()
348 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in gcm_test()
350 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
351 tests[x].IV, tests[x].IVlen, in gcm_test()
352 tests[x].A, tests[x].alen, in gcm_test()
353 (unsigned char*)tests[x].P, tests[x].ptlen, in gcm_test()
358 if (compare_testvector(out[0], tests[x].ptlen, tests[x].C, tests[x].ptlen, "GCM CT", x)) { in gcm_test()
368 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
369 tests[x].IV, tests[x].IVlen, in gcm_test()
370 tests[x].A, tests[x].alen, in gcm_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/eax/
A Deax_test.c40 } tests[] = { in eax_test()
226 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in eax_test()
228 if ((err = eax_encrypt_authenticate_memory(idx, tests[x].key, tests[x].keylen, in eax_test()
229 tests[x].nonce, tests[x].noncelen, tests[x].header, tests[x].headerlen, in eax_test()
230 tests[x].plaintext, tests[x].msglen, outct, outtag, &len)) != CRYPT_OK) { in eax_test()
233 if (compare_testvector(outtag, len, tests[x].tag, len, "EAX Tag", x) || in eax_test()
234 … compare_testvector(outct, tests[x].msglen, tests[x].ciphertext, tests[x].msglen, "EAX CT", x)) { in eax_test()
239 if ((err = eax_decrypt_verify_memory(idx, tests[x].key, tests[x].keylen, in eax_test()
240 tests[x].nonce, tests[x].noncelen, tests[x].header, tests[x].headerlen, in eax_test()
241 outct, tests[x].msglen, outct, outtag, len, &res)) != CRYPT_OK) { in eax_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/encauth/ocb/
A Docb_test.c31 } tests[] = { in ocb_test()
177 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in ocb_test()
179 if ((err = ocb_encrypt_authenticate_memory(idx, tests[x].key, 16, in ocb_test()
180 tests[x].nonce, tests[x].pt, tests[x].ptlen, outct, outtag, &len)) != CRYPT_OK) { in ocb_test()
184 if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "OCB Tag", x) || in ocb_test()
185 compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB CT", x)) { in ocb_test()
189 … if ((err = ocb_decrypt_verify_memory(idx, tests[x].key, 16, tests[x].nonce, outct, tests[x].ptlen, in ocb_test()
190 outct, tests[x].tag, len, &res)) != CRYPT_OK) { in ocb_test()
193 …if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)… in ocb_test()
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
A Docb3_test.c35 } tests[] = { in ocb3_test()
219 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in ocb3_test()
224tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, in ocb3_test()
225tests[x].ptlen != 0 ? tests[x].pt : NULL, tests[x].ptlen, in ocb3_test()
226tests[x].ptlen != 0 ? outct : NULL, outtag, &len)) != CRYPT_OK) { in ocb3_test()
230 if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "OCB3 Tag", x) || in ocb3_test()
231 … compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB3 CT", x)) { in ocb3_test()
238tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, in ocb3_test()
239 tests[x].ptlen != 0 ? outct : NULL, tests[x].ptlen, in ocb3_test()
240tests[x].ptlen != 0 ? outct : NULL, tests[x].tag, len, &res)) != CRYPT_OK) { in ocb3_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/modes/xts/
A Dxts_test.c88 } tests[] = { in xts_test()
224 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in xts_test()
229 if ((j == 1) && ((tests[i].PTLEN < 32) || (tests[i].PTLEN % 32))) { in xts_test()
235 len = tests[i].PTLEN / 2; in xts_test()
237 err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen / 2, 0, &xts); in xts_test()
242 seq = tests[i].seqnum; in xts_test()
248 err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); in xts_test()
254 err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); in xts_test()
266 … if (compare_testvector(OUT, tests[i].PTLEN, tests[i].CTX, tests[i].PTLEN, "XTS encrypt", i)) { in xts_test()
273 err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); in xts_test()
[all …]
/optee_os/core/lib/libtomcrypt/src/modes/ctr/
A Dctr_test.c27 } tests[] = { in ctr_test()
61 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in ctr_test()
62 …if ((err = ctr_start(idx, tests[x].IV, tests[x].key, tests[x].keylen, 0, CTR_COUNTER_BIG_ENDIAN|LT… in ctr_test()
65 if ((err = ctr_encrypt(tests[x].pt, buf, tests[x].msglen, &ctr)) != CRYPT_OK) { in ctr_test()
69 if (compare_testvector(buf, tests[x].msglen, tests[x].ct, tests[x].msglen, "CTR", x)) { in ctr_test()
/optee_os/core/lib/libtomcrypt/src/modes/lrw/
A Dlrw_test.c30 } tests[] = { in lrw_test()
83 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in lrw_test()
85 … if ((err = lrw_start(idx, tests[x].IV, tests[x].key, 16, tests[x].tweak, 0, &lrw)) != CRYPT_OK) { in lrw_test()
90 if (compare_testvector(tests[x].expected_tweak, 16, lrw.pad, 16, "LRW Tweak", x)) { in lrw_test()
96 if ((err = lrw_encrypt(tests[x].P, buf[0], 16, &lrw)) != CRYPT_OK) { in lrw_test()
101 if (compare_testvector(buf[0], 16, tests[x].C, 16, "LRW Encrypt", x)) { in lrw_test()
107 if ((err = lrw_setiv(tests[x].IV, 16, &lrw)) != CRYPT_OK) { in lrw_test()
117 if (compare_testvector(buf[1], 16, tests[x].P, 16, "LRW Decrypt", x)) { in lrw_test()
/optee_os/core/lib/libtomcrypt/src/mac/omac/
A Domac_test.c31 } tests[] = { in omac_test()
86 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in omac_test()
88 …if ((err = omac_memory(idx, tests[x].key, tests[x].keylen, tests[x].msg, tests[x].msglen, out, &le… in omac_test()
92 if (compare_testvector(out, len, tests[x].tag, sizeof(tests[x].tag), "OMAC", x) != 0) { in omac_test()
/optee_os/core/lib/libtomcrypt/src/mac/pmac/
A Dpmac_test.c32 } tests[] = { in pmac_test()
134 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in pmac_test()
136 …if ((err = pmac_memory(idx, tests[x].key, 16, tests[x].msg, tests[x].msglen, outtag, &len)) != CRY… in pmac_test()
140 if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "PMAC", x)) { in pmac_test()
/optee_os/core/lib/libtomcrypt/src/mac/pelican/
A Dpelican_test.c27 } tests[] = { in pelican_test()
90 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in pelican_test()
91 if ((err = pelican_init(&pel, tests[x].K, tests[x].keylen)) != CRYPT_OK) { in pelican_test()
94 if ((err = pelican_process(&pel, tests[x].MSG, tests[x].ptlen)) != CRYPT_OK) { in pelican_test()
101 if (compare_testvector(out, 16, tests[x].T, 16, "PELICAN", x)) { in pelican_test()
/optee_os/core/lib/libtomcrypt/src/mac/f9/
A Df9_test.c30 } tests[] = { in f9_test()
58 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in f9_test()
60 … if ((err = f9_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { in f9_test()
63 if (compare_testvector(T, taglen, tests[x].T, 4, "F9", x)) { in f9_test()
/optee_os/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_test.c30 } tests[] = { in xcbc_test()
108 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in xcbc_test()
110 …if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK)… in xcbc_test()
113 if (compare_testvector(T, taglen, tests[x].T, 16, "XCBC", x)) { in xcbc_test()
/optee_os/core/lib/libtomcrypt/src/hashes/
A Dblake2b.c455 } tests[] = { in blake2b_512_test()
484 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in blake2b_512_test()
486 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_512", i)) { in blake2b_512_test()
506 } tests[] = { in blake2b_384_test()
531 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in blake2b_384_test()
533 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_384", i)) { in blake2b_384_test()
553 } tests[] = { in blake2b_256_test()
584 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in blake2b_256_test()
586 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_256", i)) { in blake2b_256_test()
606 } tests[] = { in blake2b_160_test()
[all …]
A Dblake2s.c443 } tests[] = { in blake2s_256_test()
474 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in blake2s_256_test()
476 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_256", i)) { in blake2s_256_test()
497 } tests[] = { in blake2s_224_test()
518 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in blake2s_224_test()
520 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_224", i)) { in blake2s_224_test()
541 } tests[] = { in blake2s_160_test()
560 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in blake2s_160_test()
562 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_160", i)) { in blake2s_160_test()
583 } tests[] = { in blake2s_128_test()
[all …]
A Dmd2.c197 } tests[] = { in md2_test()
234 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in md2_test()
236 md2_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in md2_test()
238 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD2", i)) { in md2_test()
/optee_os/core/lib/libtomcrypt/src/hashes/sha2/
A Dsha224.c94 } tests[] = { in sha224_test()
113 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha224_test()
115 sha224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in sha224_test()
117 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA224", i)) { in sha224_test()
A Dsha384.c96 } tests[] = { in sha384_test()
119 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha384_test()
121 sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in sha384_test()
123 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA384", i)) { in sha384_test()
A Dsha512_224.c96 } tests[] = { in sha512_224_test()
115 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha512_224_test()
117 sha512_224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in sha512_224_test()
119 … if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-224", i)) { in sha512_224_test()
A Dsha512_256.c96 } tests[] = { in sha512_256_test()
115 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha512_256_test()
117 sha512_256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in sha512_256_test()
119 … if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-265", i)) { in sha512_256_test()
/optee_os/core/lib/libtomcrypt/src/ciphers/
A Drc2.c307 } tests[] = { in rc2_test()
356 for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) { in rc2_test()
358 if (tests[x].bits == (tests[x].keylen * 8)) { in rc2_test()
359 if ((err = rc2_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { in rc2_test()
364 … if ((err = rc2_setup_ex(tests[x].key, tests[x].keylen, tests[x].bits, 0, &skey)) != CRYPT_OK) { in rc2_test()
369 rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); in rc2_test()
372 if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC2 CT", x) || in rc2_test()
373 compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC2 PT", x)) { in rc2_test()
A Dmulti2.c197 } tests[] = { in multi2_test() local
252 for (x = 1; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in multi2_test()
253 if ((err = multi2_setup(tests[x].key, 40, tests[x].rounds, &skey)) != CRYPT_OK) { in multi2_test()
256 if ((err = multi2_ecb_encrypt(tests[x].pt, buf, &skey)) != CRYPT_OK) { in multi2_test()
260 if (compare_testvector(buf, 8, tests[x].ct, 8, "Multi2 Encrypt", x)) { in multi2_test()
267 if (compare_testvector(buf, 8, tests[x].pt, 8, "Multi2 Decrypt", x)) { in multi2_test()
275 if ((err = multi2_setup(tests[0].key, 40, x, &skey)) != CRYPT_OK) { in multi2_test()
278 if ((err = multi2_ecb_encrypt(tests[0].pt, ct, &skey)) != CRYPT_OK) { in multi2_test()
284 if (compare_testvector(buf, 8, tests[0].pt, 8, "Multi2 Rounds", x)) { in multi2_test()
/optee_os/core/lib/libtomcrypt/
A Dsha1_accel.c175 } tests[] = { in sha1_test()
192 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha1_test()
194 sha1_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in sha1_test()
196 if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { in sha1_test()
A Dsha256_accel.c182 } tests[] = { in sha256_test()
201 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha256_test()
203 sha256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); in sha256_test()
205 if (XMEMCMP(tmp, tests[i].hash, 32) != 0) { in sha256_test()
/optee_os/core/lib/libtomcrypt/src/hashes/whirl/
A Dwhirl.c210 } tests[] = { in whirlpool_test()
289 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { in whirlpool_test()
291 whirlpool_process(&md, (unsigned char *)tests[i].msg, tests[i].len); in whirlpool_test()
293 … if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "WHIRLPOOL", i)) { in whirlpool_test()

Completed in 27 milliseconds

123