Home
last modified time | relevance | path

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

123

/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_test.c28 } tests[] = { in ccm_test()
124 for (x = 0; x < (sizeof(tests)/sizeof(tests[0])); x++) { in ccm_test()
135 tests[x].nonce, tests[x].noncelen, in ccm_test()
146 tests[x].nonce, tests[x].noncelen, in ccm_test()
154 …if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, tests[x].headerl… in ccm_test()
171 … if (compare_testvector(buf, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "CCM encrypt data", x)) { in ccm_test()
179 XMEMCPY(tag3, tests[x].tag, tests[x].taglen); in ccm_test()
184 tests[x].nonce, tests[x].noncelen, in ccm_test()
192 …if ((err = ccm_init(&ccm, idx, tests[x].key, 16, tests[x].ptlen, tests[x].taglen, tests[x].headerl… in ccm_test()
210 …if (compare_testvector(buf2, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "CCM decrypt data", x)) { in ccm_test()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/
A Deax_test.c33 } tests[] = { in eax_test()
219 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in eax_test()
221 if ((err = eax_encrypt_authenticate_memory(idx, tests[x].key, tests[x].keylen, in eax_test()
222 tests[x].nonce, tests[x].noncelen, tests[x].header, tests[x].headerlen, in eax_test()
223 tests[x].plaintext, tests[x].msglen, outct, outtag, &len)) != CRYPT_OK) { in eax_test()
226 if (compare_testvector(outtag, len, tests[x].tag, len, "EAX Tag", x) || in eax_test()
227 … compare_testvector(outct, tests[x].msglen, tests[x].ciphertext, tests[x].msglen, "EAX CT", x)) { in eax_test()
232 if ((err = eax_decrypt_verify_memory(idx, tests[x].key, tests[x].keylen, in eax_test()
233 tests[x].nonce, tests[x].noncelen, tests[x].header, tests[x].headerlen, in eax_test()
234 outct, tests[x].msglen, outct, outtag, len, &res)) != CRYPT_OK) { in eax_test()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/
A Dgcm_test.c32 } tests[] = { in gcm_test()
341 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in gcm_test()
343 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
344 tests[x].IV, tests[x].IVlen, in gcm_test()
345 tests[x].A, tests[x].alen, in gcm_test()
346 (unsigned char*)tests[x].P, tests[x].ptlen, in gcm_test()
351 if (compare_testvector(out[0], tests[x].ptlen, tests[x].C, tests[x].ptlen, "GCM CT", x)) { in gcm_test()
361 if ((err = gcm_memory(idx, tests[x].K, tests[x].keylen, in gcm_test()
362 tests[x].IV, tests[x].IVlen, in gcm_test()
363 tests[x].A, tests[x].alen, in gcm_test()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb/
A Docb_test.c24 } tests[] = { in ocb_test()
170 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in ocb_test()
172 if ((err = ocb_encrypt_authenticate_memory(idx, tests[x].key, 16, in ocb_test()
173 tests[x].nonce, tests[x].pt, tests[x].ptlen, outct, outtag, &len)) != CRYPT_OK) { in ocb_test()
177 if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "OCB Tag", x) || in ocb_test()
178 compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB CT", x)) { in ocb_test()
182 … if ((err = ocb_decrypt_verify_memory(idx, tests[x].key, 16, tests[x].nonce, outct, tests[x].ptlen, in ocb_test()
183 outct, tests[x].tag, len, &res)) != CRYPT_OK) { in ocb_test()
186 …if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)… in ocb_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/ctr/
A Dctr_test.c20 } tests[] = { in ctr_test()
54 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in ctr_test()
55 …if ((err = ctr_start(idx, tests[x].IV, tests[x].key, tests[x].keylen, 0, CTR_COUNTER_BIG_ENDIAN|LT… in ctr_test()
58 if ((err = ctr_encrypt(tests[x].pt, buf, tests[x].msglen, &ctr)) != CRYPT_OK) { in ctr_test()
62 if (compare_testvector(buf, tests[x].msglen, tests[x].ct, tests[x].msglen, "CTR", x)) { in ctr_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/
A Docb3_test.c28 } tests[] = { in ocb3_test()
212 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in ocb3_test()
217tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, in ocb3_test()
218tests[x].ptlen != 0 ? tests[x].pt : NULL, tests[x].ptlen, in ocb3_test()
219tests[x].ptlen != 0 ? outct : NULL, outtag, &len)) != CRYPT_OK) { in ocb3_test()
223 if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "OCB3 Tag", x) || in ocb3_test()
224 … compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB3 CT", x)) { in ocb3_test()
231tests[x].aadlen != 0 ? tests[x].aad : NULL, tests[x].aadlen, in ocb3_test()
232 tests[x].ptlen != 0 ? outct : NULL, tests[x].ptlen, in ocb3_test()
233tests[x].ptlen != 0 ? outct : NULL, tests[x].tag, len, &res)) != CRYPT_OK) { in ocb3_test()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/omac/
A Domac_test.c24 } tests[] = { in omac_test()
79 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in omac_test()
81 …if ((err = omac_memory(idx, tests[x].key, tests[x].keylen, tests[x].msg, tests[x].msglen, out, &le… in omac_test()
85 if (compare_testvector(out, len, tests[x].tag, sizeof(tests[x].tag), "OMAC", x) != 0) { in omac_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/lrw/
A Dlrw_test.c23 } tests[] = { in lrw_test()
76 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in lrw_test()
78 … if ((err = lrw_start(idx, tests[x].IV, tests[x].key, 16, tests[x].tweak, 0, &lrw)) != CRYPT_OK) { in lrw_test()
83 if (compare_testvector(tests[x].expected_tweak, 16, lrw.pad, 16, "LRW Tweak", x)) { in lrw_test()
89 if ((err = lrw_encrypt(tests[x].P, buf[0], 16, &lrw)) != CRYPT_OK) { in lrw_test()
94 if (compare_testvector(buf[0], 16, tests[x].C, 16, "LRW Encrypt", x)) { in lrw_test()
100 if ((err = lrw_setiv(tests[x].IV, 16, &lrw)) != CRYPT_OK) { in lrw_test()
110 if (compare_testvector(buf[1], 16, tests[x].P, 16, "LRW Decrypt", x)) { in lrw_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/xts/
A Dxts_test.c81 } tests[] = { in xts_test()
217 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in xts_test()
222 if ((j == 1) && ((tests[i].PTLEN < 32) || (tests[i].PTLEN % 32))) { in xts_test()
228 len = tests[i].PTLEN / 2; in xts_test()
230 err = xts_start(idx, tests[i].key1, tests[i].key2, tests[i].keylen / 2, 0, &xts); in xts_test()
235 seq = tests[i].seqnum; in xts_test()
241 err = xts_encrypt(tests[i].PTX, tests[i].PTLEN, OUT, T, &xts); in xts_test()
247 err = xts_encrypt(tests[i].PTX, len, OUT, T, &xts); in xts_test()
259 … if (compare_testvector(OUT, tests[i].PTLEN, tests[i].CTX, tests[i].PTLEN, "XTS encrypt", i)) { in xts_test()
266 err = xts_decrypt(tests[i].CTX, tests[i].PTLEN, OUT, T, &xts); in xts_test()
[all …]
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pmac/
A Dpmac_test.c25 } tests[] = { in pmac_test()
127 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in pmac_test()
129 …if ((err = pmac_memory(idx, tests[x].key, 16, tests[x].msg, tests[x].msglen, outtag, &len)) != CRY… in pmac_test()
133 if (compare_testvector(outtag, len, tests[x].tag, sizeof(tests[x].tag), "PMAC", x)) { in pmac_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pelican/
A Dpelican_test.c20 } tests[] = { in pelican_test()
83 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in pelican_test()
84 if ((err = pelican_init(&pel, tests[x].K, tests[x].keylen)) != CRYPT_OK) { in pelican_test()
87 if ((err = pelican_process(&pel, tests[x].MSG, tests[x].ptlen)) != CRYPT_OK) { in pelican_test()
94 if (compare_testvector(out, 16, tests[x].T, 16, "PELICAN", x)) { in pelican_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/f9/
A Df9_test.c23 } tests[] = { in f9_test()
51 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in f9_test()
53 … if ((err = f9_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { in f9_test()
56 if (compare_testvector(T, taglen, tests[x].T, 4, "F9", x)) { in f9_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/xcbc/
A Dxcbc_test.c23 } tests[] = { in xcbc_test()
101 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in xcbc_test()
103 …if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK)… in xcbc_test()
106 if (compare_testvector(T, taglen, tests[x].T, 16, "XCBC", x)) { in xcbc_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/hashes/sha2/
A Dsha224.c87 } tests[] = { in sha224_test()
106 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha224_test()
108 sha224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in sha224_test()
110 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA224", i)) { in sha224_test()
A Dsha512_224.c89 } tests[] = { in sha512_224_test()
108 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha512_224_test()
110 sha512_224_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in sha512_224_test()
112 … if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-224", i)) { in sha512_224_test()
A Dsha384.c89 } tests[] = { in sha384_test()
112 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha384_test()
114 sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in sha384_test()
116 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA384", i)) { in sha384_test()
A Dsha512_256.c89 } tests[] = { in sha512_256_test()
108 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha512_256_test()
110 sha512_256_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in sha512_256_test()
112 … if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512-265", i)) { in sha512_256_test()
/optee_os-3.20.0/core/lib/libtomcrypt/src/hashes/
A Dblake2b.c448 } tests[] = { in blake2b_512_test()
477 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in blake2b_512_test()
479 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_512", i)) { in blake2b_512_test()
499 } tests[] = { in blake2b_384_test()
524 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in blake2b_384_test()
526 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_384", i)) { in blake2b_384_test()
546 } tests[] = { in blake2b_256_test()
577 blake2b_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in blake2b_256_test()
579 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2B_256", i)) { in blake2b_256_test()
599 } tests[] = { in blake2b_160_test()
[all …]
A Dblake2s.c436 } tests[] = { in blake2s_256_test()
467 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in blake2s_256_test()
469 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_256", i)) { in blake2s_256_test()
490 } tests[] = { in blake2s_224_test()
511 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in blake2s_224_test()
513 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_224", i)) { in blake2s_224_test()
534 } tests[] = { in blake2s_160_test()
553 blake2s_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in blake2s_160_test()
555 …if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "BLAKE2S_160", i)) { in blake2s_160_test()
576 } tests[] = { in blake2s_128_test()
[all …]
A Dmd2.c190 } tests[] = { in md2_test()
227 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in md2_test()
229 md2_process(&md, (unsigned char*)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in md2_test()
231 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "MD2", i)) { in md2_test()
/optee_os-3.20.0/core/lib/libtomcrypt/
A Dsha512_accel.c145 } tests[] = { in sha512_test()
172 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { in sha512_test()
174 sha512_process(&md, (unsigned char *)tests[i].msg, (unsigned long)XSTRLEN(tests[i].msg)); in sha512_test()
176 if (compare_testvector(tmp, sizeof(tmp), tests[i].hash, sizeof(tests[i].hash), "SHA512", i)) { in sha512_test()
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()
/optee_os-3.20.0/core/lib/libtomcrypt/src/ciphers/
A Dtea.c123 } tests[] = { in tea_test()
153 for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { in tea_test()
157 … if ((err = base16_decode(tests[i].key, XSTRLEN(tests[i].key), key, &l)) != CRYPT_OK) return err; in tea_test()
159 … if ((err = base16_decode(tests[i].pt, XSTRLEN(tests[i].pt), ptct[0], &l)) != CRYPT_OK) return err; in tea_test()
161 … if ((err = base16_decode(tests[i].ct, XSTRLEN(tests[i].ct), ptct[1], &l)) != CRYPT_OK) return err; in tea_test()
A Drc2.c300 } tests[] = { in rc2_test()
349 for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) { in rc2_test()
351 if (tests[x].bits == (tests[x].keylen * 8)) { in rc2_test()
352 if ((err = rc2_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) { in rc2_test()
357 … if ((err = rc2_setup_ex(tests[x].key, tests[x].keylen, tests[x].bits, 0, &skey)) != CRYPT_OK) { in rc2_test()
362 rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey); in rc2_test()
365 if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC2 CT", x) || in rc2_test()
366 compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC2 PT", x)) { in rc2_test()
A Dmulti2.c190 } tests[] = { in multi2_test() local
245 for (x = 1; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { in multi2_test()
246 if ((err = multi2_setup(tests[x].key, 40, tests[x].rounds, &skey)) != CRYPT_OK) { in multi2_test()
249 if ((err = multi2_ecb_encrypt(tests[x].pt, buf, &skey)) != CRYPT_OK) { in multi2_test()
253 if (compare_testvector(buf, 8, tests[x].ct, 8, "Multi2 Encrypt", x)) { in multi2_test()
260 if (compare_testvector(buf, 8, tests[x].pt, 8, "Multi2 Decrypt", x)) { in multi2_test()
268 if ((err = multi2_setup(tests[0].key, 40, x, &skey)) != CRYPT_OK) { in multi2_test()
271 if ((err = multi2_ecb_encrypt(tests[0].pt, ct, &skey)) != CRYPT_OK) { in multi2_test()
277 if (compare_testvector(buf, 8, tests[0].pt, 8, "Multi2 Rounds", x)) { in multi2_test()

Completed in 23 milliseconds

123