Lines Matching +full:split +full:- +full:security
4 * SPDX-License-Identifier: Apache-2.0
116 api = (struct crypto_driver_api *) dev->api; in crypto_query_hwcaps()
118 tmp = api->query_hw_caps(dev); in crypto_query_hwcaps()
127 "Driver should support at least one op-type: sync/async"); in crypto_query_hwcaps()
171 api = (struct crypto_driver_api *) dev->api; in cipher_begin_session()
172 ctx->device = dev; in cipher_begin_session()
173 ctx->ops.cipher_mode = mode; in cipher_begin_session()
175 flags = (ctx->flags & (CAP_OPAQUE_KEY_HNDL | CAP_RAW_KEY)); in cipher_begin_session()
180 flags = (ctx->flags & (CAP_INPLACE_OPS | CAP_SEPARATE_IO_BUFS)); in cipher_begin_session()
185 flags = (ctx->flags & (CAP_SYNC_OPS | CAP_ASYNC_OPS)); in cipher_begin_session()
190 return api->cipher_begin_session(dev, ctx, algo, mode, optype); in cipher_begin_session()
209 api = (struct crypto_driver_api *) dev->api; in cipher_free_session()
211 return api->cipher_free_session(dev, ctx); in cipher_free_session()
225 * @return 0 on success, -ENOTSUP if the driver does not support async op,
233 api = (struct crypto_driver_api *) dev->api; in cipher_callback_set()
235 if (api->cipher_async_callback_set) { in cipher_callback_set()
236 return api->cipher_async_callback_set(dev, cb); in cipher_callback_set()
239 return -ENOTSUP; in cipher_callback_set()
244 * @brief Perform single-block crypto operation (ECB cipher mode). This
245 * should not be overloaded to operate on multiple blocks for security reasons.
255 __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_ECB, "ECB mode " in cipher_block_op()
258 pkt->ctx = ctx; in cipher_block_op()
259 return ctx->ops.block_crypt_hndlr(ctx, pkt); in cipher_block_op()
269 * operations (within a session context) for security.
276 __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CBC, "CBC mode " in cipher_cbc_op()
279 pkt->ctx = ctx; in cipher_cbc_op()
280 return ctx->ops.cbc_crypt_hndlr(ctx, pkt, iv); in cipher_cbc_op()
289 * split counter formed by appending IV and ctr.
290 * Consequently ivlen = keylen - ctrlen. 'ctrlen' is
294 * (within a session context) for security. The non-IV
295 * part of the split counter is transparent to the caller
303 __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CTR, "CTR mode " in cipher_ctr_op()
306 pkt->ctx = ctx; in cipher_ctr_op()
307 return ctx->ops.ctr_crypt_hndlr(ctx, pkt, iv); in cipher_ctr_op()
311 * @brief Perform Counter with CBC-MAC (CCM) mode crypto operation
318 * session context) for security.
325 __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_CCM, "CCM mode " in cipher_ccm_op()
328 pkt->pkt->ctx = ctx; in cipher_ccm_op()
329 return ctx->ops.ccm_crypt_hndlr(ctx, pkt, nonce); in cipher_ccm_op()
340 * session context) for security.
347 __ASSERT(ctx->ops.cipher_mode == CRYPTO_CIPHER_MODE_GCM, "GCM mode " in cipher_gcm_op()
350 pkt->pkt->ctx = ctx; in cipher_gcm_op()
351 return ctx->ops.gcm_crypt_hndlr(ctx, pkt, nonce); in cipher_gcm_op()
391 api = (struct crypto_driver_api *) dev->api; in hash_begin_session()
392 ctx->device = dev; in hash_begin_session()
394 flags = (ctx->flags & (CAP_INPLACE_OPS | CAP_SEPARATE_IO_BUFS)); in hash_begin_session()
399 flags = (ctx->flags & (CAP_SYNC_OPS | CAP_ASYNC_OPS)); in hash_begin_session()
405 return api->hash_begin_session(dev, ctx, algo); in hash_begin_session()
424 api = (struct crypto_driver_api *) dev->api; in hash_free_session()
426 return api->hash_free_session(dev, ctx); in hash_free_session()
440 * @return 0 on success, -ENOTSUP if the driver does not support async op,
448 api = (struct crypto_driver_api *) dev->api; in hash_callback_set()
450 if (api->hash_async_callback_set) { in hash_callback_set()
451 return api->hash_async_callback_set(dev, cb); in hash_callback_set()
454 return -ENOTSUP; in hash_callback_set()
468 pkt->ctx = ctx; in hash_compute()
470 return ctx->hash_hndlr(ctx, pkt, true); in hash_compute()
487 pkt->ctx = ctx; in hash_update()
489 return ctx->hash_hndlr(ctx, pkt, false); in hash_update()