]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
b9eebfad RG |
2 | /* |
3 | * Copyright 2014 Freescale Semiconductor, Inc. | |
4 | * | |
b9eebfad RG |
5 | */ |
6 | ||
7 | #ifndef __JOBDESC_H | |
8 | #define __JOBDESC_H | |
9 | ||
b9eebfad | 10 | #include <asm/io.h> |
34276478 | 11 | #include "rsa_caam.h" |
b9eebfad | 12 | |
c5de15cb RG |
13 | #define KEY_IDNFR_SZ_BYTES 16 |
14 | ||
0200020b RC |
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 | ||
b9eebfad RG |
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 | ||
c5de15cb RG |
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 | ||
c269a970 | 41 | void inline_cnstr_jobdesc_rng_instantiation(u32 *desc, int handle, int do_sk); |
34276478 | 42 | |
b980f9e2 MW |
43 | void inline_cnstr_jobdesc_rng_deinstantiation(u32 *desc, int handle); |
44 | ||
ea95f214 MW |
45 | void inline_cnstr_jobdesc_rng(u32 *desc, void *data_out, u32 size); |
46 | ||
34276478 RG |
47 | void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc, |
48 | struct pk_in_params *pkin, uint8_t *out, | |
49 | uint32_t out_siz); | |
ea95f214 | 50 | |
b9eebfad | 51 | #endif |