blob: 69adfdca95b552e3ec8f2492214bb1c6d7ea11da [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ruchika Guptaac1b2692014-10-15 11:35:30 +05302/*
3 * Copyright 2014 Freescale Semiconductor, Inc.
4 *
Ruchika Guptaac1b2692014-10-15 11:35:30 +05305 */
6
7#ifndef __JOBDESC_H
8#define __JOBDESC_H
9
Ruchika Guptaac1b2692014-10-15 11:35:30 +053010#include <asm/io.h>
Ruchika Gupta29c1a6b2015-01-23 16:01:55 +053011#include "rsa_caam.h"
Ruchika Guptaac1b2692014-10-15 11:35:30 +053012
Ruchika Gupta4345a572014-10-07 15:46:20 +053013#define KEY_IDNFR_SZ_BYTES 16
14
Raul Cardenasb5a36d82015-02-27 11:22:06 -060015#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 */
25int 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 Guptaac1b2692014-10-15 11:35:30 +053029void 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 Gupta4345a572014-10-07 15:46:20 +053033void 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
37void 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 Walle602cc8d2020-06-27 22:58:51 +020041void inline_cnstr_jobdesc_rng_instantiation(u32 *desc, int handle, int do_sk);
Ruchika Gupta29c1a6b2015-01-23 16:01:55 +053042
Michael Wallee692a002020-06-27 22:58:52 +020043void inline_cnstr_jobdesc_rng_deinstantiation(u32 *desc, int handle);
44
Michael Walleb258eb22020-06-27 22:58:53 +020045void inline_cnstr_jobdesc_rng(u32 *desc, void *data_out, u32 size);
46
Ruchika Gupta29c1a6b2015-01-23 16:01:55 +053047void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
48 struct pk_in_params *pkin, uint8_t *out,
49 uint32_t out_siz);
Michael Walleb258eb22020-06-27 22:58:53 +020050
Ruchika Guptaac1b2692014-10-15 11:35:30 +053051#endif