blob: 75c9424c4a881c1cbc23318185ffefb76b5af275 [file] [log] [blame]
Ruchika Guptaac1b2692014-10-15 11:35:30 +05301/*
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 Gupta29c1a6b2015-01-23 16:01:55 +053013#include "rsa_caam.h"
Ruchika Guptaac1b2692014-10-15 11:35:30 +053014
Ruchika Gupta4345a572014-10-07 15:46:20 +053015#define KEY_IDNFR_SZ_BYTES 16
16
Raul Cardenasb5a36d82015-02-27 11:22:06 -060017#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 */
27int 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 Guptaac1b2692014-10-15 11:35:30 +053031void 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 Gupta4345a572014-10-07 15:46:20 +053035void 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
39void 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
Lukas Aueraed8eac2018-01-25 14:11:17 +010043void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc, int handle);
Ruchika Gupta29c1a6b2015-01-23 16:01:55 +053044
45void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
46 struct pk_in_params *pkin, uint8_t *out,
47 uint32_t out_siz);
Ruchika Guptaac1b2692014-10-15 11:35:30 +053048#endif