Home
last modified time | relevance | path

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

12

/optee_os-3.20.0/core/lib/libtomcrypt/src/encauth/ccm/
A Dccm_test.c27 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 Dccm_init.c20 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 Dccm_done.c15 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 Dccm_memory.c40 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 Deax_decrypt_verify_memory.c35 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 Deax_done.c19 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 Deax_encrypt_authenticate_memory.c34 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 Docb3_decrypt_verify_memory.c35 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 Docb3_encrypt_authenticate_memory.c34 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 Docb3_done.c19 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 Docb3_init.c12 …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 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-3.20.0/core/lib/libtomcrypt/src/mac/f9/
A Df9_test.c43 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 Dxcbc_test.c91 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 Docb_done_encrypt.c23 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 Docb_done_decrypt.c26 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 Docb_encrypt_authenticate_memory.c30 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 Ds_ocb_done.c32 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 Dtomcrypt_mac.h277 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 Dchacha20poly1305_memory.c29 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 Dchacha20poly1305_test.c131 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 Dchacha20poly1305_done.c15 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 Dgcm_done.c20 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 Dgcm_memory.c35 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 Dgcm_test.c383 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()

Completed in 28 milliseconds

12