Lines Matching +full:input +full:- +full:negative
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()
160 * @return 0 on success, negative errno code on fail.
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()
202 * @return 0 on success, negative errno code on fail.
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,
226 * negative errno code on other error.
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
248 * @param pkt Structure holding the input/output buffer pointers.
250 * @return 0 on success, negative errno code on fail.
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()
266 * @param pkt Structure holding the input/output buffer pointers.
271 * @return 0 on success, negative errno code on fail.
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()
287 * @param pkt Structure holding the input/output buffer pointers.
290 * Consequently ivlen = keylen - ctrlen. 'ctrlen' is
294 * (within a session context) for security. The non-IV
298 * @return 0 on success, negative errno code on fail.
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
314 * @param pkt Structure holding the input/output, Associated
320 * @return 0 on success, negative errno code on fail.
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()
336 * @param pkt Structure holding the input/output, Associated
342 * @return 0 on success, negative errno code on fail.
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()
382 * @return 0 on success, negative errno code on fail.
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()
417 * @return 0 on success, negative errno code on fail.
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,
441 * negative errno code on other error.
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()
462 * @param pkt Structure holding the input/output.
464 * @return 0 on success, negative errno code on fail.
468 pkt->ctx = ctx; in hash_compute()
470 return ctx->hash_hndlr(ctx, pkt, true); in hash_compute()
481 * @param pkt Structure holding the input.
483 * @return 0 on success, negative errno code on fail.
487 pkt->ctx = ctx; in hash_update()
489 return ctx->hash_hndlr(ctx, pkt, false); in hash_update()