Home
last modified time | relevance | path

Searched refs:taglen (Results 1 – 25 of 47) sorted by relevance

12

/optee_os/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_test.c34 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 Dccm_init.c27 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 Dccm_memory.c47 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 Dccm_done.c22 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 Dfile.c36 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 Deax_decrypt_verify_memory.c42 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 Deax_done.c26 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 Deax_encrypt_authenticate_memory.c41 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 Docb3_decrypt_verify_memory.c42 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 Docb3_done.c26 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 Docb3_encrypt_authenticate_memory.c41 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 Docb3_init.c19 …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 Dtomcrypt_mac.h271 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 Df9_test.c50 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 Dxcbc_test.c98 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 Docb_done_encrypt.c30 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 Docb_done_decrypt.c33 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 Docb_encrypt_authenticate_memory.c37 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 Ds_ocb_done.c39 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 Dchacha20poly1305_memory.c36 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 Dchacha20poly1305_test.c138 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 Dchacha20poly1305_done.c22 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 Dgcm_done.c27 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 Dgcm_memory.c42 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 Dgcm_test.c390 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()

Completed in 28 milliseconds

12