Lines Matching +full:- +full:n
1 // SPDX-License-Identifier: BSD-2-Clause
3 * Copyright (c) 2017-2020, Linaro Limited
8 #include <crypto/internal_aes-gcm.h>
17 internal_aes_gcm_ghash_gen_tbl(&state->ghash_key, ek); in internal_aes_gcm_set_key()
19 crypto_aes_enc_block(ek->data, sizeof(ek->data), ek->rounds, in internal_aes_gcm_set_key()
20 state->ctr, state->ghash_key.hash_subkey); in internal_aes_gcm_set_key()
27 void *y = state->hash_state; in ghash_update_block()
31 internal_aes_gcm_ghash_mult_tbl(&state->ghash_key, y, y); in ghash_update_block()
33 internal_aes_gcm_gfmul(state->ghash_key.hash_subkey, y, y); in ghash_update_block()
41 size_t n = 0; in internal_aes_gcm_ghash_update() local
47 for (n = 0; n < num_blocks; n++) in internal_aes_gcm_ghash_update()
50 n * TEE_AES_BLOCK_SIZE); in internal_aes_gcm_ghash_update()
57 void *buf_cryp = state->buf_cryp; in encrypt_block()
61 memcpy(dst, buf_cryp, sizeof(state->buf_cryp)); in encrypt_block()
63 crypto_aes_enc_block(enc_key->data, sizeof(enc_key->data), in encrypt_block()
64 enc_key->rounds, state->ctr, state->buf_cryp); in encrypt_block()
72 size_t n = 0; in encrypt_pl() local
75 for (n = 0; n < num_blocks; n++) { in encrypt_pl()
76 const void *s = src + n * TEE_AES_BLOCK_SIZE; in encrypt_pl()
77 void *d = dst + n * TEE_AES_BLOCK_SIZE; in encrypt_pl()
82 for (n = 0; n < num_blocks; n++) { in encrypt_pl()
84 void *d = dst + n * TEE_AES_BLOCK_SIZE; in encrypt_pl()
86 memcpy(tmp, src + n * TEE_AES_BLOCK_SIZE, sizeof(tmp)); in encrypt_pl()
96 void *buf_cryp = state->buf_cryp; in decrypt_block()
98 crypto_aes_enc_block(enc_key->data, sizeof(enc_key->data), in decrypt_block()
99 enc_key->rounds, state->ctr, buf_cryp); in decrypt_block()
104 memcpy(dst, buf_cryp, sizeof(state->buf_cryp)); in decrypt_block()
111 size_t n = 0; in decrypt_pl() local
114 for (n = 0; n < num_blocks; n++) { in decrypt_pl()
115 const void *s = src + n * TEE_AES_BLOCK_SIZE; in decrypt_pl()
116 void *d = dst + n * TEE_AES_BLOCK_SIZE; in decrypt_pl()
121 for (n = 0; n < num_blocks; n++) { in decrypt_pl()
123 void *d = dst + n * TEE_AES_BLOCK_SIZE; in decrypt_pl()
125 memcpy(tmp, src + n * TEE_AES_BLOCK_SIZE, sizeof(tmp)); in decrypt_pl()
137 assert(!state->buf_pos && num_blocks); in internal_aes_gcm_update_payload_blocks()