/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ |
A D | ccm_test.c | 31 int ptlen; in ccm_test() 144 (unsigned char*)tests[x].pt, tests[x].ptlen, in ccm_test() 155 (unsigned char*)tests[x].pt, tests[x].ptlen, 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() 170 …if ((err = ccm_process(&ccm, (unsigned char*)tests[x].pt, tests[x].ptlen, buf, CCM_ENCRYPT)) != CR… in ccm_test() 178 … if (compare_testvector(buf, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "CCM encrypt data", x)) { in ccm_test() 193 buf2, tests[x].ptlen, in ccm_test() 208 if ((err = ccm_process(&ccm, buf2, tests[x].ptlen, buf, CCM_DECRYPT)) != CRYPT_OK) { in ccm_test() 217 …if (compare_testvector(buf2, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "CCM decrypt data", x)) { in ccm_test() 230 buf2, tests[x].ptlen, in ccm_test() [all …]
|
A D | ccm_memory.c | 96 pt, ptlen, in ccm_memory() 103 len = ptlen; in ccm_memory() 136 if (direction == CCM_DECRYPT && ptlen > 0) { in ccm_memory() 137 pt_work = XMALLOC(ptlen); in ccm_memory() 156 len = ptlen; in ccm_memory() 231 if (ptlen > 0) { in ccm_memory() 234 if (ptlen & ~15) { in ccm_memory() 236 for (; y < (ptlen & ~15); y += 16) { in ccm_memory() 279 for (; y < ptlen; y++) { in ccm_memory() 353 if (ptlen > 0) { in ccm_memory() [all …]
|
A D | ccm_process.c | 24 unsigned char *pt, unsigned long ptlen, in ccm_process() argument 40 if (ccm->ptlen < ccm->current_ptlen + ptlen) { in ccm_process() 43 ccm->current_ptlen += ptlen; in ccm_process() 46 if (ptlen > 0) { in ccm_process() 50 for (y = 0; y < ptlen; y++) { in ccm_process()
|
A D | ccm_init.c | 27 const unsigned char *key, int keylen, int ptlen, int taglen, int aadlen) in ccm_init() argument 57 ccm->ptlen = ptlen; in ccm_init() 59 while (ptlen) { in ccm_init() 61 ptlen >>= 8; in ccm_init()
|
A D | ccm_done.c | 30 if (ccm->ptlen != ccm->current_ptlen) { in ccm_done()
|
A D | ccm_add_nonce.c | 53 len = ccm->ptlen; in ccm_add_nonce()
|
/optee_os/core/lib/libtomcrypt/src/encauth/ocb/ |
A D | ocb_test.c | 29 int ptlen; in ocb_test() 180 tests[x].nonce, tests[x].pt, tests[x].ptlen, outct, outtag, &len)) != CRYPT_OK) { 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() 193 …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 | 38 int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, in s_ocb_done() argument 54 (int)ptlen > ocb->block_len || (int)ptlen < 0) { in s_ocb_done() 79 X[ocb->block_len-1] ^= (ptlen*8)&255; in s_ocb_done() 80 X[ocb->block_len-2] ^= ((ptlen*8)>>8)&255; in s_ocb_done() 93 for (x = 0; x < (int)ptlen; x++) { in s_ocb_done() 99 for (x = 0; x < (int)ptlen; x++) { in s_ocb_done() 106 for (x = 0; x < (int)ptlen; x++) { in s_ocb_done()
|
A D | ocb_encrypt_authenticate_memory.c | 35 const unsigned char *pt, unsigned long ptlen, in ocb_encrypt_authenticate_memory() argument 59 while (ptlen > (unsigned long)ocb->block_len) { in ocb_encrypt_authenticate_memory() 63 ptlen -= ocb->block_len; in ocb_encrypt_authenticate_memory() 68 err = ocb_done_encrypt(ocb, pt, ptlen, ct, tag, taglen); in ocb_encrypt_authenticate_memory()
|
A D | ocb_done_encrypt.c | 29 int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, in ocb_done_encrypt() argument 37 return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0); in ocb_done_encrypt()
|
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_test.c | 32 int ptlen; in ocb3_test() 225 … tests[x].ptlen != 0 ? tests[x].pt : NULL, tests[x].ptlen, in ocb3_test() 226 … tests[x].ptlen != 0 ? outct : NULL, outtag, &len)) != CRYPT_OK) { in ocb3_test() 231 … compare_testvector(outct, tests[x].ptlen, tests[x].ct, tests[x].ptlen, "OCB3 CT", x)) { in ocb3_test() 239 tests[x].ptlen != 0 ? outct : NULL, tests[x].ptlen, in ocb3_test() 240 … tests[x].ptlen != 0 ? outct : NULL, tests[x].tag, len, &res)) != CRYPT_OK) { in ocb3_test() 243 …if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x… in ocb3_test()
|
A D | ocb3_encrypt_last.c | 27 int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char … in ocb3_encrypt_last() argument 34 if (pt == NULL) LTC_ARGCHK(ptlen == 0); in ocb3_encrypt_last() 35 if (ptlen != 0) { in ocb3_encrypt_last() 44 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt_last() 46 last_block_len = ptlen - full_blocks_len; in ocb3_encrypt_last()
|
A D | ocb3_encrypt.c | 27 int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen, unsigned char *ct) in ocb3_encrypt() argument 34 if (ptlen == 0) return CRYPT_OK; /* no data, nothing to do */ in ocb3_encrypt() 45 if (ptlen % ocb->block_len) { /* ptlen has to bu multiple of block_len */ in ocb3_encrypt() 49 full_blocks = ptlen/ocb->block_len; in ocb3_encrypt()
|
A D | ocb3_encrypt_authenticate_memory.c | 39 const unsigned char *pt, unsigned long ptlen, in ocb3_encrypt_authenticate_memory() argument 64 if ((err = ocb3_encrypt_last(ocb, pt, ptlen, ct)) != CRYPT_OK) { in ocb3_encrypt_authenticate_memory()
|
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_test.c | 32 unsigned long ptlen; 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() 371 out[1], tests[x].ptlen, in gcm_test() 376 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 | 29 unsigned char *pt, unsigned long ptlen, in gcm_process() argument 38 if (ptlen > 0) { in gcm_process() 52 if (gcm->pttotlen / 8 + (ulong64)gcm->buflen + (ulong64)ptlen >= CONST64(0xFFFFFFFE0)) { in gcm_process() 90 for (x = 0; x < (ptlen & ~15); x += 16) { in gcm_process() 108 for (x = 0; x < (ptlen & ~15); x += 16) { in gcm_process() 130 for (; x < ptlen; x++) { in gcm_process()
|
A D | gcm_memory.c | 40 unsigned char *pt, unsigned long ptlen, in gcm_memory() argument 58 pt, ptlen, in gcm_memory() 94 if ((err = gcm_process(gcm, pt, ptlen, ct, direction)) != CRYPT_OK) { in gcm_memory()
|
/optee_os/core/lib/libtomcrypt/src/stream/rabbit/ |
A D | rabbit.c | 368 unsigned long ptlen = sizeof(pt); in rabbit_test() 373 if ((err = rabbit_crypt(&st, (unsigned char*)pt, ptlen, out)) != CRYPT_OK) return err; in rabbit_test() 374 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV1", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 389 unsigned long ptlen = sizeof(pt); in rabbit_test() 399 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV2", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 414 unsigned long ptlen = strlen(pt); in rabbit_test() 424 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV3", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 430 … if (compare_testvector(out, ptlen, ct, ptlen, "RABBIT-TV4", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test() 437 … if ((err = rabbit_crypt(&st, out, ptlen, out2)) != CRYPT_OK) return err; in rabbit_test() 438 … if (compare_testvector(out2, ptlen, pt, ptlen, "RABBIT-TV5", 1)) return CRYPT_FAIL_TESTVECTOR; in rabbit_test()
|
/optee_os/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 269 const unsigned char *pt, unsigned long ptlen, 307 const unsigned char *pt, unsigned long ptlen, 319 const unsigned char *pt, unsigned long ptlen, 336 int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, 381 const unsigned char *pt, unsigned long ptlen, 410 ptlen, /* length that will be enc / dec */ member 423 const unsigned char *key, int keylen, int ptlen, int taglen, int aadlen); 434 unsigned char *pt, unsigned long ptlen, 446 unsigned char *pt, unsigned long ptlen, 513 unsigned char *pt, unsigned long ptlen, [all …]
|
A D | tomcrypt_cipher.h | 518 unsigned char *pt, unsigned long ptlen, 542 unsigned char *pt, unsigned long ptlen, 969 const unsigned char *pt, unsigned long ptlen, 974 const unsigned char *ct, unsigned long ptlen,
|
/optee_os/core/lib/libtomcrypt/src/mac/pelican/ |
A D | pelican_test.c | 26 int keylen, ptlen; in pelican_test() 94 if ((err = pelican_process(&pel, tests[x].MSG, tests[x].ptlen)) != CRYPT_OK) { in pelican_test()
|
/optee_os/core/lib/libtomcrypt/src/modes/xts/ |
A D | xts_decrypt.c | 60 int xts_decrypt(const unsigned char *ct, unsigned long ptlen, unsigned char *pt, unsigned char *twe… in xts_decrypt() argument 79 m = ptlen >> 4; in xts_decrypt() 80 mo = ptlen & 15; in xts_decrypt()
|
A D | xts_encrypt.c | 62 int xts_encrypt(const unsigned char *pt, unsigned long ptlen, unsigned char *ct, unsigned char *twe… in xts_encrypt() argument 81 m = ptlen >> 4; in xts_encrypt() 82 mo = ptlen & 15; in xts_encrypt()
|
/optee_os/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_encrypt_authenticate_memory.c | 39 const unsigned char *pt, unsigned long ptlen, in eax_encrypt_authenticate_memory() argument 58 if ((err = eax_encrypt(eax, pt, ct, ptlen)) != CRYPT_OK) { in eax_encrypt_authenticate_memory()
|