/optee_os/core/lib/libtomcrypt/src/encauth/ccm/ |
A D | ccm_test.c | 34 unsigned long taglen; in ccm_test() 115 unsigned long taglen, x, y; in ccm_test() 133 taglen = tests[x].taglen; in ccm_test() 181 if (compare_testvector(tag, taglen, tests[x].tag, tests[x].taglen, "CCM encrypt tag", x)) { in ccm_test() 186 XMEMCPY(tag3, tests[x].tag, tests[x].taglen); in ccm_test() 187 taglen = tests[x].taglen; in ccm_test() 222 XMEMCPY(tag3, tests[x].tag, tests[x].taglen); in ccm_test() 224 taglen = tests[x].taglen; in ccm_test() 239 … if (compare_testvector(tag2, taglen, tests[x].tag, tests[x].taglen, "CCM decrypt tag", x)) { in ccm_test() 261 taglen = sizeof(valid_tag); in ccm_test() [all …]
|
A D | ccm_init.c | 27 const unsigned char *key, int keylen, int ptlen, int taglen, int aadlen) in ccm_init() argument 45 if (taglen < 4 || taglen > 16 || (taglen % 2) == 1) { in ccm_init() 48 ccm->taglen = taglen; in ccm_init()
|
A D | ccm_memory.c | 47 unsigned char *tag, unsigned long *taglen, in ccm_memory() argument 66 LTC_ARGCHK(taglen != NULL); in ccm_memory() 85 if (*taglen < 4 || *taglen > 16 || (*taglen % 2) == 1) { in ccm_memory() 98 tag, taglen, in ccm_memory() 147 (((*taglen - 2)>>1)<<3) | in ccm_memory() 334 for (x = 0; x < 16 && x < *taglen; x++) { in ccm_memory() 337 *taglen = x; in ccm_memory() 340 for (x = 0; x < 16 && x < *taglen; x++) { in ccm_memory() 343 *taglen = x; in ccm_memory() 350 err = XMEM_NEQ(ptTag, PAD, *taglen); in ccm_memory()
|
A D | ccm_done.c | 22 unsigned char *tag, unsigned long *taglen) in ccm_done() argument 35 LTC_ARGCHK(taglen != NULL); in ccm_done() 54 for (x = 0; x < 16 && x < *taglen; x++) { in ccm_done() 57 *taglen = x; in ccm_done()
|
/optee_os/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/core/lib/libtomcrypt/src/encauth/eax/ |
A D | eax_decrypt_verify_memory.c | 42 const unsigned char *tag, unsigned long taglen, in eax_decrypt_verify_memory() argument 60 taglen = MIN(taglen, MAXBLOCKSIZE); in eax_decrypt_verify_memory() 63 buf = XMALLOC(taglen); in eax_decrypt_verify_memory() 83 buflen = taglen; in eax_decrypt_verify_memory() 89 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in eax_decrypt_verify_memory() 96 zeromem(buf, taglen); in eax_decrypt_verify_memory()
|
A D | eax_done.c | 26 int eax_done(eax_state *eax, unsigned char *tag, unsigned long *taglen) in eax_done() argument 34 LTC_ARGCHK(taglen != NULL); in eax_done() 70 for (x = 0; x < len && x < *taglen; x++) { in eax_done() 73 *taglen = x; in eax_done()
|
A D | eax_encrypt_authenticate_memory.c | 41 unsigned char *tag, unsigned long *taglen) in eax_encrypt_authenticate_memory() argument 50 LTC_ARGCHK(taglen != NULL); in eax_encrypt_authenticate_memory() 62 if ((err = eax_done(eax, tag, taglen)) != CRYPT_OK) { in eax_encrypt_authenticate_memory()
|
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/ |
A D | ocb3_decrypt_verify_memory.c | 42 const unsigned char *tag, unsigned long taglen, in ocb3_decrypt_verify_memory() argument 56 taglen = MIN(taglen, MAXBLOCKSIZE); in ocb3_decrypt_verify_memory() 59 buf = XMALLOC(taglen); in ocb3_decrypt_verify_memory() 71 if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen, taglen)) != CRYPT_OK) { in ocb3_decrypt_verify_memory() 85 buflen = taglen; in ocb3_decrypt_verify_memory() 91 if (buflen >= taglen && XMEM_NEQ(buf, tag, taglen) == 0) { in ocb3_decrypt_verify_memory()
|
A D | ocb3_done.c | 26 int ocb3_done(ocb3_state *ocb, unsigned char *tag, unsigned long *taglen) in ocb3_done() argument 33 LTC_ARGCHK(taglen != NULL); in ocb3_done() 39 if ((int)*taglen < ocb->tag_len) { in ocb3_done() 40 *taglen = (unsigned long)ocb->tag_len; in ocb3_done() 76 *taglen = (unsigned long)ocb->tag_len; in ocb3_done()
|
A D | ocb3_encrypt_authenticate_memory.c | 41 unsigned char *tag, unsigned long *taglen) in ocb3_encrypt_authenticate_memory() argument 46 LTC_ARGCHK(taglen != NULL); in ocb3_encrypt_authenticate_memory() 54 if ((err = ocb3_init(ocb, cipher, key, keylen, nonce, noncelen, *taglen)) != CRYPT_OK) { in ocb3_encrypt_authenticate_memory() 68 err = ocb3_done(ocb, tag, taglen); in ocb3_encrypt_authenticate_memory()
|
A D | ocb3_init.c | 19 …set_zero(ocb3_state *ocb, const unsigned char *nonce, unsigned long noncelen, unsigned long taglen) in _ocb3_int_calc_offset_zero() argument 33 iNonce[0] |= ((taglen*8) % 128) << 1; in _ocb3_int_calc_offset_zero() 92 unsigned long taglen) in ocb3_init() argument 119 if (taglen > 16) { in ocb3_init() 122 ocb->tag_len = taglen; in ocb3_init() 176 _ocb3_int_calc_offset_zero(ocb, nonce, noncelen, taglen); in ocb3_init()
|
/optee_os/core/lib/libtomcrypt/src/headers/ |
A D | tomcrypt_mac.h | 271 unsigned char *tag, unsigned long *taglen); 279 const unsigned char *tag, unsigned long taglen, 321 unsigned char *tag, unsigned long *taglen); 328 const unsigned char *tag, unsigned long taglen, 368 unsigned long taglen); 383 unsigned char *tag, unsigned long *taglen); 391 const unsigned char *tag, unsigned long taglen, 439 unsigned char *tag, unsigned long *taglen); 448 unsigned char *tag, unsigned long *taglen, 518 unsigned char *tag, unsigned long *taglen); [all …]
|
/optee_os/core/lib/libtomcrypt/src/mac/f9/ |
A D | f9_test.c | 50 unsigned long taglen; in f9_test() 59 taglen = 4; 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 D | xcbc_test.c | 98 unsigned long taglen; in xcbc_test() 109 taglen = 16; 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/encauth/ocb/ |
A D | ocb_done_encrypt.c | 30 unsigned char *ct, unsigned char *tag, unsigned long *taglen) in ocb_done_encrypt() argument 36 LTC_ARGCHK(taglen != NULL); in ocb_done_encrypt() 37 return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0); in ocb_done_encrypt()
|
A D | ocb_done_decrypt.c | 33 const unsigned char *tag, unsigned long taglen, int *stat) in ocb_done_decrypt() argument 59 if (taglen <= tagbuflen && XMEM_NEQ(tagbuf, tag, taglen) == 0) { in ocb_done_decrypt()
|
A D | ocb_encrypt_authenticate_memory.c | 37 unsigned char *tag, unsigned long *taglen) in ocb_encrypt_authenticate_memory() argument 47 LTC_ARGCHK(taglen != NULL); in ocb_encrypt_authenticate_memory() 68 err = ocb_done_encrypt(ocb, pt, ptlen, ct, tag, taglen); in ocb_encrypt_authenticate_memory()
|
A D | s_ocb_done.c | 39 unsigned char *ct, unsigned char *tag, unsigned long *taglen, int mode) in s_ocb_done() argument 49 LTC_ARGCHK(taglen != NULL); in s_ocb_done() 123 for (x = 0; x < ocb->block_len && x < (int)*taglen; x++) { in s_ocb_done() 126 *taglen = x; in s_ocb_done()
|
/optee_os/core/lib/libtomcrypt/src/encauth/chachapoly/ |
A D | chacha20poly1305_memory.c | 36 unsigned char *tag, unsigned long *taglen, in chacha20poly1305_memory() argument 47 LTC_ARGCHK(taglen != NULL); in chacha20poly1305_memory() 56 if ((err = chacha20poly1305_done(&st, tag, taglen)) != CRYPT_OK) { goto LBL_ERR; } in chacha20poly1305_memory() 63 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in chacha20poly1305_memory()
|
A D | chacha20poly1305_test.c | 138 unsigned long taglen; in chacha20poly1305_test() 141 taglen = sizeof(wtag); in chacha20poly1305_test() 143 wpt, 0, wct, wtag, &taglen, CHACHA20POLY1305_ENCRYPT); in chacha20poly1305_test() 145 …if (compare_testvector(wtag, taglen, valid_tag, sizeof(valid_tag), "WYCH", 1) != 0) return CRYPT_F… in chacha20poly1305_test() 148 taglen = sizeof(valid_tag); in chacha20poly1305_test() 150 wpt, 0, wct, valid_tag, &taglen, CHACHA20POLY1305_DECRYPT); in chacha20poly1305_test() 154 taglen = sizeof(invalid_tag); in chacha20poly1305_test() 156 wpt, 0, wct, invalid_tag, &taglen, CHACHA20POLY1305_DECRYPT); in chacha20poly1305_test()
|
A D | chacha20poly1305_done.c | 22 int chacha20poly1305_done(chacha20poly1305_state *st, unsigned char *tag, unsigned long *taglen) in chacha20poly1305_done() argument 38 if ((err = poly1305_done(&st->poly, tag, taglen)) != CRYPT_OK) return err; in chacha20poly1305_done()
|
/optee_os/core/lib/libtomcrypt/src/encauth/gcm/ |
A D | gcm_done.c | 27 unsigned char *tag, unsigned long *taglen) in gcm_done() argument 34 LTC_ARGCHK(taglen != NULL); in gcm_done() 76 for (x = 0; x < 16 && x < *taglen; x++) { in gcm_done() 79 *taglen = x; in gcm_done()
|
A D | gcm_memory.c | 42 unsigned char *tag, unsigned long *taglen, in gcm_memory() argument 60 tag, taglen, in gcm_memory() 98 if ((err = gcm_done(gcm, tag, taglen)) != CRYPT_OK) { in gcm_memory() 108 if (buflen != *taglen || XMEM_NEQ(buf, tag, buflen) != 0) { in gcm_memory()
|
A D | gcm_test.c | 390 unsigned long taglen; in gcm_test() 393 taglen = sizeof(valid_tag); in gcm_test() 395 pt, sizeof(ct), ct, valid_tag, &taglen, GCM_DECRYPT); in gcm_test() 401 taglen = sizeof(invalid_tag); in gcm_test() 403 pt, sizeof(ct), ct, invalid_tag, &taglen, GCM_DECRYPT); in gcm_test()
|