diff options
Diffstat (limited to 'src/manager/crypto/tz-backend/tz-context.h')
-rw-r--r-- | src/manager/crypto/tz-backend/tz-context.h | 56 |
1 files changed, 52 insertions, 4 deletions
diff --git a/src/manager/crypto/tz-backend/tz-context.h b/src/manager/crypto/tz-backend/tz-context.h index 123c21e1..05c336ec 100644 --- a/src/manager/crypto/tz-backend/tz-context.h +++ b/src/manager/crypto/tz-backend/tz-context.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 - 2018 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2017 - 2019 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include <memory> #include <tz-backend/obj.h> #include <generic-backend/encryption-params.h> +#include <tz-backend/tz-serializer.h> namespace CKM { namespace Crypto { @@ -48,6 +49,28 @@ public: const uint32_t pwdKeySizeBits, RawBuffer &keyId, RawBuffer &pwdTag); + void generateRSAKey(uint32_t keySizeBits, + const RawBuffer &pubPwd, + const RawBuffer &pubPwdIv, + const RawBuffer &privPwd, + const RawBuffer &privPwdIv, + RawBuffer &pubKeyId, + RawBuffer &pubKeyTag, + RawBuffer &privKeyId, + RawBuffer &privKeyTag); + void generateDSAKey(uint32_t keySizeBits, + const RawBuffer &prime, + const RawBuffer &subprime, + const RawBuffer &base, + const RawBuffer &pubPwd, + const RawBuffer &pubPwdIv, + const RawBuffer &privPwd, + const RawBuffer &privPwdIv, + RawBuffer &pubKeyId, + RawBuffer &pubKeyTag, + RawBuffer &privKeyId, + RawBuffer &privKeyTag); + void importData(uint32_t dataType, const RawBuffer &data, const Crypto::EncryptionParams &encData, @@ -60,13 +83,13 @@ public: void executeCrypt(tz_command cmd, tz_algo_type algo, - const RawBuffer &key, + const RawBuffer &keyId, const Pwd &pwd, const RawBuffer &iv, const RawBuffer &data, RawBuffer &out); - void executeEncryptAE(const RawBuffer &key, + void executeEncryptAE(const RawBuffer &keyId, const Pwd &pwd, const RawBuffer &iv, int tagSizeBits, @@ -74,7 +97,7 @@ public: const RawBuffer &data, RawBuffer &out, RawBuffer &tag); - void executeDecryptAE(const RawBuffer &key, + void executeDecryptAE(const RawBuffer &keyId, const Pwd &pwd, const RawBuffer &iv, int tagSizeBits, @@ -83,6 +106,19 @@ public: const RawBuffer &data, RawBuffer &out); + void executeSign(tz_algo_type algo, + tz_hash_type hash, + const RawBuffer &keyId, + const Pwd &pwd, + const RawBuffer &message, + RawBuffer &signature); + int executeVerify(tz_algo_type algo, + tz_hash_type hash, + const RawBuffer &keyId, + const Pwd &pwd, + const RawBuffer &message, + const RawBuffer &signature); + void executeDestroy(const RawBuffer &keyId); void getData(const RawBuffer &dataId, @@ -105,6 +141,18 @@ private: void Execute(tz_command commandID, TEEC_Operation* op); + void GenerateAKey(tz_command commandID, + TZSerializer &sIn, + uint32_t keySizeBits, + const RawBuffer &pubPwd, + const RawBuffer &pubPwdIv, + const RawBuffer &privPwd, + const RawBuffer &privPwdIv, + RawBuffer &pubKeyId, + RawBuffer &pubKeyTag, + RawBuffer &privKeyId, + RawBuffer &privKeyTag); + TEEC_Context m_Context; TEEC_Session m_Session; |