Home
last modified time | relevance | path

Searched refs:tag_len (Results 1 – 25 of 46) sorted by relevance

12

/optee_os/core/lib/libtomcrypt/
H A Dccm.c23 size_t tag_len; /* tag length */ member
59 dst_ctx->tag_len = src_ctx->tag_len; in crypto_aes_ccm_copy_state()
66 size_t tag_len, size_t aad_len, in crypto_aes_ccm_init() argument
78 ccm->tag_len = tag_len; in crypto_aes_ccm_init()
93 if ((tag_len < 4) || (tag_len > TEE_CCM_TAG_MAX_LENGTH) || in crypto_aes_ccm_init()
94 (tag_len % 2 != 0)) in crypto_aes_ccm_init()
98 payload_len, tag_len, aad_len); in crypto_aes_ccm_init()
168 if (*dst_tag_len < ccm->tag_len) { in crypto_aes_ccm_enc_final()
169 *dst_tag_len = ccm->tag_len; in crypto_aes_ccm_enc_final()
172 *dst_tag_len = ccm->tag_len; in crypto_aes_ccm_enc_final()
[all …]
H A Dgcm.c21 size_t tag_len; /* tag length */ member
58 dst_ctx->tag_len = src_ctx->tag_len; in crypto_aes_gcm_copy_state()
65 size_t tag_len, size_t aad_len __unused, in crypto_aes_gcm_init() argument
77 gcm->tag_len = tag_len; in crypto_aes_gcm_init()
158 if (*dst_tag_len < gcm->tag_len) { in crypto_aes_gcm_enc_final()
159 *dst_tag_len = gcm->tag_len; in crypto_aes_gcm_enc_final()
162 *dst_tag_len = gcm->tag_len; in crypto_aes_gcm_enc_final()
175 const uint8_t *tag, size_t tag_len) in crypto_aes_gcm_dec_final() argument
181 unsigned long ltc_tag_len = tag_len; in crypto_aes_gcm_dec_final()
183 if (tag_len == 0) in crypto_aes_gcm_dec_final()
[all …]
/optee_os/core/lib/libtomcrypt/src/pk/asn1/der/general/
H A Dder_encode_asn1_identifier.c21 unsigned long tag_len; in der_encode_asn1_identifier() local
63 tag_len = 0; in der_encode_asn1_identifier()
66 tag_len++; in der_encode_asn1_identifier()
71 if (*outlen < tag_len + 1) { in der_encode_asn1_identifier()
75 for (tmp = 1; tmp <= tag_len; ++tmp) { in der_encode_asn1_identifier()
76 out[tmp] = ((id->tag >> (7 * (tag_len - tmp))) & 0x7f) | 0x80; in der_encode_asn1_identifier()
78 out[tag_len] &= ~0x80; in der_encode_asn1_identifier()
80 *outlen = tag_len + 1; in der_encode_asn1_identifier()
H A Dder_decode_asn1_identifier.c62 unsigned long tag_len; in der_decode_asn1_identifier() local
73 tag_len = 1; in der_decode_asn1_identifier()
82 if (*inlen < tag_len) { in der_decode_asn1_identifier()
88 id->tag |= in[tag_len] & 0x7f; in der_decode_asn1_identifier()
89 tmp = in[tag_len] & 0x80; in der_decode_asn1_identifier()
90 tag_len++; in der_decode_asn1_identifier()
91 } while ((tmp != 0) && (tag_len < 10)); in der_decode_asn1_identifier()
105 *inlen = tag_len; in der_decode_asn1_identifier()
/optee_os/core/crypto/
H A Daes-gcm.c72 size_t nonce_len, size_t tag_len) in __gcm_init() argument
76 if (tag_len > sizeof(state->buf_tag)) in __gcm_init()
81 state->tag_len = tag_len; in __gcm_init()
127 size_t nonce_len, size_t tag_len) in internal_aes_gcm_init() argument
137 return __gcm_init(&ctx->state, ek, mode, nonce, nonce_len, tag_len); in internal_aes_gcm_init()
285 xor_buf(state->buf_tag, state->hash_state, state->tag_len); in operation_final()
293 void *tag, size_t *tag_len) in __gcm_enc_final() argument
297 if (*tag_len < state->tag_len) in __gcm_enc_final()
304 memcpy(tag, state->buf_tag, state->tag_len); in __gcm_enc_final()
305 *tag_len = state->tag_len; in __gcm_enc_final()
[all …]
/optee_os/lib/libmbedtls/mbedtls/include/mbedtls/
H A Dccm.h74 size_t MBEDTLS_PRIVATE(tag_len); /*!< Total tag length */
177 unsigned char *tag, size_t tag_len);
226 unsigned char *tag, size_t tag_len);
263 const unsigned char *tag, size_t tag_len);
309 const unsigned char *tag, size_t tag_len);
374 size_t tag_len);
510 unsigned char *tag, size_t tag_len);
H A Dgcm.h174 size_t tag_len,
219 size_t tag_len,
359 unsigned char *tag, size_t tag_len);
H A Dcipher.h1030 unsigned char *tag, size_t tag_len);
1046 const unsigned char *tag, size_t tag_len);
1137 size_t *olen, size_t tag_len);
1193 size_t *olen, size_t tag_len);
/optee_os/lib/libmbedtls/mbedtls/library/
H A Dccm.c175 if (ctx->tag_len == 0) { in ccm_calculate_first_block_if_ready()
197 ctx->y[0] |= ((ctx->tag_len - 2) / 2) << 3; in ccm_calculate_first_block_if_ready()
264 size_t tag_len) in mbedtls_ccm_set_lengths() argument
273 if (tag_len == 2 || tag_len > 16 || tag_len % 2 != 0) { in mbedtls_ccm_set_lengths()
283 ctx->tag_len = tag_len; in mbedtls_ccm_set_lengths()
380 if (ctx->tag_len != 0 && ctx->processed + input_len > ctx->plaintext_len) { in mbedtls_ccm_update()
474 unsigned char *tag, size_t tag_len) in mbedtls_ccm_finish() argument
503 memcpy(tag, ctx->y, tag_len); in mbedtls_ccm_finish()
517 unsigned char *tag, size_t tag_len) in ccm_auth_crypt() argument
526 if ((ret = mbedtls_ccm_set_lengths(ctx, add_len, length, tag_len)) != 0) { in ccm_auth_crypt()
[all …]
H A Dcipher.c1228 unsigned char *tag, size_t tag_len) in mbedtls_cipher_write_tag() argument
1254 tag, tag_len); in mbedtls_cipher_write_tag()
1261 if (tag_len != 16U) { in mbedtls_cipher_write_tag()
1274 const unsigned char *tag, size_t tag_len) in mbedtls_cipher_check_tag() argument
1305 if (tag_len > sizeof(check_tag)) { in mbedtls_cipher_check_tag()
1312 check_tag, tag_len))) { in mbedtls_cipher_check_tag()
1317 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag()
1327 if (tag_len != sizeof(check_tag)) { in mbedtls_cipher_check_tag()
1338 if (mbedtls_ct_memcmp(tag, check_tag, tag_len) != 0) { in mbedtls_cipher_check_tag()
1346 mbedtls_platform_zeroize(check_tag, tag_len); in mbedtls_cipher_check_tag()
[all …]
H A Dgcm.c653 unsigned char *tag, size_t tag_len) in mbedtls_gcm_finish() argument
675 if (tag_len > 16 || tag_len < 4) { in mbedtls_gcm_finish()
683 memcpy(tag, ctx->base_ectr, tag_len); in mbedtls_gcm_finish()
697 mbedtls_xor(tag, tag, ctx->buf, tag_len); in mbedtls_gcm_finish()
712 size_t tag_len, in mbedtls_gcm_crypt_and_tag() argument
731 if ((ret = mbedtls_gcm_finish(ctx, NULL, 0, &olen, tag, tag_len)) != 0) { in mbedtls_gcm_crypt_and_tag()
745 size_t tag_len, in mbedtls_gcm_auth_decrypt() argument
755 input, output, tag_len, check_tag)) != 0) { in mbedtls_gcm_auth_decrypt()
760 diff = mbedtls_ct_memcmp(tag, check_tag, tag_len); in mbedtls_gcm_auth_decrypt()
/optee_os/core/include/crypto/
H A Dinternal_aes-gcm.h44 unsigned int tag_len; member
58 size_t nonce_len, size_t tag_len);
67 void *tag, size_t *tag_len);
70 const void *tag, size_t tag_len);
79 void *tag, size_t *tag_len);
85 const void *tag, size_t tag_len);
/optee_os/core/lib/libtomcrypt/src/encauth/ocb3/
H A Docb3_done.c32 if ((int)*taglen < ocb->tag_len) { in ocb3_done()
33 *taglen = (unsigned long)ocb->tag_len; in ocb3_done()
68 for(x = 0; x < ocb->tag_len; x++) tag[x] = tmp[x]; in ocb3_done()
69 *taglen = (unsigned long)ocb->tag_len; in ocb3_done()
/optee_os/core/drivers/crypto/crypto_api/authenc/
H A Dauthenc.c78 size_t nonce_len, size_t tag_len, size_t aad_len, in authenc_init() argument
99 .tag_len = tag_len, in authenc_init()
200 size_t *tag_len) in authenc_enc_final() argument
223 .tag.length = *tag_len in authenc_enc_final()
228 *tag_len = dfinal.tag.length; in authenc_enc_final()
248 size_t tag_len) in authenc_dec_final() argument
271 .tag.length = tag_len in authenc_dec_final()
/optee_os/ta/pkcs11/src/
H A Dprocessing_aes.c377 size_t tag_len = 0; in tee_ae_encrypt_final() local
386 &tag, &tag_len); in tee_ae_encrypt_final()
388 if (tag_len != ctx->tag_byte_len || in tee_ae_encrypt_final()
391 tag_len, ctx->tag_byte_len, res); in tee_ae_encrypt_final()
395 if (*out_size < size + tag_len) { in tee_ae_encrypt_final()
396 *out_size = size + tag_len; in tee_ae_encrypt_final()
404 NULL, 0, out, &size, tag, &tag_len); in tee_ae_encrypt_final()
406 if (tag_len != ctx->tag_byte_len) { in tee_ae_encrypt_final()
412 *out_size = size + tag_len; in tee_ae_encrypt_final()
462 uint32_t tag_len = 0; in tee_init_gcm_operation() local
[all …]
/optee_os/core/include/drivers/
H A Dzynqmp_csu_aes.h28 void *tag, size_t tag_len,
34 const void *tag, size_t tag_len,
/optee_os/core/kernel/
H A Dembedded_ts.c96 uint8_t *tag, unsigned int *tag_len) in emb_ts_get_tag() argument
101 if (!tag || *tag_len < TEE_SHA256_HASH_SIZE) { in emb_ts_get_tag()
102 *tag_len = TEE_SHA256_HASH_SIZE; in emb_ts_get_tag()
105 *tag_len = TEE_SHA256_HASH_SIZE; in emb_ts_get_tag()
116 res = crypto_hash_final(ctx, tag, *tag_len); in emb_ts_get_tag()
H A Dree_fs_ta.c516 uint8_t *tag, unsigned int *tag_len) in ree_fs_ta_get_tag() argument
520 if (!tag || *tag_len < handle->shdr->hash_size) { in ree_fs_ta_get_tag()
521 *tag_len = handle->shdr->hash_size; in ree_fs_ta_get_tag()
524 *tag_len = handle->shdr->hash_size; in ree_fs_ta_get_tag()
689 unsigned int tag_len; member
715 res = ree_fs_ta_get_tag(handle->h, NULL, &handle->tag_len); in buf_ta_open()
720 handle->tag = malloc(handle->tag_len); in buf_ta_open()
725 res = ree_fs_ta_get_tag(handle->h, handle->tag, &handle->tag_len); in buf_ta_open()
796 uint8_t *tag, unsigned int *tag_len) in buf_ta_get_tag() argument
800 *tag_len = handle->tag_len; in buf_ta_get_tag()
[all …]
H A Dsecstor_ta.c53 uint8_t *tag, unsigned int *tag_len) in secstor_ta_get_tag() argument
55 return tee_tadb_get_tag((struct tee_tadb_ta_read *)h, tag, tag_len); in secstor_ta_get_tag()
/optee_os/core/include/tee/
H A Dtee_svc_cryp.h62 size_t nonce_len, size_t tag_len,
71 uint64_t *dest_len, void *tag, uint64_t *tag_len);
74 uint64_t *dest_len, const void *tag, size_t tag_len);
/optee_os/core/drivers/crypto/hisilicon/
H A Dsec_authenc.c34 ae_ctx->tag_len; in sec_aead_bd_fill()
87 SHIFT_U32(ae_ctx->tag_len, SEC_ICV_LEN_OFFSET_V3); in sec_aead_bd3_fill()
304 if (dinit->tag_len < SEC_MIN_GCM_TAG_LEN || in is_hw_supported()
305 dinit->tag_len > SEC_MAX_TAG_LEN) { in is_hw_supported()
321 if (dinit->tag_len < SEC_MIN_CCM_TAG_LEN || in is_hw_supported()
322 dinit->tag_len > SEC_MAX_TAG_LEN || in is_hw_supported()
323 dinit->tag_len % TAG_ALIGN) { in is_hw_supported()
384 cm = ((dinit->tag_len - IV_CM_CAL_NUM) / IV_CM_CAL_NUM) & IV_CL_MASK; in sec_aead_set_iv()
459 dinit->tag_len, dinit->aad_len, in ae_soft_calc_init()
488 ae_drv_ctx->tag_len = dinit->tag_len; in sec_authenc_initialize()
[all …]
/optee_os/lib/libutee/include/
H A Dutee_syscalls.h136 size_t nonce_len, size_t tag_len, size_t aad_len,
146 uint64_t *tag_len);
150 size_t tag_len);
/optee_os/core/drivers/
H A Dzynqmp_csu_aes.c280 const void *tag, size_t tag_len, in zynqmp_csu_aes_decrypt_data() argument
301 if (tag_len != ZYNQMP_GCM_TAG_SIZE) { in zynqmp_csu_aes_decrypt_data()
332 void *tag, size_t tag_len, in zynqmp_csu_aes_encrypt_data() argument
353 if (tag_len != ZYNQMP_GCM_TAG_SIZE) { in zynqmp_csu_aes_encrypt_data()
/optee_os/core/include/kernel/
H A Dembedded_ts.h35 uint8_t *tag, unsigned int *tag_len);
H A Dts_store.h35 uint8_t *tag, unsigned int *tag_len);

12