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