Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Ruchika Gupta | ac1b269 | 2014-10-15 11:35:30 +0530 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2014 Freescale Semiconductor, Inc. |
| 4 | * |
Ruchika Gupta | ac1b269 | 2014-10-15 11:35:30 +0530 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __JOBDESC_H |
| 8 | #define __JOBDESC_H |
| 9 | |
Ruchika Gupta | ac1b269 | 2014-10-15 11:35:30 +0530 | [diff] [blame] | 10 | #include <asm/io.h> |
Ruchika Gupta | 29c1a6b | 2015-01-23 16:01:55 +0530 | [diff] [blame] | 11 | #include "rsa_caam.h" |
Ruchika Gupta | ac1b269 | 2014-10-15 11:35:30 +0530 | [diff] [blame] | 12 | |
Ruchika Gupta | 4345a57 | 2014-10-07 15:46:20 +0530 | [diff] [blame] | 13 | #define KEY_IDNFR_SZ_BYTES 16 |
| 14 | |
Raul Cardenas | b5a36d8 | 2015-02-27 11:22:06 -0600 | [diff] [blame] | 15 | #ifdef CONFIG_CMD_DEKBLOB |
| 16 | /* inline_cnstr_jobdesc_blob_dek: |
| 17 | * Intializes and constructs the job descriptor for DEK encapsulation |
| 18 | * using the given parameters. |
| 19 | * @desc: reference to the job descriptor |
| 20 | * @plain_txt: reference to the DEK |
| 21 | * @enc_blob: reference where to store the blob |
| 22 | * @in_sz: size in bytes of the DEK |
| 23 | * @return: 0 on success, ECONSTRJDESC otherwise |
| 24 | */ |
| 25 | int inline_cnstr_jobdesc_blob_dek(uint32_t *desc, const uint8_t *plain_txt, |
| 26 | uint8_t *enc_blob, uint32_t in_sz); |
| 27 | #endif |
| 28 | |
Ruchika Gupta | ac1b269 | 2014-10-15 11:35:30 +0530 | [diff] [blame] | 29 | void inline_cnstr_jobdesc_hash(uint32_t *desc, |
| 30 | const uint8_t *msg, uint32_t msgsz, uint8_t *digest, |
| 31 | u32 alg_type, uint32_t alg_size, int sg_tbl); |
| 32 | |
Ruchika Gupta | 4345a57 | 2014-10-07 15:46:20 +0530 | [diff] [blame] | 33 | void inline_cnstr_jobdesc_blob_encap(uint32_t *desc, uint8_t *key_idnfr, |
| 34 | uint8_t *plain_txt, uint8_t *enc_blob, |
| 35 | uint32_t in_sz); |
| 36 | |
| 37 | void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t *key_idnfr, |
| 38 | uint8_t *enc_blob, uint8_t *plain_txt, |
| 39 | uint32_t out_sz); |
| 40 | |
Michael Walle | 602cc8d | 2020-06-27 22:58:51 +0200 | [diff] [blame] | 41 | void inline_cnstr_jobdesc_rng_instantiation(u32 *desc, int handle, int do_sk); |
Ruchika Gupta | 29c1a6b | 2015-01-23 16:01:55 +0530 | [diff] [blame] | 42 | |
Michael Walle | e692a00 | 2020-06-27 22:58:52 +0200 | [diff] [blame] | 43 | void inline_cnstr_jobdesc_rng_deinstantiation(u32 *desc, int handle); |
| 44 | |
Michael Walle | b258eb2 | 2020-06-27 22:58:53 +0200 | [diff] [blame] | 45 | void inline_cnstr_jobdesc_rng(u32 *desc, void *data_out, u32 size); |
| 46 | |
Ruchika Gupta | 29c1a6b | 2015-01-23 16:01:55 +0530 | [diff] [blame] | 47 | void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc, |
| 48 | struct pk_in_params *pkin, uint8_t *out, |
| 49 | uint32_t out_siz); |
Michael Walle | b258eb2 | 2020-06-27 22:58:53 +0200 | [diff] [blame] | 50 | |
Ruchika Gupta | ac1b269 | 2014-10-15 11:35:30 +0530 | [diff] [blame] | 51 | #endif |