/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ccm/ |
A D | ccm_test.c | 27 unsigned long taglen; in ccm_test() 108 unsigned long taglen, x, y; in ccm_test() 126 taglen = tests[x].taglen; in ccm_test() 174 if (compare_testvector(tag, taglen, tests[x].tag, tests[x].taglen, "CCM encrypt tag", x)) { in ccm_test() 179 XMEMCPY(tag3, tests[x].tag, tests[x].taglen); in ccm_test() 180 taglen = tests[x].taglen; in ccm_test() 215 XMEMCPY(tag3, tests[x].tag, tests[x].taglen); in ccm_test() 217 taglen = tests[x].taglen; in ccm_test() 232 … if (compare_testvector(tag2, taglen, tests[x].tag, tests[x].taglen, "CCM decrypt tag", x)) { in ccm_test() 254 taglen = sizeof(valid_tag); in ccm_test() [all …]
|
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() 41 ccm->taglen = taglen; in ccm_init()
|
A D | ccm_done.c | 15 unsigned char *tag, unsigned long *taglen) in ccm_done() argument 28 LTC_ARGCHK(taglen != NULL); in ccm_done() 47 for (x = 0; x < 16 && x < *taglen; x++) { in ccm_done() 50 *taglen = x; in ccm_done()
|
A D | ccm_memory.c | 40 unsigned char *tag, unsigned long *taglen, in ccm_memory() argument 59 LTC_ARGCHK(taglen != NULL); in ccm_memory() 78 if (*taglen < 4 || *taglen > 16 || (*taglen % 2) == 1 || headerlen > 0x7fffffffu) { in ccm_memory() 91 tag, taglen, in ccm_memory() 143 (((*taglen - 2)>>1)<<3) | in ccm_memory() 330 for (x = 0; x < 16 && x < *taglen; x++) { in ccm_memory() 333 *taglen = x; in ccm_memory() 336 for (x = 0; x < 16 && x < *taglen; x++) { in ccm_memory() 339 *taglen = x; in ccm_memory() 346 err = XMEM_NEQ(ptTag, PAD, *taglen); in ccm_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_decrypt_verify_memory.c | 35 const unsigned char *tag, unsigned long taglen, in eax_decrypt_verify_memory() argument 53 taglen = MIN(taglen, MAXBLOCKSIZE); in eax_decrypt_verify_memory() 56 buf = XMALLOC(taglen); in eax_decrypt_verify_memory() 76 buflen = taglen; in eax_decrypt_verify_memory() 82 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in eax_decrypt_verify_memory() 89 zeromem(buf, taglen); in eax_decrypt_verify_memory()
|
A D | eax_done.c | 19 int eax_done(eax_state *eax, unsigned char *tag, unsigned long *taglen) in eax_done() argument 27 LTC_ARGCHK(taglen != NULL); in eax_done() 63 for (x = 0; x < len && x < *taglen; x++) { in eax_done() 66 *taglen = x; in eax_done()
|
A D | eax_encrypt_authenticate_memory.c | 34 unsigned char *tag, unsigned long *taglen) in eax_encrypt_authenticate_memory() argument 43 LTC_ARGCHK(taglen != NULL); in eax_encrypt_authenticate_memory() 55 if ((err = eax_done(eax, tag, taglen)) != CRYPT_OK) { in eax_encrypt_authenticate_memory()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_decrypt_verify_memory.c | 35 const unsigned char *tag, unsigned long taglen, in ocb3_decrypt_verify_memory() argument 49 taglen = MIN(taglen, MAXBLOCKSIZE); in ocb3_decrypt_verify_memory() 52 buf = XMALLOC(taglen); in ocb3_decrypt_verify_memory() 64 if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen, taglen)) != CRYPT_OK) { in ocb3_decrypt_verify_memory() 78 buflen = taglen; in ocb3_decrypt_verify_memory() 84 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in ocb3_decrypt_verify_memory()
|
A D | ocb3_encrypt_authenticate_memory.c | 34 unsigned char *tag, unsigned long *taglen) in ocb3_encrypt_authenticate_memory() argument 39 LTC_ARGCHK(taglen != NULL); in ocb3_encrypt_authenticate_memory() 47 if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen, *taglen)) != CRYPT_OK) { in ocb3_encrypt_authenticate_memory() 61 err = ocb3_done(ocb, tag, taglen); in ocb3_encrypt_authenticate_memory()
|
A D | ocb3_done.c | 19 int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen) in ocb3_done() argument 26 LTC_ARGCHK(taglen != NULL); in ocb3_done() 32 if ((int)*taglen < ocb->tag_len) { in ocb3_done() 33 *taglen = (unsigned long)ocb->tag_len; in ocb3_done() 69 *taglen = (unsigned long)ocb->tag_len; in ocb3_done()
|
A D | ocb3_init.c | 12 …set_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen) in s_ocb3_int_calc_offset_zero() argument 26 iNonce[0] |= ((taglen*8) % 128) << 1; in s_ocb3_int_calc_offset_zero() 85 unsigned long taglen) in ocb3_init() argument 112 if (taglen > 16) { in ocb3_init() 115 ocb->tag_len = taglen; in ocb3_init() 169 s_ocb3_int_calc_offset_zero(ocb, nonce, noncelen, taglen); in ocb3_init()
|
/optee_os-3.20.0/core/mm/ |
A D | file.c | 36 unsigned int taglen; member 47 unsigned int taglen) in file_tag_cmp() argument 49 if (f->taglen != taglen) in file_tag_cmp() 51 return memcmp(tag, f->tag, taglen); in file_tag_cmp() 55 unsigned int taglen) in file_find_tag_unlocked() argument 60 if (!file_tag_cmp(f, tag, taglen)) in file_find_tag_unlocked() 117 struct file *file_get_by_tag(const uint8_t *tag, unsigned int taglen) in file_get_by_tag() argument 121 if (taglen > sizeof(f->tag)) in file_get_by_tag() 147 f = file_find_tag_unlocked(tag, taglen); in file_get_by_tag() 154 memcpy(f->tag, tag, taglen); in file_get_by_tag() [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/mac/f9/ |
A D | f9_test.c | 43 unsigned long taglen; in f9_test() 52 taglen = 4; 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 D | xcbc_test.c | 91 unsigned long taglen; in xcbc_test() 102 taglen = 16; 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/encauth/ocb/ |
A D | ocb_done_encrypt.c | 23 unsigned char *ct, unsigned char *tag, unsigned long *taglen) in ocb_done_encrypt() argument 29 LTC_ARGCHK(taglen != NULL); in ocb_done_encrypt() 30 return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0); in ocb_done_encrypt()
|
A D | ocb_done_decrypt.c | 26 const unsigned char *tag, unsigned long taglen, int *stat) in ocb_done_decrypt() argument 52 if (taglen <= tagbuflen && XMEM_NEQ(tagbuf, tag, taglen) == 0) { in ocb_done_decrypt()
|
A D | ocb_encrypt_authenticate_memory.c | 30 unsigned char *tag, unsigned long *taglen) in ocb_encrypt_authenticate_memory() argument 40 LTC_ARGCHK(taglen != NULL); in ocb_encrypt_authenticate_memory() 61 err = ocb_done_encrypt(ocb, pt, ptlen, ct, tag, taglen); in ocb_encrypt_authenticate_memory()
|
A D | s_ocb_done.c | 32 unsigned char *ct, unsigned char *tag, unsigned long *taglen, int mode) in s_ocb_done() argument 42 LTC_ARGCHK(taglen != NULL); in s_ocb_done() 116 for (x = 0; x < ocb->block_len && x < (int)*taglen; x++) { in s_ocb_done() 119 *taglen = x; in s_ocb_done()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 277 unsigned char *tag, unsigned long *taglen); 285 const unsigned char *tag, unsigned long taglen, 327 unsigned char *tag, unsigned long *taglen); 334 const unsigned char *tag, unsigned long taglen, 374 unsigned long taglen); 389 unsigned char *tag, unsigned long *taglen); 397 const unsigned char *tag, unsigned long taglen, 445 unsigned char *tag, unsigned long *taglen); 454 unsigned char *tag, unsigned long *taglen, 524 unsigned char *tag, unsigned long *taglen); [all …]
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/chachapoly/ |
A D | chacha20poly1305_memory.c | 29 unsigned char *tag, unsigned long *taglen, in chacha20poly1305_memory() argument 40 LTC_ARGCHK(taglen != NULL); in chacha20poly1305_memory() 49 if ((err = chacha20poly1305_done(&st, tag, taglen)) != CRYPT_OK) { goto LBL_ERR; } in chacha20poly1305_memory() 56 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in chacha20poly1305_memory()
|
A D | chacha20poly1305_test.c | 131 unsigned long taglen; in chacha20poly1305_test() 134 taglen = sizeof(wtag); in chacha20poly1305_test() 136 wpt, 0, wct, wtag, &taglen, CHACHA20POLY1305_ENCRYPT); in chacha20poly1305_test() 138 …if (compare_testvector(wtag, taglen, valid_tag, sizeof(valid_tag), "WYCH", 1) != 0) return CRYPT_F… in chacha20poly1305_test() 141 taglen = sizeof(valid_tag); in chacha20poly1305_test() 143 wpt, 0, wct, valid_tag, &taglen, CHACHA20POLY1305_DECRYPT); in chacha20poly1305_test() 147 taglen = sizeof(invalid_tag); in chacha20poly1305_test() 149 wpt, 0, wct, invalid_tag, &taglen, CHACHA20POLY1305_DECRYPT); in chacha20poly1305_test()
|
A D | chacha20poly1305_done.c | 15 int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsigned long *taglen) in chacha20poly1305_done() argument 31 if ((err = poly1305_done(&st->poly, tag, taglen)) != CRYPT_OK) return err; in chacha20poly1305_done()
|
/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_done.c | 20 unsigned char *tag, unsigned long *taglen) in gcm_done() argument 27 LTC_ARGCHK(taglen != NULL); in gcm_done() 69 for (x = 0; x < 16 && x < *taglen; x++) { in gcm_done() 72 *taglen = x; in gcm_done()
|
A D | gcm_memory.c | 35 unsigned char *tag, unsigned long *taglen, in gcm_memory() argument 53 tag, taglen, in gcm_memory() 91 if ((err = gcm_done(gcm, tag, taglen)) != CRYPT_OK) { in gcm_memory() 101 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in gcm_memory()
|
A D | gcm_test.c | 383 unsigned long taglen; in gcm_test() 386 taglen = sizeof(valid_tag); in gcm_test() 388 pt, sizeof(ct), ct, valid_tag, &taglen, GCM_DECRYPT); in gcm_test() 394 taglen = sizeof(invalid_tag); in gcm_test() 396 pt, sizeof(ct), ct, invalid_tag, &taglen, GCM_DECRYPT); in gcm_test()
|