/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
H A D | hks_mbedtls_aes.c | 99 const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) in AesCbcNoPaddingCrypt() 129 cipherText->data); in AesCbcNoPaddingCrypt() 132 (void)memset_s(cipherText->data, cipherText->size, 0, cipherText->size); in AesCbcNoPaddingCrypt() 136 cipherText->size = message->size; in AesCbcNoPaddingCrypt() 190 const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) in AesCbcNoPaddingCryptUpdate() 220 cipherText->data); in AesCbcNoPaddingCryptUpdate() 223 (void)memset_s(cipherText->data, cipherText in AesCbcNoPaddingCryptUpdate() 98 AesCbcNoPaddingCrypt(const struct HksBlob *key, const struct HksCipherParam *cipherParam, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcNoPaddingCrypt() argument 189 AesCbcNoPaddingCryptUpdate(void *cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcNoPaddingCryptUpdate() argument 239 AesCbcNoPaddingCryptFinal(void **cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcNoPaddingCryptFinal() argument 291 AesCbcPkcs7Crypt(const struct HksBlob *key, const struct HksCipherParam *cipherParam, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcPkcs7Crypt() argument 408 AesCbcPkcs7CryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesCbcPkcs7CryptUpdate() argument 426 AesCbcPkcs7CryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesCbcPkcs7CryptFinal() argument 474 AesCbcCrypt(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcCrypt() argument 512 AesCbcCryptUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcCryptUpdate() argument 530 AesCbcCryptFinal(void **cryptoCtx, const uint8_t padding, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCbcCryptFinal() argument 550 AesEncryptGcm(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) AesEncryptGcm() argument 631 AesEncryptGcmUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) AesEncryptGcmUpdate() argument 653 AesEncryptGcmFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) AesEncryptGcmFinal() argument 694 AesDecryptGcm(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, struct HksBlob *cipherText) AesDecryptGcm() argument 773 AesDecryptGcmUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesDecryptGcmUpdate() argument 792 AesDecryptGcmFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) AesDecryptGcmFinal() argument 851 AesEncryptCcm(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) AesEncryptCcm() argument 892 AesDecryptCcm(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, struct HksBlob *cipherText) AesDecryptCcm() argument 934 AesCtrCrypt(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesCtrCrypt() argument 1061 AesCtrCryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesCtrCryptUpdate() argument 1079 AesCtrCryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesCtrCryptFinal() argument 1120 AesEcbNoPaddingCrypt(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesEcbNoPaddingCrypt() argument 1237 AesEcbNoPaddingData(mbedtls_cipher_context_t *ecbNoPadingctx, size_t blockSize, const struct HksBlob *message, struct HksBlob *cipherText, size_t *olenTotal) AesEcbNoPaddingData() argument 1279 GetAesEcbNoPaddingCtx(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, size_t *olenTotal) GetAesEcbNoPaddingCtx() argument 1314 AesEcbNoPaddingCryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesEcbNoPaddingCryptUpdate() argument 1324 AesEcbNoPaddingCryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) AesEcbNoPaddingCryptFinal() argument 1355 AesEcbCrypt(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) AesEcbCrypt() argument 1387 AesEcbCryptUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) AesEcbCryptUpdate() argument 1403 AesEcbCryptFinal(void **cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) AesEcbCryptFinal() argument 1430 HksMbedtlsAesEncrypt(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) HksMbedtlsAesEncrypt() argument 1497 HksMbedtlsAesEncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsAesEncryptUpdate() argument 1530 HksMbedtlsAesEncryptFinal(void** cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) HksMbedtlsAesEncryptFinal() argument 1562 HksMbedtlsAesDecrypt(const struct HksBlob *key, const struct HksUsageSpec *usageSpec, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsAesDecrypt() argument 1627 HksMbedtlsAesDecryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsAesDecryptUpdate() argument 1657 HksMbedtlsAesDecryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead) HksMbedtlsAesDecryptFinal() argument 1699 HksMbedtlsAesCryptoUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) HksMbedtlsAesCryptoUpdate() argument 1709 HksMbedtlsAesCryptoFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead, const bool encrypt) HksMbedtlsAesCryptoFinal() argument [all...] |
H A D | hks_mbedtls_3des.c | 163 void *cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) in Des3CbcNoPaddingCryptUpdate() 193 cipherText->data); in Des3CbcNoPaddingCryptUpdate() 196 (void)memset_s(cipherText->data, cipherText->size, 0, cipherText->size); in Des3CbcNoPaddingCryptUpdate() 201 cipherText->size = message->size; in Des3CbcNoPaddingCryptUpdate() 209 void **cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) in Des3CbcNoPaddingCryptFinal() 240 cipherText->data); in Des3CbcNoPaddingCryptFinal() 243 (void)memset_s(cipherText->data, cipherText in Des3CbcNoPaddingCryptFinal() 162 Des3CbcNoPaddingCryptUpdate( void *cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) Des3CbcNoPaddingCryptUpdate() argument 208 Des3CbcNoPaddingCryptFinal( void **cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) Des3CbcNoPaddingCryptFinal() argument 273 Des3CbcCryptUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) Des3CbcCryptUpdate() argument 287 Des3CbcCryptFinal(void **cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) Des3CbcCryptFinal() argument 377 Des3EcbNoPaddingData(mbedtls_cipher_context_t *ecbNoPadingctx, size_t blockSize, const struct HksBlob *message, struct HksBlob *cipherText, size_t *outLenTotal) Des3EcbNoPaddingData() argument 420 Get3DesEcbNoPaddingCtx(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, size_t *outLenTotal) Get3DesEcbNoPaddingCtx() argument 455 Des3EcbNoPaddingCryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) Des3EcbNoPaddingCryptUpdate() argument 465 Des3EcbNoPaddingCryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) Des3EcbNoPaddingCryptFinal() argument 509 Des3EcbCryptUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) Des3EcbCryptUpdate() argument 523 Des3EcbCryptFinal(void **cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) Des3EcbCryptFinal() argument 559 HksMbedtls3DesEncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtls3DesEncryptUpdate() argument 580 HksMbedtls3DesEncryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtls3DesEncryptFinal() argument 619 HksMbedtls3DesDecryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtls3DesDecryptUpdate() argument 637 HksMbedtls3DesDecryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtls3DesDecryptFinal() argument 666 HksMbedtls3DesCryptoUpdate( void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) HksMbedtls3DesCryptoUpdate() argument 676 HksMbedtls3DesCryptoFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) HksMbedtls3DesCryptoFinal() argument [all...] |
H A D | hks_mbedtls_des.c | 152 void *cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) in DesCbcNoPaddingCryptUpdate() 182 cipherText->data); in DesCbcNoPaddingCryptUpdate() 185 (void)memset_s(cipherText->data, cipherText->size, 0, cipherText->size); in DesCbcNoPaddingCryptUpdate() 190 cipherText->size = message->size; in DesCbcNoPaddingCryptUpdate() 198 void **cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) in DesCbcNoPaddingCryptFinal() 229 cipherText->data); in DesCbcNoPaddingCryptFinal() 232 (void)memset_s(cipherText->data, cipherText in DesCbcNoPaddingCryptFinal() 151 DesCbcNoPaddingCryptUpdate( void *cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) DesCbcNoPaddingCryptUpdate() argument 197 DesCbcNoPaddingCryptFinal( void **cryptoCtx, const struct HksBlob *message, const bool encrypt, struct HksBlob *cipherText) DesCbcNoPaddingCryptFinal() argument 262 DesCbcCryptUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) DesCbcCryptUpdate() argument 276 DesCbcCryptFinal(void **cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) DesCbcCryptFinal() argument 362 DesEcbNoPaddingData(mbedtls_cipher_context_t *ecbNoPadingctx, size_t blockSize, const struct HksBlob *message, struct HksBlob *cipherText, size_t *outLenTotal) DesEcbNoPaddingData() argument 405 GetDesEcbNoPaddingCtx(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, size_t *outLenTotal) GetDesEcbNoPaddingCtx() argument 440 DesEcbNoPaddingCryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) DesEcbNoPaddingCryptUpdate() argument 450 DesEcbNoPaddingCryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) DesEcbNoPaddingCryptFinal() argument 495 DesEcbCryptUpdate(void *cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) DesEcbCryptUpdate() argument 509 DesEcbCryptFinal(void **cryptoCtx, const uint8_t padding, const struct HksBlob *message, struct HksBlob *cipherText) DesEcbCryptFinal() argument 546 HksMbedtlsDesEncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsDesEncryptUpdate() argument 567 HksMbedtlsDesEncryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsDesEncryptFinal() argument 606 HksMbedtlsDesDecryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsDesDecryptUpdate() argument 624 HksMbedtlsDesDecryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) HksMbedtlsDesDecryptFinal() argument 653 HksMbedtlsDesCryptoUpdate( void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) HksMbedtlsDesCryptoUpdate() argument 663 HksMbedtlsDesCryptoFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText, const bool encrypt) HksMbedtlsDesCryptoFinal() argument [all...] |
/base/security/crypto_framework/test/unittest/include/ |
H A D | sm4_common.h | 33 uint8_t *cipherText, int *cipherTextLen); 37 uint8_t *cipherText, int cipherTextLen); 39 uint8_t *cipherText, int *cipherTextLen); 41 uint8_t *cipherText, int cipherTextLen); 43 uint8_t *cipherText, int *cipherTextLen); 45 uint8_t *cipherText, int cipherTextLen);
|
/base/security/crypto_framework/test/unittest/src/ |
H A D | crypto_sm4_cfb_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 75 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 81 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 97 uint8_t cipherText[128] = {0}; in HWTEST_F() local 123 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 129 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 145 uint8_t cipherText[128] = {0}; in HWTEST_F() local 171 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 177 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 193 uint8_t cipherText[12 in HWTEST_F() local 241 uint8_t cipherText[128] = {0}; HWTEST_F() local 289 uint8_t cipherText[128] = {0}; HWTEST_F() local 337 uint8_t cipherText[128] = {0}; HWTEST_F() local 384 uint8_t cipherText[128] = {0}; HWTEST_F() local 432 uint8_t cipherText[128] = {0}; HWTEST_F() local 480 uint8_t cipherText[128] = {0}; HWTEST_F() local 528 uint8_t cipherText[128] = {0}; HWTEST_F() local 576 uint8_t cipherText[128] = {0}; HWTEST_F() local 722 uint8_t cipherText[128] = {0}; HWTEST_F() local 800 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 838 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_sm4_gcm_cipher_test.cpp | 53 uint8_t cipherText[128] = {0}; in HWTEST_F() local 79 ret = Sm4Encrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); in HWTEST_F() 85 (void)memcpy_s(spec.tag.data, 16, cipherText + cipherTextLen - 16, 16); in HWTEST_F() 89 ret = Sm4Decrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); in HWTEST_F() 107 uint8_t cipherText[128] = {0}; in HWTEST_F() local 133 ret = Sm4Encrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); in HWTEST_F() 139 (void)memcpy_s(spec.tag.data, 16, cipherText + cipherTextLen - 16, 16); in HWTEST_F() 143 ret = Sm4Decrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); in HWTEST_F() 161 uint8_t cipherText[128] = {0}; in HWTEST_F() local 187 ret = Sm4Encrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, in HWTEST_F() 215 uint8_t cipherText[128] = {0}; HWTEST_F() local 269 uint8_t cipherText[128] = {0}; HWTEST_F() local 323 uint8_t cipherText[128] = {0}; HWTEST_F() local 403 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 445 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 489 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 532 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 574 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 628 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 682 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 737 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 790 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 844 uint8_t cipherText[128] = {0}; HWTEST_F() local 890 uint8_t cipherText[128] = {0}; HWTEST_F() local [all...] |
H A D | sm4_common.cpp | 74 uint8_t *cipherText, int *cipherTextLen) in Sm4EncryptWithInput() 91 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in Sm4EncryptWithInput() 104 if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK) { in Sm4EncryptWithInput() 117 uint8_t *cipherText, int cipherTextLen) in Sm4DecryptEmptyMsg() 119 HcfBlob input = { .data = cipherText, .len = cipherTextLen }; in Sm4DecryptEmptyMsg() 143 uint8_t *cipherText, int *cipherTextLen) in Sm4Encrypt() 162 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in Sm4Encrypt() 175 if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK) { in Sm4Encrypt() 186 uint8_t *cipherText, int cipherTextLen) in Sm4Decrypt() 189 HcfBlob input = {.data = reinterpret_cast<uint8_t *>(cipherText), in Sm4Decrypt() 73 Sm4EncryptWithInput(HcfCipher *cipher, HcfSymKey *key, HcfBlob *input, uint8_t *cipherText, int *cipherTextLen) Sm4EncryptWithInput() argument 116 Sm4DecryptEmptyMsg(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int cipherTextLen) Sm4DecryptEmptyMsg() argument 142 Sm4Encrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int *cipherTextLen) Sm4Encrypt() argument 185 Sm4Decrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int cipherTextLen) Sm4Decrypt() argument 232 Sm4NoUpdateEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int *cipherTextLen) Sm4NoUpdateEncrypt() argument 262 Sm4NoUpdateDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int cipherTextLen) Sm4NoUpdateDecrypt() argument [all...] |
H A D | crypto_sm4_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 75 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 81 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 97 uint8_t cipherText[128] = {0}; in HWTEST_F() local 123 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 128 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 144 uint8_t cipherText[128] = {0}; in HWTEST_F() local 168 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 174 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 190 uint8_t cipherText[12 in HWTEST_F() local 239 uint8_t cipherText[128] = {0}; HWTEST_F() local 285 uint8_t cipherText[128] = {0}; HWTEST_F() local 333 uint8_t cipherText[128] = {0}; HWTEST_F() local 381 uint8_t cipherText[128] = {0}; HWTEST_F() local 428 uint8_t cipherText[128] = {0}; HWTEST_F() local 475 uint8_t cipherText[128] = {0}; HWTEST_F() local 523 uint8_t cipherText[128] = {0}; HWTEST_F() local 570 uint8_t cipherText[128] = {0}; HWTEST_F() local 618 uint8_t cipherText[128] = {0}; HWTEST_F() local 667 uint8_t cipherText[128] = {0}; HWTEST_F() local 715 uint8_t cipherText[128] = {0}; HWTEST_F() local 806 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 847 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 884 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1209 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1247 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1285 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_3des_cipher_test.cpp | 74 uint8_t *cipherText, int *cipherTextLen) in DesEncrypt() 93 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in DesEncrypt() 106 if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK) { in DesEncrypt() 117 uint8_t *cipherText, int cipherTextLen) in DesDecrypt() 120 HcfBlob input = {.data = (uint8_t *)cipherText, .len = cipherTextLen}; in DesDecrypt() 136 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in DesDecrypt() 149 if (memcpy_s(cipherText + cipherTextLen, maxLen - cipherTextLen, output.data, output.len) != EOK) { in DesDecrypt() 160 return memcmp(cipherText, plainText, cipherTextLen); in DesDecrypt() 164 uint8_t *cipherText, int *cipherTextLen) in DesNoUpdateEncrypt() 183 if (memcpy_s(cipherText, maxLe in DesNoUpdateEncrypt() 73 DesEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int *cipherTextLen) DesEncrypt() argument 116 DesDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int cipherTextLen) DesDecrypt() argument 163 DesNoUpdateEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int *cipherTextLen) DesNoUpdateEncrypt() argument 193 DesNoUpdateDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfParamsSpec *params, uint8_t *cipherText, int cipherTextLen) DesNoUpdateDecrypt() argument 230 uint8_t cipherText[128] = {0}; HWTEST_F() local 277 uint8_t cipherText[128] = {0}; HWTEST_F() local 325 uint8_t cipherText[128] = {0}; HWTEST_F() local 373 uint8_t cipherText[128] = {0}; HWTEST_F() local 424 uint8_t cipherText[128] = {0}; HWTEST_F() local 474 uint8_t cipherText[128] = {0}; HWTEST_F() local 524 uint8_t cipherText[128] = {0}; HWTEST_F() local 576 uint8_t cipherText[128] = {0}; HWTEST_F() local 626 uint8_t cipherText[128] = {0}; HWTEST_F() local 678 uint8_t cipherText[128] = {0}; HWTEST_F() local 729 uint8_t cipherText[128] = {0}; HWTEST_F() local 780 uint8_t cipherText[128] = {0}; HWTEST_F() local 831 uint8_t cipherText[128] = {0}; HWTEST_F() local 878 uint8_t cipherText[128] = {0}; HWTEST_F() local 926 uint8_t cipherText[128] = {0}; HWTEST_F() local 974 uint8_t cipherText[128] = {0}; HWTEST_F() local 1025 uint8_t cipherText[128] = {0}; HWTEST_F() local 1076 uint8_t cipherText[128] = {0}; HWTEST_F() local 1127 uint8_t cipherText[128] = {0}; HWTEST_F() local 1179 uint8_t cipherText[128] = {0}; HWTEST_F() local 1230 uint8_t cipherText[128] = {0}; HWTEST_F() local 1282 uint8_t cipherText[128] = {0}; HWTEST_F() local 1333 uint8_t cipherText[128] = {0}; HWTEST_F() local 1384 uint8_t cipherText[128] = {0}; HWTEST_F() local 1435 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1476 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1517 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_sm4_ecb_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 74 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 80 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 96 uint8_t cipherText[128] = {0}; in HWTEST_F() local 121 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 127 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 144 uint8_t cipherText[128] = {0}; in HWTEST_F() local 169 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); in HWTEST_F() 175 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); in HWTEST_F() 191 uint8_t cipherText[12 in HWTEST_F() local 238 uint8_t cipherText[128] = {0}; HWTEST_F() local 286 uint8_t cipherText[128] = {0}; HWTEST_F() local 578 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 615 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 722 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 788 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/symmetric_alg_test/ |
H A D | hks_aes_cipher_test_common.cpp | 30 const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) in HksAesCipherTestEncrypt() 40 ret = TestUpdateLoopFinish(&handleEncrypt, encryptParamSet, inData, cipherText); in HksAesCipherTestEncrypt() 45 EXPECT_NE(HksMemCmp(inData->data, cipherText->data, inData->size), HKS_SUCCESS) << "cipherText equals inData"; in HksAesCipherTestEncrypt() 54 EXPECT_EQ(HksMemCmp(outData.data, cipherText->data, outData.size), HKS_SUCCESS) << "cipherText not equals outData"; in HksAesCipherTestEncrypt() 60 struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText, in HksAesCipherTestEncryptWithoutNonce() 89 ret = TestUpdateLoopFinish(&handleEncrypt, encryptParamSet, inData, cipherText); in HksAesCipherTestEncryptWithoutNonce() 94 EXPECT_NE(HksMemCmp(inData->data, cipherText->data, inData->size), HKS_SUCCESS) << "cipherText equal in HksAesCipherTestEncryptWithoutNonce() 29 HksAesCipherTestEncrypt(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) HksAesCipherTestEncrypt() argument 59 HksAesCipherTestEncryptWithoutNonce(const struct HksBlob *keyAlias, struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText, bool needAccessControl) HksAesCipherTestEncryptWithoutNonce() argument 99 HksAesCipherTestDecrypt(const struct HksBlob *keyAlias, const struct HksParamSet *decryptParamSet, const struct HksBlob *cipherText, struct HksBlob *plainText, const struct HksBlob *inData) HksAesCipherTestDecrypt() argument 176 struct HksBlob cipherText = { AES_COMMON_SIZE, cipher }; HksAesCipherTestCaseOther() local 208 struct HksBlob cipherText = { AES_COMMON_SIZE, cipher }; HksAesCipherTestCaseGcm2() local 266 struct HksBlob cipherText = { AES_COMMON_SIZE, cipher }; HksAesCipherTestCaseGcm3() local 312 HksAesGcmAppendAeadAndNonce(struct HksParamSet *paramSet, struct HksBlob *cipherText) HksAesGcmAppendAeadAndNonce() argument 352 struct HksBlob cipherText = { AES_COMMON_SIZE, cipher }; HksAesCipherTestCaseGcm4() local 397 HksAesEncryptThreeStage(const struct HksBlob *keyAlias, struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) HksAesEncryptThreeStage() argument 405 HksAesDecryptThreeStage(const struct HksBlob *keyAlias, struct HksParamSet *decryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText, struct HksBlob *plainText) HksAesDecryptThreeStage() argument [all...] |
/base/security/crypto_framework/test/unittest/src/aes_cipher/ |
H A D | crypto_aes_ccm_cipher_test.cpp | 51 uint8_t cipherText[128] = {0}; in HWTEST_F() local 76 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); in HWTEST_F() 82 (void)memcpy_s(spec.tag.data, 12, cipherText + cipherTextLen - 12, 12); in HWTEST_F() 86 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); in HWTEST_F() 104 uint8_t cipherText[128] = {0}; in HWTEST_F() local 129 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); in HWTEST_F() 135 (void)memcpy_s(spec.tag.data, 12, cipherText + cipherTextLen - 12, 12); in HWTEST_F() 139 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); in HWTEST_F() 157 uint8_t cipherText[128] = {0}; in HWTEST_F() local 182 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, in HWTEST_F() 210 uint8_t cipherText[128] = {0}; HWTEST_F() local 263 uint8_t cipherText[128] = {0}; HWTEST_F() local 317 uint8_t cipherText[128] = {0}; HWTEST_F() local 370 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 422 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 471 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 506 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 548 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 590 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_aes_gcm_cipher_test.cpp | 51 uint8_t cipherText[128] = {0}; in HWTEST_F() local 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); in HWTEST_F() 83 (void)memcpy_s(spec.tag.data, 16, cipherText + cipherTextLen - 16, 16); in HWTEST_F() 87 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); in HWTEST_F() 105 uint8_t cipherText[128] = {0}; in HWTEST_F() local 131 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); in HWTEST_F() 137 (void)memcpy_s(spec.tag.data, 16, cipherText + cipherTextLen - 16, 16); in HWTEST_F() 141 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); in HWTEST_F() 159 uint8_t cipherText[128] = {0}; in HWTEST_F() local 185 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, in HWTEST_F() 213 uint8_t cipherText[128] = {0}; HWTEST_F() local 267 uint8_t cipherText[128] = {0}; HWTEST_F() local 321 uint8_t cipherText[128] = {0}; HWTEST_F() local 375 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 428 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 507 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 549 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 593 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 636 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 678 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 732 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 786 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 841 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 894 uint8_t cipherText[CIPHER_TEXT_LEN] = {0}; HWTEST_F() local 948 uint8_t cipherText[128] = {0}; HWTEST_F() local 994 uint8_t cipherText[128] = {0}; HWTEST_F() local [all...] |
H A D | crypto_aes_cfb_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 100 uint8_t cipherText[128] = {0}; in HWTEST_F() local 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 151 uint8_t cipherText[128] = {0}; in HWTEST_F() local 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 203 uint8_t cipherText[12 in HWTEST_F() local 254 uint8_t cipherText[128] = {0}; HWTEST_F() local 305 uint8_t cipherText[128] = {0}; HWTEST_F() local 355 uint8_t cipherText[128] = {0}; HWTEST_F() local 405 uint8_t cipherText[128] = {0}; HWTEST_F() local 455 uint8_t cipherText[128] = {0}; HWTEST_F() local 505 uint8_t cipherText[128] = {0}; HWTEST_F() local 555 uint8_t cipherText[128] = {0}; HWTEST_F() local 605 uint8_t cipherText[128] = {0}; HWTEST_F() local 655 uint8_t cipherText[128] = {0}; HWTEST_F() local 706 uint8_t cipherText[128] = {0}; HWTEST_F() local 757 uint8_t cipherText[128] = {0}; HWTEST_F() local 809 uint8_t cipherText[128] = {0}; HWTEST_F() local 860 uint8_t cipherText[128] = {0}; HWTEST_F() local 911 uint8_t cipherText[128] = {0}; HWTEST_F() local 961 uint8_t cipherText[128] = {0}; HWTEST_F() local 1011 uint8_t cipherText[128] = {0}; HWTEST_F() local 1061 uint8_t cipherText[128] = {0}; HWTEST_F() local 1110 uint8_t cipherText[128] = {0}; HWTEST_F() local 1159 uint8_t cipherText[128] = {0}; HWTEST_F() local 1208 uint8_t cipherText[128] = {0}; HWTEST_F() local 1308 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1350 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1392 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1435 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1477 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1519 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1561 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1603 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 1727 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_aes_ctr_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 100 uint8_t cipherText[128] = {0}; in HWTEST_F() local 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 151 uint8_t cipherText[128] = {0}; in HWTEST_F() local 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 202 uint8_t cipherText[12 in HWTEST_F() local 253 uint8_t cipherText[128] = {0}; HWTEST_F() local 304 uint8_t cipherText[128] = {0}; HWTEST_F() local 406 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 448 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_aes_cbc_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 100 uint8_t cipherText[128] = {0}; in HWTEST_F() local 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 151 uint8_t cipherText[128] = {0}; in HWTEST_F() local 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 202 uint8_t cipherText[12 in HWTEST_F() local 253 uint8_t cipherText[128] = {0}; HWTEST_F() local 304 uint8_t cipherText[128] = {0}; HWTEST_F() local 407 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 449 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
H A D | crypto_aes_ofb_cipher_test.cpp | 49 uint8_t cipherText[128] = {0}; in HWTEST_F() local 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 100 uint8_t cipherText[128] = {0}; in HWTEST_F() local 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 151 uint8_t cipherText[128] = {0}; in HWTEST_F() local 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); in HWTEST_F() 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); in HWTEST_F() 201 uint8_t cipherText[12 in HWTEST_F() local 252 uint8_t cipherText[128] = {0}; HWTEST_F() local 303 uint8_t cipherText[128] = {0}; HWTEST_F() local 404 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local 446 uint8_t cipherText[CIPHER_TEXT_LEN] = { 0 }; HWTEST_F() local [all...] |
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/asymmetric_alg_test/ |
H A D | hks_rsa_cipher_test_common.cpp | 22 const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) in HksRsaCipherTestEncryptAbnormal() 32 ret = TestUpdateFinish(&handleEncrypt, encryptParamSet, HKS_KEY_PURPOSE_ENCRYPT, inData, cipherText); in HksRsaCipherTestEncryptAbnormal() 39 EXPECT_NE(HksMemCmp(inData->data, cipherText->data, inData->size), HKS_SUCCESS) << "cipherText equals inData"; in HksRsaCipherTestEncryptAbnormal() 48 EXPECT_EQ(HksMemCmp(outData.data, cipherText->data, outData.size), HKS_SUCCESS) << "cipherText not equals outData"; in HksRsaCipherTestEncryptAbnormal() 54 const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) in HksRsaCipherTestEncrypt() 64 ret = TestUpdateFinish(&handleEncrypt, encryptParamSet, HKS_KEY_PURPOSE_ENCRYPT, inData, cipherText); in HksRsaCipherTestEncrypt() 69 EXPECT_NE(HksMemCmp(inData->data, cipherText->data, inData->size), HKS_SUCCESS) << "cipherText equal in HksRsaCipherTestEncrypt() 21 HksRsaCipherTestEncryptAbnormal(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) HksRsaCipherTestEncryptAbnormal() argument 53 HksRsaCipherTestEncrypt(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) HksRsaCipherTestEncrypt() argument 82 HksRsaCipherTestDecrypt(const struct HksBlob *keyAlias, const struct HksParamSet *decryptParamSet, const struct HksBlob *cipherText, struct HksBlob *plainText, const struct HksBlob *inData) HksRsaCipherTestDecrypt() argument 132 struct HksBlob cipherText = { Unittest::RsaCipher::RSA_COMMON_SIZE, cipher }; HksRsaCipherTestCase() local 168 struct HksBlob cipherText = { Unittest::RsaCipher::RSA_COMMON_SIZE, cipher }; HksRsaCipherTestCaseAbnormal() local [all...] |
H A D | hks_sm2_cipher_test.cpp | 360 const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) in HksSm2CipherTestEncrypt() 370 ret = TestUpdateFinish(&handleEncrypt, encryptParamSet, HKS_KEY_PURPOSE_ENCRYPT, inData, cipherText); in HksSm2CipherTestEncrypt() 374 EXPECT_NE(HksMemCmp(inData->data, cipherText->data, inData->size), HKS_SUCCESS) << "cipherText equals inData"; in HksSm2CipherTestEncrypt() 388 const struct HksBlob *cipherText, struct HksBlob *plainText, const struct HksBlob *inData) in HksSm2CipherTestDecrypt() 397 ret = TestUpdateFinish(&handleDecrypt, decryptParamSet, HKS_KEY_PURPOSE_DECRYPT, cipherText, plainText); in HksSm2CipherTestDecrypt() 405 ret = HksDecryptForDe(keyAlias, decryptParamSet, cipherText, &outData); in HksSm2CipherTestDecrypt() 425 const struct HksBlob *inData, struct HksBlob *cipherText) in HksSm2CipherTestRun() 457 ret = HksSm2CipherTestEncrypt(&newKeyAlias, encryptParamSet, inData, cipherText); in HksSm2CipherTestRun() 468 ret = HksSm2CipherTestDecrypt(keyAlias, decryptParamSet, cipherText, in HksSm2CipherTestRun() 359 HksSm2CipherTestEncrypt(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) HksSm2CipherTestEncrypt() argument 387 HksSm2CipherTestDecrypt(const struct HksBlob *keyAlias, const struct HksParamSet *decryptParamSet, const struct HksBlob *cipherText, struct HksBlob *plainText, const struct HksBlob *inData) HksSm2CipherTestDecrypt() argument 424 HksSm2CipherTestRun(const struct HksBlob *keyAlias, const GenEncryptDecryptParam ¶m, const struct HksBlob *inData, struct HksBlob *cipherText) HksSm2CipherTestRun() argument 491 struct HksBlob cipherText = { SM2_COMMON_SIZE, cipher }; HWTEST_F() local 515 struct HksBlob cipherText; HWTEST_F() local 557 struct HksBlob cipherText = { SM2_COMMON_SIZE, cipher }; HWTEST_F() local 577 struct HksBlob cipherText = { SM2_COMMON_SIZE, cipher }; HWTEST_F() local 585 HksSm2CipherTestEncryptByNdk(const struct OH_Huks_Blob *keyAlias, const struct HksParamSet *encryptParamSet, const struct OH_Huks_Blob *inData, struct OH_Huks_Blob *cipherText) HksSm2CipherTestEncryptByNdk() argument 605 HksSm2CipherTestDecryptByNdk(const struct OH_Huks_Blob *keyAlias, const struct OH_Huks_ParamSet *decryptParamSet, const struct OH_Huks_Blob *cipherText, struct OH_Huks_Blob *plainText, const struct OH_Huks_Blob *inData) HksSm2CipherTestDecryptByNdk() argument 660 struct OH_Huks_Blob cipherText = { SM2_COMMON_SIZE, cipher }; HksSm2CipherTestRunByNdk() local [all...] |
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
H A D | hks_sm4_cipher_test_common.cpp | 25 const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) in HksSm4CipherTestEncrypt() 35 ret = TestUpdateLoopFinish(&handleEncrypt, encryptParamSet, inData, cipherText); in HksSm4CipherTestEncrypt() 40 EXPECT_NE(HksMemCmp(inData->data, cipherText->data, inData->size), HKS_SUCCESS) << "cipherText equals inData"; in HksSm4CipherTestEncrypt() 46 const struct HksParamSet *decryptParamSet, const struct HksBlob *cipherText, struct HksBlob *plainText, in HksSm4CipherTestDecrypt() 57 ret = TestUpdateLoopFinish(&handleDecrypt, decryptParamSet, cipherText, plainText); in HksSm4CipherTestDecrypt() 91 struct HksBlob cipherText = { SM4_COMMON_SIZE, cipher }; in HksSm4CipherTestCaseOther() local 92 ret = HksSm4CipherTestEncrypt(keyAlias, encryptParamSet, &inData, &cipherText); in HksSm4CipherTestCaseOther() 98 ret = HksSm4CipherTestDecrypt(keyAlias, decryptParamSet, &cipherText, &plainText, &inData); in HksSm4CipherTestCaseOther() 131 struct HksBlob cipherText in HksSm4CipherTestCaseGcm() local 24 HksSm4CipherTestEncrypt(const struct HksBlob *keyAlias, const struct HksParamSet *encryptParamSet, const struct HksBlob *inData, struct HksBlob *cipherText) HksSm4CipherTestEncrypt() argument 45 HksSm4CipherTestDecrypt(const struct HksBlob *keyAlias, const struct HksParamSet *decryptParamSet, const struct HksBlob *cipherText, struct HksBlob *plainText, const struct HksBlob *inData) HksSm4CipherTestDecrypt() argument [all...] |
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/include/ |
H A D | hks_mbedtls_aes.h | 38 const struct HksBlob *message, struct HksBlob *cipherText, struct HksBlob *tagAead);
41 const struct HksBlob *message, struct HksBlob *cipherText);
46 int32_t HksMbedtlsAesCryptoUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText,
49 int32_t HksMbedtlsAesCryptoFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText,
|
/base/notification/distributed_notification_service/services/ans/include/ |
H A D | aes_gcm_helper.h | 27 static ErrCode Encrypt(const std::string &plainText, std::string &cipherText); 28 static ErrCode Decrypt(std::string &plainText, const std::string &cipherText); 31 static bool EncryptAesGcm(const std::string &plainText, std::string &cipherText, std::string &key); 32 static bool DecryptAesGcm(std::string &plainText, const std::string &cipherText, std::string &key);
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/include/ |
H A D | hks_openssl_sm4.h | 35 int32_t HksOpensslSm4EncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText);
37 int32_t HksOpensslSm4EncryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText,
44 int32_t HksOpensslSm4DecryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText,
49 const struct HksBlob *message, struct HksBlob *cipherText);
|
/base/security/crypto_framework/test/unittest/src/native/ |
H A D | native_sym_cipher_test.cpp | 53 uint8_t *cipherText, int *cipherTextLen) in AesEncrypt() 72 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in AesEncrypt() 85 if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK) { in AesEncrypt() 97 uint8_t *cipherText, int cipherTextLen) in AesDecrypt() 100 Crypto_DataBlob input = {.data = reinterpret_cast<uint8_t *>(cipherText), .len = cipherTextLen}; in AesDecrypt() 116 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in AesDecrypt() 129 if (memcpy_s(cipherText + cipherTextLen, maxLen - cipherTextLen, output.data, output.len) != EOK) { in AesDecrypt() 140 if (memcmp(cipherText, plainText, cipherTextLen) != 0) { in AesDecrypt() 151 uint8_t cipherText[128] = {0}; in HWTEST_F() local 178 ret = AesEncrypt(cipher, symKey, params, cipherText, in HWTEST_F() 52 AesEncrypt(OH_CryptoSymCipher *cipher, OH_CryptoSymKey *key, OH_CryptoSymCipherParams *params, uint8_t *cipherText, int *cipherTextLen) AesEncrypt() argument 96 AesDecrypt(OH_CryptoSymCipher *cipher, OH_CryptoSymKey *key, OH_CryptoSymCipherParams *params, uint8_t *cipherText, int cipherTextLen) AesDecrypt() argument [all...] |
/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfciphercreate_fuzzer/ |
H A D | hcfciphercreate_fuzzer.cpp | 33 uint8_t *cipherText, int *cipherTextLen) in AesEncrypt() 48 (void)memcpy_s(cipherText, maxLen, output.data, output.len); in AesEncrypt() 59 (void)memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len); in AesEncrypt() 70 uint8_t *cipherText, int cipherTextLen) in AesDecrypt() 87 (void)memcpy_s(cipherText, maxLen, output.data, output.len); in AesDecrypt() 100 (void)memcpy_s(cipherText + cipherTextLen, maxLen - cipherTextLen, output.data, output.len); in AesDecrypt() 108 ret = memcmp(cipherText, input->data, cipherTextLen); in AesDecrypt() 114 uint8_t *cipherText, int *cipherTextLen) in Sm4Encrypt() 129 if (memcpy_s(cipherText, maxLen, output.data, output.len) != EOK) { in Sm4Encrypt() 141 if (memcpy_s(cipherText in Sm4Encrypt() 32 AesEncrypt(HcfCipher *cipher, HcfSymKey *key, HcfBlob *input, uint8_t *cipherText, int *cipherTextLen) AesEncrypt() argument 69 AesDecrypt(HcfCipher *cipher, HcfSymKey *key, HcfBlob *input, uint8_t *cipherText, int cipherTextLen) AesDecrypt() argument 113 Sm4Encrypt(HcfCipher *cipher, HcfSymKey *key, HcfBlob *input, uint8_t *cipherText, int *cipherTextLen) Sm4Encrypt() argument 151 Sm4Decrypt(HcfCipher *cipher, HcfSymKey *key, HcfBlob *input, uint8_t *cipherText, int cipherTextLen) Sm4Decrypt() argument 200 uint8_t cipherText[128] = {0}; TestAesCipher() local 232 uint8_t cipherText[128] = {0}; TestSm4Cipher() local 267 uint8_t cipherText[128] = {0}; TestSm4GcmCipher() local [all...] |