mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
crypto/fsl: Update blob cmd to accept 64bit addresses
Update blob cmd to accept 64bit source, key modifier and destination addresses. Also correct output result print format for fsl specific implementation of blob cmd. Signed-off-by: Sumit Garg <sumit.garg@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
parent
04e5c6d9cc
commit
7fe1d6a410
2 changed files with 11 additions and 4 deletions
|
@ -54,7 +54,7 @@ __weak int blob_encap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
|
||||||
*/
|
*/
|
||||||
static int do_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
static int do_blob(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
uint32_t key_addr, src_addr, dst_addr, len;
|
ulong key_addr, src_addr, dst_addr, len;
|
||||||
uint8_t *km_ptr, *src_ptr, *dst_ptr;
|
uint8_t *km_ptr, *src_ptr, *dst_ptr;
|
||||||
int enc, ret = 0;
|
int enc, ret = 0;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ int blob_decap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
|
||||||
int ret, i = 0;
|
int ret, i = 0;
|
||||||
u32 *desc;
|
u32 *desc;
|
||||||
|
|
||||||
printf("\nDecapsulating data to form blob\n");
|
printf("\nDecapsulating blob to get data\n");
|
||||||
desc = malloc(sizeof(int) * MAX_CAAM_DESCSIZE);
|
desc = malloc(sizeof(int) * MAX_CAAM_DESCSIZE);
|
||||||
if (!desc) {
|
if (!desc) {
|
||||||
debug("Not enough memory for descriptor allocation\n");
|
debug("Not enough memory for descriptor allocation\n");
|
||||||
|
@ -27,12 +27,15 @@ int blob_decap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
|
||||||
|
|
||||||
inline_cnstr_jobdesc_blob_decap(desc, key_mod, src, dst, len);
|
inline_cnstr_jobdesc_blob_decap(desc, key_mod, src, dst, len);
|
||||||
|
|
||||||
|
debug("Descriptor dump:\n");
|
||||||
for (i = 0; i < 14; i++)
|
for (i = 0; i < 14; i++)
|
||||||
printf("%x\n", *(desc + i));
|
debug("Word[%d]: %08x\n", i, *(desc + i));
|
||||||
ret = run_descriptor_jr(desc);
|
ret = run_descriptor_jr(desc);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
printf("Error in Decapsulation %d\n", ret);
|
printf("Error in Decapsulation %d\n", ret);
|
||||||
|
else
|
||||||
|
printf("Decapsulation Success\n");
|
||||||
|
|
||||||
free(desc);
|
free(desc);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -51,12 +54,16 @@ int blob_encap(u8 *key_mod, u8 *src, u8 *dst, u32 len)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline_cnstr_jobdesc_blob_encap(desc, key_mod, src, dst, len);
|
inline_cnstr_jobdesc_blob_encap(desc, key_mod, src, dst, len);
|
||||||
|
|
||||||
|
debug("Descriptor dump:\n");
|
||||||
for (i = 0; i < 14; i++)
|
for (i = 0; i < 14; i++)
|
||||||
printf("%x\n", *(desc + i));
|
debug("Word[%d]: %08x\n", i, *(desc + i));
|
||||||
ret = run_descriptor_jr(desc);
|
ret = run_descriptor_jr(desc);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
printf("Error in Encapsulation %d\n", ret);
|
printf("Error in Encapsulation %d\n", ret);
|
||||||
|
else
|
||||||
|
printf("Encapsulation Success\n");
|
||||||
|
|
||||||
free(desc);
|
free(desc);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue