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