/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ccm/ |
A D | ccm_init.c | 20 const unsigned char *key, int keylen, int ptlen, int taglen, int aadlen) in ccm_init() argument 38 if (taglen < 4 || taglen > 16 || (taglen % 2) == 1 || aadlen < 0 || ptlen < 0) { in ccm_init() 50 ccm->ptlen = ptlen; in ccm_init() 52 while (ptlen) { in ccm_init() 54 ptlen >>= 8; in ccm_init()
|
A D | ccm_test.c | 24 int ptlen; in ccm_test() 137 (unsigned char*)tests[x].pt, tests[x].ptlen, in ccm_test() 148 (unsigned char*)tests[x].pt, tests[x].ptlen, 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() 163 …if ((err = ccm_process(&ccm, (unsigned char*)tests[x].pt, tests[x].ptlen, buf, CCM_ENCRYPT)) != CR… in ccm_test() 171 … if (compare_testvector(buf, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "CCM encrypt data", x)) { in ccm_test() 186 buf2, tests[x].ptlen, in ccm_test() 201 if ((err = ccm_process(&ccm, buf2, tests[x].ptlen, buf, CCM_DECRYPT)) != CRYPT_OK) { in ccm_test() 210 …if (compare_testvector(buf2, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "CCM decrypt data", x)) { in ccm_test() 223 buf2, tests[x].ptlen, in ccm_test() [all …]
|
A D | ccm_process.c | 17 unsigned char *pt, unsigned long ptlen, in ccm_process() argument 33 if (ccm->ptlen < ccm->current_ptlen + ptlen) { in ccm_process() 36 ccm->current_ptlen += ptlen; in ccm_process() 39 if (ptlen > 0) { in ccm_process() 43 for (y = 0; y < ptlen; y++) { in ccm_process()
|
A D | ccm_memory.c | 89 pt, ptlen, in ccm_memory() 96 len = ptlen; in ccm_memory() 132 if (direction == CCM_DECRYPT && ptlen > 0) { in ccm_memory() 133 pt_work = XMALLOC(ptlen); in ccm_memory() 152 len = ptlen; in ccm_memory() 227 if (ptlen > 0) { in ccm_memory() 230 if (ptlen & ~15) { in ccm_memory() 232 for (; y < (ptlen & ~15); y += 16) { in ccm_memory() 275 for (; y < ptlen; y++) { in ccm_memory() 349 if (ptlen > 0) { in ccm_memory() [all …]
|
A D | ccm_done.c | 23 if (ccm->ptlen != ccm->current_ptlen) { in ccm_done()
|
A D | ccm_add_nonce.c | 49 len = ccm->ptlen; in ccm_add_nonce()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb/ |
A D | ocb_test.c | 22 int ptlen; in ocb_test() 173 tests[x].nonce, tests[x].pt, tests[x].ptlen, outct, outtag, &len)) != CRYPT_OK) { 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() 186 …if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)… in ocb_test()
|
A D | s_ocb_done.c | 31 int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, in s_ocb_done() argument 47 (int)ptlen > ocb->block_len || (int)ptlen < 0) { in s_ocb_done() 72 X[ocb->block_len-1] ^= (ptlen*8)&255; in s_ocb_done() 73 X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; in s_ocb_done() 86 for (x = 0; x < (int)ptlen; x++) { in s_ocb_done() 92 for (x = 0; x < (int)ptlen; x++) { in s_ocb_done() 99 for (x = 0; x < (int)ptlen; x++) { in s_ocb_done()
|
A D | ocb_encrypt_authenticate_memory.c | 28 const unsigned char *pt, unsigned long ptlen, in ocb_encrypt_authenticate_memory() argument 52 while (ptlen > (unsigned long)ocb->block_len) { in ocb_encrypt_authenticate_memory() 56 ptlen -= ocb->block_len; in ocb_encrypt_authenticate_memory() 61 err = ocb_done_encrypt(ocb, pt, ptlen, ct, tag, taglen); in ocb_encrypt_authenticate_memory()
|
A D | ocb_done_encrypt.c | 22 int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, in ocb_done_encrypt() argument 30 return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0); in ocb_done_encrypt()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_test.c | 25 int ptlen; in ocb3_test() 218 … tests[x].ptlen != 0 ? tests[x].pt : NULL, tests[x].ptlen, in ocb3_test() 219 … tests[x].ptlen != 0 ? outct : NULL, outtag, &len)) != CRYPT_OK) { in ocb3_test() 224 … compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB3 CT", x)) { in ocb3_test() 232 tests[x].ptlen != 0 ? outct : NULL, tests[x].ptlen, in ocb3_test() 233 … tests[x].ptlen != 0 ? outct : NULL, tests[x].tag, len, &res)) != CRYPT_OK) { in ocb3_test() 236 …if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x… in ocb3_test()
|
A D | ocb3_encrypt.c | 20 int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct) in ocb3_encrypt() argument 27 if (ptlen == 0) return CRYPT_OK; /* no data, nothing to do */ in ocb3_encrypt() 38 if (ptlen % ocb->block_len) { /* ptlen has to bu multiple of block_len */ in ocb3_encrypt() 42 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt()
|
A D | ocb3_encrypt_last.c | 20 int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char … in ocb3_encrypt_last() argument 27 if (pt == NULL) LTC_ARGCHK(ptlen == 0); in ocb3_encrypt_last() 28 if (ptlen != 0) { in ocb3_encrypt_last() 37 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt_last() 39 last_block_len = ptlen - full_blocks_len; in ocb3_encrypt_last()
|
A D | ocb3_encrypt_authenticate_memory.c | 32 const unsigned char *pt, unsigned long ptlen, in ocb3_encrypt_authenticate_memory() argument 57 if ((err = ocb3_encrypt_last(ocb, pt, ptlen, ct)) != CRYPT_OK) { in ocb3_encrypt_authenticate_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_test.c | 25 unsigned long ptlen; 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() 364 out[1], tests[x].ptlen, in gcm_test() 369 if (compare_testvector(out[1], tests[x].ptlen, tests[x].P, tests[x].ptlen, "GCM PT", x)) { in gcm_test()
|
A D | gcm_process.c | 22 unsigned char *pt, unsigned long ptlen, in gcm_process() argument 31 if (ptlen > 0) { in gcm_process() 45 if (gcm->pttotlen / 8 + (ulong64)gcm->buflen + (ulong64)ptlen >= CONST64(0xFFFFFFFE0)) { in gcm_process() 83 for (x = 0; x < (ptlen & ~15); x += 16) { in gcm_process() 101 for (x = 0; x < (ptlen & ~15); x += 16) { in gcm_process() 123 for (; x < ptlen; x++) { in gcm_process()
|
A D | gcm_memory.c | 33 unsigned char *pt, unsigned long ptlen, in gcm_memory() argument 51 pt, ptlen, in gcm_memory() 87 if ((err = gcm_process(gcm, pt, ptlen, ct, direction)) != CRYPT_OK) { in gcm_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/stream/rabbit/ |
A D | rabbit.c | 361 unsigned long ptlen = sizeof(pt); in rabbit_test() 366 if ((err = rabbit_crypt(&st, (unsigned char*)pt, ptlen, out)) != CRYPT_OK) return err; in rabbit_test() 367 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV1", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 382 unsigned long ptlen = sizeof(pt); in rabbit_test() 392 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV2", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 407 unsigned long ptlen = XSTRLEN(pt); in rabbit_test() 417 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV3", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 423 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV4", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 430 … if ((err = rabbit_crypt(&st, out, ptlen, out2)) != CRYPT_OK) return err; in rabbit_test() 431 … if (compare_testvector(out2, ptlen, pt, ptlen, "RABBIT-TV5", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/pelican/ |
A D | pelican_test.c | 19 int keylen, ptlen; in pelican_test() 87 if ((err = pelican_process(&pel, tests[x].MSG, tests[x].ptlen)) != CRYPT_OK) { in pelican_test()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 275 const unsigned char *pt, unsigned long ptlen, 313 const unsigned char *pt, unsigned long ptlen, 325 const unsigned char *pt, unsigned long ptlen, 342 int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, 387 const unsigned char *pt, unsigned long ptlen, 416 ptlen, /* length that will be enc / dec */ member 429 const unsigned char *key, int keylen, int ptlen, int taglen, int aadlen); 440 unsigned char *pt, unsigned long ptlen, 452 unsigned char *pt, unsigned long ptlen, 519 unsigned char *pt, unsigned long ptlen, [all …]
|
A D | tomcrypt_cipher.h | 520 unsigned char *pt, unsigned long ptlen, 544 unsigned char *pt, unsigned long ptlen, 981 const unsigned char *pt, unsigned long ptlen, 986 const unsigned char *ct, unsigned long ptlen,
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_encrypt_authenticate_memory.c | 32 const unsigned char *pt, unsigned long ptlen, in eax_encrypt_authenticate_memory() argument 51 if ((err = eax_encrypt(eax, pt, ct, ptlen)) != CRYPT_OK) { in eax_encrypt_authenticate_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/modes/xts/ |
A D | xts_decrypt.c | 53 int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, unsigned char *twe… in xts_decrypt() argument 72 m = ptlen >> 4; in xts_decrypt() 73 mo = ptlen & 15; in xts_decrypt()
|
A D | xts_encrypt.c | 55 int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *twe… in xts_encrypt() argument 74 m = ptlen >> 4; in xts_encrypt() 75 mo = ptlen & 15; in xts_encrypt()
|