Home
last modified time | relevance | path

Searched refs:plaintext (Results 1 - 7 of 7) sorted by relevance

/drivers/peripheral/user_auth/test/unittest/base_test/src/
H A Dadaptor_algorithm_test.cpp173 Buffer *plaintext = nullptr; in HWTEST_F() local
181 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM); in HWTEST_F()
182 plaintext = CreateBufferBySize(plainTextLen); in HWTEST_F()
183 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM); in HWTEST_F()
184 plaintext->contentSize = plainTextLen; in HWTEST_F()
185 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM); in HWTEST_F()
186 plaintext->contentSize = plainTextErrLen; in HWTEST_F()
187 EXPECT_EQ(AesGcmEncrypt(plaintext, nullptr, &ciphertext, &tag), RESULT_BAD_PARAM); in HWTEST_F()
188 EXPECT_EQ(AesGcmEncrypt(plaintext, &aesGcmParam, &ciphertext, &tag), RESULT_BAD_PARAM); in HWTEST_F()
191 EXPECT_EQ(AesGcmEncrypt(plaintext, in HWTEST_F()
205 Buffer *plaintext = nullptr; HWTEST_F() local
247 Buffer *plaintext = CreateBufferBySize(contextSize); HWTEST_F() local
[all...]
/drivers/peripheral/pin_auth/hdi_service/adaptor/src/
H A Dadaptor_algorithm.c449 static bool DoAesEncrypt(EVP_CIPHER_CTX *ctx, const Buffer *plaintext, Buffer **ciphertext, Buffer **tag) in DoAesEncrypt() argument
451 *ciphertext = CreateBufferBySize(plaintext->contentSize); in DoAesEncrypt()
460 plaintext->buf, plaintext->contentSize) != OPENSSL_SUCCESS) { in DoAesEncrypt()
493 int32_t AesGcm256Encrypt(const Buffer *plaintext, const AesGcmParam *param, Buffer **ciphertext, Buffer **tag) in AesGcm256Encrypt() argument
495 if (!IsBufferValid(plaintext) || in AesGcm256Encrypt()
496 (plaintext->contentSize == 0) ||(plaintext->contentSize > CIPHER_INFO_MAX_SIZE) || in AesGcm256Encrypt()
512 if (!DoAesEncrypt(ctx, plaintext, ciphertext, tag)) { in AesGcm256Encrypt()
550 static bool DoAesDecrypt(EVP_CIPHER_CTX *ctx, const Buffer *ciphertext, const Buffer *tag, Buffer **plaintext) in DoAesDecrypt() argument
590 AesGcm256Decrypt(const Buffer *ciphertext, const AesGcmParam *param, const Buffer *tag, Buffer **plaintext) AesGcm256Decrypt() argument
[all...]
/drivers/peripheral/user_auth/hdi_service/adaptor/src/
H A Dadaptor_algorithm.c339 int32_t AesGcmEncrypt(const Buffer *plaintext, const AesGcmParam *aesGcmParam, Buffer **ciphertext, Buffer **tag) in AesGcmEncrypt() argument
341 if (!IsBufferValid(plaintext) || in AesGcmEncrypt()
342 plaintext->contentSize == 0 || plaintext->contentSize > AES_GCM_TEXT_MAX_SIZE || in AesGcmEncrypt()
348 (*ciphertext) = CreateBufferBySize(plaintext->contentSize); in AesGcmEncrypt()
360 (unsigned char *)plaintext->buf, plaintext->contentSize) != OPENSSL_SUCCESS) { in AesGcmEncrypt()
421 int32_t AesGcmDecrypt(const Buffer *ciphertext, const AesGcmParam *aesGcmParam, const Buffer *tag, Buffer **plaintext) in AesGcmDecrypt() argument
425 !CheckAesGcmParam(aesGcmParam) || !CheckBufferWithSize(tag, AES_GCM_TAG_SIZE) || plaintext == NULL) { in AesGcmDecrypt()
430 (*plaintext) in AesGcmDecrypt()
[all...]
/drivers/peripheral/user_auth/hdi_service/common/src/
H A Duser_sign_centre.c91 Buffer *plaintext = NULL; in DecryptTokenCipher() local
101 ret = AesGcmDecrypt(&ciphertext, &aesGcmParam, &tag, &plaintext); in DecryptTokenCipher()
106 if (!CheckBufferWithSize(plaintext, sizeof(tokenPlain->tokenDataToEncrypt))) { in DecryptTokenCipher()
112 plaintext->buf, plaintext->contentSize) != EOK) { in DecryptTokenCipher()
119 DestoryBuffer(plaintext); in DecryptTokenCipher()
241 const Buffer plaintext = GetTmpBuffer((uint8_t *)data, sizeof(TokenDataToEncrypt), sizeof(TokenDataToEncrypt)); in GetTokenDataCipherResult() local
242 ret = AesGcmEncrypt(&plaintext, &aesGcmParam, &ciphertext, &tag); in GetTokenDataCipherResult()
/drivers/peripheral/user_auth/hdi_service/adaptor/inc/
H A Dadaptor_algorithm.h56 int32_t AesGcmEncrypt(const Buffer *plaintext, const AesGcmParam *aesGcmParam, Buffer **ciphertext, Buffer **tag);
57 int32_t AesGcmDecrypt(const Buffer *ciphertext, const AesGcmParam *aesGcmParam, const Buffer *tag, Buffer **plaintext);
/drivers/peripheral/pin_auth/hdi_service/adaptor/inc/
H A Dadaptor_algorithm.h56 int32_t AesGcm256Encrypt(const Buffer *plaintext, const AesGcmParam *param, Buffer **ciphertext, Buffer **tag);
57 int32_t AesGcm256Decrypt(const Buffer *ciphertext, const AesGcmParam *param, const Buffer *tag, Buffer **plaintext);
/drivers/peripheral/pin_auth/test/unittest/pin_auth/adaptor/src/
H A Dadaptor_algorithm_test.cpp172 Buffer *plaintext = CreateBufferBySize(20); in HWTEST_F() local
173 ASSERT_NE(plaintext, nullptr); in HWTEST_F()
174 int32_t result = AesGcm256Encrypt(plaintext, nullptr, nullptr, nullptr); in HWTEST_F()
176 DestroyBuffer(plaintext); in HWTEST_F()

Completed in 4 milliseconds