Home
last modified time | relevance | path

Searched refs:ciphertext (Results 1 – 6 of 6) sorted by relevance

/drivers/peripheral/user_auth/test/unittest/base_test/src/
Dadaptor_algorithm_test.cpp174 Buffer *ciphertext = nullptr; variable
176 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM);
178 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM);
180 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM);
182 EXPECT_EQ(AesGcmEncrypt(plaintext, nullptr, &ciphertext, &tag), RESULT_BAD_PARAM);
183 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM);
186 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM);
190 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, nullptr), RESULT_BAD_PARAM);
198 Buffer *ciphertext = nullptr; variable
202 EXPECT_EQ(AesGcmDecrypt(ciphertext, &aesGcmParam, tag, &plaintext), RESULT_BAD_PARAM);
[all …]
/drivers/peripheral/pin_auth/hdi_service/adaptor/src/
Dadaptor_algorithm.c306 Buffer *ciphertext = CreateBufferBySize(plaintext->contentSize); in CreateCiphertext() local
307 if (!IsBufferValid(ciphertext)) { in CreateCiphertext()
313 DestoryBuffer(ciphertext); in CreateCiphertext()
317 if (EVP_EncryptUpdate(ctx, (unsigned char *)(ciphertext->buf), &outLen, in CreateCiphertext()
320 DestoryBuffer(ciphertext); in CreateCiphertext()
325 DestoryBuffer(ciphertext); in CreateCiphertext()
328 ciphertext->contentSize = (uint32_t)outLen; in CreateCiphertext()
329 if (ciphertext->maxSize < ciphertext->contentSize) { in CreateCiphertext()
331 DestoryBuffer(ciphertext); in CreateCiphertext()
336 DestoryBuffer(ciphertext); in CreateCiphertext()
[all …]
/drivers/peripheral/user_auth/hdi_service/adaptor/src/
Dadaptor_algorithm.c338 int32_t AesGcmEncrypt(const Buffer *plaintext, const AesGcmParam *aesGcmParam, Buffer **ciphertext,… in AesGcmEncrypt() argument
342 !CheckAesGcmParam(aesGcmParam) || ciphertext == NULL || tag == NULL) { in AesGcmEncrypt()
347 (*ciphertext) = CreateBufferBySize(plaintext->contentSize); in AesGcmEncrypt()
349 if (ctx == NULL || (*ciphertext) == NULL || (*tag) == NULL) { in AesGcmEncrypt()
358 if (EVP_EncryptUpdate(ctx, (unsigned char *)((*ciphertext)->buf), &outLen, in AesGcmEncrypt()
363 if (outLen < 0 || (uint32_t)outLen > (*ciphertext)->maxSize) { in AesGcmEncrypt()
367 (*ciphertext)->contentSize = (uint32_t)outLen; in AesGcmEncrypt()
382 DestoryBuffer(*ciphertext); in AesGcmEncrypt()
383 *ciphertext = NULL; in AesGcmEncrypt()
420 int32_t AesGcmDecrypt(const Buffer *ciphertext, const AesGcmParam *aesGcmParam, const Buffer *tag, … in AesGcmDecrypt() argument
[all …]
/drivers/peripheral/user_auth/hdi_service/user_auth/src/
Duser_sign_centre.c100 const Buffer ciphertext = GetTmpBuffer((uint8_t *)userAuthToken->tokenDataCipher, in DecryptTokenCipher() local
102 ret = AesGcmDecrypt(&ciphertext, &aesGcmParam, &tag, &plaintext); in DecryptTokenCipher()
214 IAM_STATIC ResultCode CopyTokenCipherParam(const Buffer *ciphertext, const Buffer *tag, const Buffe… in CopyTokenCipherParam() argument
217 if (!CheckBufferWithSize(ciphertext, sizeof(authToken->tokenDataCipher))) { in CopyTokenCipherParam()
222 ciphertext->buf, ciphertext->contentSize) != EOK) { in CopyTokenCipherParam()
271 Buffer *ciphertext = NULL; in GetTokenDataCipherResult() local
279 ret = AesGcmEncrypt(&plaintext, &aesGcmParam, &ciphertext, &tag); in GetTokenDataCipherResult()
284 ret = CopyTokenCipherParam(ciphertext, tag, aesGcmParam.iv, authToken); in GetTokenDataCipherResult()
292 DestoryBuffer(ciphertext); in GetTokenDataCipherResult()
/drivers/peripheral/user_auth/hdi_service/adaptor/inc/
Dadaptor_algorithm.h52 int32_t AesGcmEncrypt(const Buffer *plaintext, const AesGcmParam *aesGcmParam, Buffer **ciphertext,…
53 int32_t AesGcmDecrypt(const Buffer *ciphertext, const AesGcmParam *aesGcmParam, const Buffer *tag, …
/drivers/interface/huks/v1_0/
DIHuks.idl73 * @brief Generates a key and returns the key in ciphertext.
83 * ciphertext. For details about the key material struct, see the
105 * @param encKeyOut Indicates the key {@link HuksBlob} in ciphertext
132 * @param encKeyOut Indicates the key {@link HuksBlob} in ciphertext
149 * in ciphertext. For details about the key material struct, see the
170 * @param encKey Indicates the key material {@link HuksBlob} in ciphertext.
259 * @param encKey Indicates the key material {@link HuksBlob} in ciphertext
274 * @param encKey Indicates the key material {@link HuksBlob} in ciphertext.
310 * @param encKey Indicates the key material {@link HuksBlob} in ciphertext.
329 * @param encKey Indicates the key material {@link HuksBlob} in ciphertext.
[all …]