2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2014-10-15 06:05:30 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Freescale Semiconductor, Inc.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __JOBDESC_H
|
|
|
|
#define __JOBDESC_H
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
2015-01-23 10:31:55 +00:00
|
|
|
#include "rsa_caam.h"
|
2014-10-15 06:05:30 +00:00
|
|
|
|
2014-10-07 10:16:20 +00:00
|
|
|
#define KEY_IDNFR_SZ_BYTES 16
|
|
|
|
|
2015-02-27 17:22:06 +00:00
|
|
|
#ifdef CONFIG_CMD_DEKBLOB
|
|
|
|
/* inline_cnstr_jobdesc_blob_dek:
|
|
|
|
* Intializes and constructs the job descriptor for DEK encapsulation
|
|
|
|
* using the given parameters.
|
|
|
|
* @desc: reference to the job descriptor
|
|
|
|
* @plain_txt: reference to the DEK
|
|
|
|
* @enc_blob: reference where to store the blob
|
|
|
|
* @in_sz: size in bytes of the DEK
|
|
|
|
* @return: 0 on success, ECONSTRJDESC otherwise
|
|
|
|
*/
|
|
|
|
int inline_cnstr_jobdesc_blob_dek(uint32_t *desc, const uint8_t *plain_txt,
|
|
|
|
uint8_t *enc_blob, uint32_t in_sz);
|
|
|
|
#endif
|
|
|
|
|
2014-10-15 06:05:30 +00:00
|
|
|
void inline_cnstr_jobdesc_hash(uint32_t *desc,
|
|
|
|
const uint8_t *msg, uint32_t msgsz, uint8_t *digest,
|
|
|
|
u32 alg_type, uint32_t alg_size, int sg_tbl);
|
|
|
|
|
2014-10-07 10:16:20 +00:00
|
|
|
void inline_cnstr_jobdesc_blob_encap(uint32_t *desc, uint8_t *key_idnfr,
|
|
|
|
uint8_t *plain_txt, uint8_t *enc_blob,
|
|
|
|
uint32_t in_sz);
|
|
|
|
|
|
|
|
void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t *key_idnfr,
|
|
|
|
uint8_t *enc_blob, uint8_t *plain_txt,
|
|
|
|
uint32_t out_sz);
|
|
|
|
|
2020-06-27 20:58:51 +00:00
|
|
|
void inline_cnstr_jobdesc_rng_instantiation(u32 *desc, int handle, int do_sk);
|
2015-01-23 10:31:55 +00:00
|
|
|
|
|
|
|
void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
|
|
|
|
struct pk_in_params *pkin, uint8_t *out,
|
|
|
|
uint32_t out_siz);
|
2014-10-15 06:05:30 +00:00
|
|
|
#endif
|