RawBuffer &tag,
const RawBuffer &hash);
+void importWrappedKey(const RawBuffer &wrappingKeyId,
+ const Pwd &wrappingKeyPwd,
+ const CryptoAlgorithm &alg,
+ const Data &encryptedKey,
+ const Password &encryptedKeyPassword,
+ const RawBuffer &encryptedKeyIV,
+ RawBuffer &encryptedKeyTag,
+ const RawBuffer &encryptedKeyId);
+
+RawBuffer exportWrappedKey(const RawBuffer &wrappingKeyId,
+ const Pwd &wrappingKeyPwd,
+ const CryptoAlgorithm &alg,
+ const RawBuffer &keyToWrapId,
+ const Pwd &keyToWrapPwd);
+
RawBuffer getData(const RawBuffer &dataId,
const Pwd &pwd);
void destroyData(const RawBuffer &dataId);
-void destroyKey(const RawBuffer &key);
+void destroyKey(const RawBuffer &keyId);
RawBuffer symmetricEncrypt(
- const RawBuffer &key,
+ const RawBuffer &keyId,
const Pwd &pwd,
const CryptoAlgorithm &alg,
const RawBuffer &data);
RawBuffer symmetricDecrypt(
- const RawBuffer &key,
+ const RawBuffer &keyId,
const Pwd &pwd,
const CryptoAlgorithm &alg,
const RawBuffer &cipher);
RawBuffer asymmetricEncrypt(
- const RawBuffer &key,
+ const RawBuffer &keyId,
const Pwd &pwd,
const CryptoAlgorithm &alg,
const RawBuffer &data);
RawBuffer asymmetricDecrypt(
- const RawBuffer &key,
+ const RawBuffer &keyId,
const Pwd &pwd,
const CryptoAlgorithm &alg,
const RawBuffer &cipher);
-BufferPair encryptDataAesGcm(const RawBuffer &key,
+BufferPair encryptDataAesGcm(const RawBuffer &keyId,
const Pwd &pwd,
const RawBuffer &iv,
int tagSize,
const RawBuffer &data,
const RawBuffer &aad = RawBuffer());
-RawBuffer decryptDataAesGcm(const RawBuffer &key,
+RawBuffer decryptDataAesGcm(const RawBuffer &keyId,
const Pwd &pwd,
const RawBuffer &iv,
const RawBuffer &tag,
const RawBuffer &data,
const RawBuffer &aad = RawBuffer());
-RawBuffer sign(const RawBuffer &pkey,
+uint32_t initCipher(const RawBuffer &keyId,
+ const Pwd &pwd,
+ const CryptoAlgorithm &alg,
+ bool encrypt);
+
+void addAAD(uint32_t opId,
+ const RawBuffer &aad);
+
+RawBuffer updateCipher(uint32_t opId,
+ const RawBuffer &data);
+
+RawBuffer finalizeCipher(uint32_t opId,
+ const RawBuffer &data);
+
+RawBuffer sign(const RawBuffer &pkeyId,
const Pwd &pwd,
const CryptoAlgorithm &alg,
const RawBuffer &message);
-int verify(const RawBuffer &pkey,
+int verify(const RawBuffer &pkeyId,
const Pwd &pwd,
const CryptoAlgorithm &alg,
const RawBuffer &message,
const RawBuffer &signature);
-void deriveECDH(const RawBuffer &prvKey,
+void deriveECDH(const RawBuffer &prvKeyId,
const Pwd &prvKeyPwd,
const RawBuffer &pubKey,
const Password &secretPwd,
RawBuffer &secretTag,
const RawBuffer &secretHash);
-void deriveKBKDF(const RawBuffer &secret,
+void deriveKBKDF(const RawBuffer &secretId,
+ const Pwd &secretPwd,
const CryptoAlgorithm &alg,
const Password &keyPwd,
const RawBuffer &keyPwdIV,
RawBuffer &keyTag,
const RawBuffer &keyHash);
+
+size_t maxChunkSize();
} // namespace Internals
} // namespace TZ
} // namespace Crypto