diff options
author | Ji Luo <ji.luo@nxp.com> | 2018-10-31 09:34:33 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2018-11-02 20:50:09 -0500 |
commit | 4207a8df84dadbc68c99ed965661546a6af5a99c (patch) | |
tree | 17f2e6931008f428f65d845972b77481a2538190 /include | |
parent | 86b33989f42cc97ef16dd8e57c26eb0fc96224c1 (diff) |
MA-13275 [trusty] Add tipc command to generate blob with CAAM
Add new hwcrypto tipc command and handler to generate blob with
CAAM.
Test: Message exchange with trusty and blob encapsulate/decapsulate ok.
Change-Id: I925b47cb3e22eeddf4c89e84a9c994d2f30423fe
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/interface/hwcrypto/hwcrypto.h | 12 | ||||
-rw-r--r-- | include/trusty/hwcrypto.h | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/interface/hwcrypto/hwcrypto.h b/include/interface/hwcrypto/hwcrypto.h index 116bfe079f8..0a62ea21027 100644 --- a/include/interface/hwcrypto/hwcrypto.h +++ b/include/interface/hwcrypto/hwcrypto.h @@ -37,6 +37,7 @@ enum hwcrypto_command { HWCRYPTO_RESP_BIT = 1, HWCRYPTO_HASH = (1 << HWCRYPTO_REQ_SHIFT), + HWCRYPTO_ENCAP_BLOB = (2 << HWCRYPTO_REQ_SHIFT), }; /** @@ -84,4 +85,15 @@ typedef struct hwcrypto_hash_msg { enum hwcrypto_hash_algo algo; } hwcrypto_hash_msg; +/** + * @plain_pa: physical start address of the plain blob buf. + * @plain_size: size of the plain blob. + * @blob: physical start addrss of the output buf. + */ +typedef struct hwcrypto_blob_msg { + uint32_t plain_pa; + uint32_t plain_size; + uint32_t blob_pa; +}hwcrypto_blob_msg; + #endif /* TRUSTY_INTERFACE_HWCRYPTO_H_ */ diff --git a/include/trusty/hwcrypto.h b/include/trusty/hwcrypto.h index fd522dfd4ab..22f08354323 100644 --- a/include/trusty/hwcrypto.h +++ b/include/trusty/hwcrypto.h @@ -56,4 +56,14 @@ void hwcrypto_tipc_shutdown(struct trusty_ipc_dev *dev); int hwcrypto_hash(uint32_t in_addr, uint32_t in_len, uint32_t out_addr, uint32_t out_len, enum hwcrypto_hash_algo algo); +/* + * Send request to secure side to generate blob with caam. + * Returns one of trusty_err. + * + * @plain_pa: physical start address of the plain blob buffer. + * @plain_size: size of the plain blob buffer. + * @blob_pa: physical start address of the generated blob buffer. + */ +int hwcrypto_gen_blob(uint32_t plain_pa, + uint32_t plain_size, uint32_t blob_pa); #endif /* TRUSTY_HWCRYPTO_H_ */ |