Lines Matching refs:soft_aes_ctx

191 	soft_aes_ctx_t *soft_aes_ctx;
195 if ((soft_aes_ctx = kmem_zalloc(sizeof (soft_aes_ctx_t),
198 if ((soft_aes_ctx = calloc(1, sizeof (soft_aes_ctx_t)))
204 soft_aes_ctx->key_sched = aes_alloc_keysched(&size, 0);
206 if (soft_aes_ctx->key_sched == NULL) {
208 kmem_free(soft_aes_ctx, sizeof (soft_aes_ctx_t));
210 free(soft_aes_ctx);
215 soft_aes_ctx->keysched_len = size;
219 soft_aes_ctx->key_sched);
222 soft_aes_ctx->key_sched);
230 (void) memcpy(soft_aes_ctx->ivec, iv, AES_BLOCK_LEN);
232 soft_aes_ctx->aes_cbc = (void *)aes_cbc_ctx_init(
233 soft_aes_ctx->key_sched,
234 soft_aes_ctx->keysched_len,
235 soft_aes_ctx->ivec);
242 soft_aes_ctx->aes_cbc = aes_ctr_ctx_init(
243 soft_aes_ctx->key_sched,
244 soft_aes_ctx->keysched_len,
250 soft_aes_ctx->aes_cbc = aes_ccm_ctx_init(
251 soft_aes_ctx->key_sched,
252 soft_aes_ctx->keysched_len, iv,
257 soft_aes_ctx->aes_cbc = aes_gcm_ctx_init(
258 soft_aes_ctx->key_sched,
259 soft_aes_ctx->keysched_len, iv);
263 soft_aes_ctx->aes_cbc = aes_gmac_ctx_init(
264 soft_aes_ctx->key_sched,
265 soft_aes_ctx->keysched_len, iv);
269 return (soft_aes_ctx);
272 if (soft_aes_ctx->aes_cbc == NULL) {
273 bzero(soft_aes_ctx->key_sched,
274 soft_aes_ctx->keysched_len);
276 kmem_free(soft_aes_ctx->key_sched, size);
278 free(soft_aes_ctx->key_sched);
283 return (soft_aes_ctx);
288 fips_aes_free_context(soft_aes_ctx_t *soft_aes_ctx)
293 aes_ctx = (common_ctx_t *)soft_aes_ctx->aes_cbc;
302 bzero(soft_aes_ctx->key_sched, soft_aes_ctx->keysched_len);
303 kmem_free(soft_aes_ctx->key_sched, soft_aes_ctx->keysched_len);
306 kmem_free(soft_aes_ctx, sizeof (soft_aes_ctx_t));
312 fips_aes_free_context(soft_aes_ctx_t *soft_aes_ctx)
317 aes_ctx = (common_ctx_t *)soft_aes_ctx->aes_cbc;
322 free(soft_aes_ctx->aes_cbc);
325 bzero(soft_aes_ctx->key_sched, soft_aes_ctx->keysched_len);
326 free(soft_aes_ctx->key_sched);
329 free(soft_aes_ctx);
338 * soft_aes_ctx: pointer to AES context
352 fips_aes_encrypt(soft_aes_ctx_t *soft_aes_ctx, uchar_t *in_buf,
357 fips_aes_encrypt(soft_aes_ctx_t *soft_aes_ctx, CK_BYTE_PTR in_buf,
395 (void) aes_encrypt_block(soft_aes_ctx->key_sched,
416 (aes_ctx_t *)soft_aes_ctx->aes_cbc,
441 rc = aes_encrypt_contiguous_blocks(soft_aes_ctx->aes_cbc,
454 if (((aes_ctx_t *)soft_aes_ctx->aes_cbc)->ac_remainder_len
456 rc = ctr_mode_final(soft_aes_ctx->aes_cbc, &out,
473 aes_ctx_t *aes_ctx = soft_aes_ctx->aes_cbc;
474 ccm_ctx_t *ccm_ctx = soft_aes_ctx->aes_cbc;
520 aes_ctx_t *aes_ctx = soft_aes_ctx->aes_cbc;
521 gcm_ctx_t *gcm_ctx = soft_aes_ctx->aes_cbc;
575 aes_ctx_t *aes_ctx = soft_aes_ctx->aes_cbc;
607 * soft_aes_ctx: pointer to AES context
621 fips_aes_decrypt(soft_aes_ctx_t *soft_aes_ctx, uchar_t *in_buf,
626 fips_aes_decrypt(soft_aes_ctx_t *soft_aes_ctx, CK_BYTE_PTR in_buf,
664 (void) aes_decrypt_block(soft_aes_ctx->key_sched,
685 (aes_ctx_t *)soft_aes_ctx->aes_cbc,
711 rc = aes_decrypt_contiguous_blocks(soft_aes_ctx->aes_cbc,
725 if (((aes_ctx_t *)soft_aes_ctx->aes_cbc)->ac_remainder_len
727 rc = ctr_mode_final(soft_aes_ctx->aes_cbc, &out,
743 aes_ctx_t *aes_ctx = soft_aes_ctx->aes_cbc;
744 ccm_ctx_t *ccm_ctx = soft_aes_ctx->aes_cbc;
784 aes_ctx_t *aes_ctx = soft_aes_ctx->aes_cbc;
824 aes_ctx_t *aes_ctx = soft_aes_ctx->aes_cbc;