Lines Matching refs:psa_ctx
36 static psa_status_t ctr_drbg_setup_psa_context(mbedtls_ctr_drbg_psa_context *psa_ctx, in ctr_drbg_setup_psa_context() argument
45 status = psa_import_key(&key_attr, key, key_len, &psa_ctx->key_id); in ctr_drbg_setup_psa_context()
50 status = psa_cipher_encrypt_setup(&psa_ctx->operation, psa_ctx->key_id, PSA_ALG_ECB_NO_PADDING); in ctr_drbg_setup_psa_context()
60 static void ctr_drbg_destroy_psa_contex(mbedtls_ctr_drbg_psa_context *psa_ctx) in ctr_drbg_destroy_psa_contex() argument
62 psa_cipher_abort(&psa_ctx->operation); in ctr_drbg_destroy_psa_contex()
63 psa_destroy_key(psa_ctx->key_id); in ctr_drbg_destroy_psa_contex()
65 psa_ctx->operation = psa_cipher_operation_init(); in ctr_drbg_destroy_psa_contex()
66 psa_ctx->key_id = MBEDTLS_SVC_KEY_ID_INIT; in ctr_drbg_destroy_psa_contex()
77 ctx->psa_ctx.key_id = MBEDTLS_SVC_KEY_ID_INIT; in mbedtls_ctr_drbg_init()
78 ctx->psa_ctx.operation = psa_cipher_operation_init(); in mbedtls_ctr_drbg_init()
106 ctr_drbg_destroy_psa_contex(&ctx->psa_ctx); in mbedtls_ctr_drbg_free()
174 mbedtls_ctr_drbg_psa_context psa_ctx; in block_cipher_df() local
176 psa_ctx.key_id = MBEDTLS_SVC_KEY_ID_INIT; in block_cipher_df()
177 psa_ctx.operation = psa_cipher_operation_init(); in block_cipher_df()
213 status = ctr_drbg_setup_psa_context(&psa_ctx, key, sizeof(key)); in block_cipher_df()
242 status = psa_cipher_update(&psa_ctx.operation, chain, MBEDTLS_CTR_DRBG_BLOCKSIZE, in block_cipher_df()
268 ctr_drbg_destroy_psa_contex(&psa_ctx); in block_cipher_df()
270 status = ctr_drbg_setup_psa_context(&psa_ctx, tmp, MBEDTLS_CTR_DRBG_KEYSIZE); in block_cipher_df()
286 status = psa_cipher_update(&psa_ctx.operation, iv, MBEDTLS_CTR_DRBG_BLOCKSIZE, in block_cipher_df()
303 ctr_drbg_destroy_psa_contex(&psa_ctx); in block_cipher_df()
356 status = psa_cipher_update(&ctx->psa_ctx.operation, ctx->counter, sizeof(ctx->counter), in ctr_drbg_update_internal()
378 ctr_drbg_destroy_psa_contex(&ctx->psa_ctx); in ctr_drbg_update_internal()
380 status = ctr_drbg_setup_psa_context(&ctx->psa_ctx, tmp, MBEDTLS_CTR_DRBG_KEYSIZE); in ctr_drbg_update_internal()
570 status = ctr_drbg_setup_psa_context(&ctx->psa_ctx, key, MBEDTLS_CTR_DRBG_KEYSIZE); in mbedtls_ctr_drbg_seed()
662 status = psa_cipher_update(&ctx->psa_ctx.operation, ctx->counter, sizeof(ctx->counter), in mbedtls_ctr_drbg_random_with_add()