^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /* \file cc_cipher.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * ARM CryptoCell Cipher Crypto API
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef __CC_CIPHER_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define __CC_CIPHER_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <crypto/algapi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "cc_driver.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "cc_buffer_mgr.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct cipher_req_ctx {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct async_gen_req_ctx gen_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) enum cc_req_dma_buf_type dma_buf_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) u32 in_nents;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) u32 in_mlli_nents;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) u32 out_nents;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) u32 out_mlli_nents;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) u8 *iv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct mlli_params mlli_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int cc_cipher_alloc(struct cc_drvdata *drvdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) int cc_cipher_free(struct cc_drvdata *drvdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct cc_hkey_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) u16 keylen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u8 hw_key1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) u8 hw_key2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define CC_HW_KEY_SIZE sizeof(struct cc_hkey_info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #endif /*__CC_CIPHER_H__*/