/base/security/huks/frameworks/crypto_lite/cipher/src/ |
D | cipher_aes.c | 117 …if ((ivBufLen < (ctx->iv.ivOffset + ctx->iv.ivLen)) || (ctx->iv.ivOffset < 0) || (ctx->iv.ivLen <=… in SetIv() 121 ctx->iv.ivBuf = malloc(ctx->iv.ivLen); in SetIv() 122 if (ctx->iv.ivBuf == NULL) { in SetIv() 127 int32_t ret = memcpy_s(ctx->iv.ivBuf, ctx->iv.ivLen, ivBuf + ctx->iv.ivOffset, ctx->iv.ivLen); in SetIv() 130 free(ctx->iv.ivBuf); in SetIv() 131 ctx->iv.ivBuf = NULL; in SetIv() 138 static int32_t InitAesCryptContext(const char *key, const AesIvMode *iv, AesCryptContext *ctx) in InitAesCryptContext() argument 142 if (iv == NULL || ctx == NULL || key == NULL) { in InitAesCryptContext() 146 if ((iv->transformation != NULL) && (strcmp(iv->transformation, "AES/CBC/PKCS5Padding"))) { in InitAesCryptContext() 151 ctx->iv.ivOffset = iv->ivOffset; in InitAesCryptContext() [all …]
|
/base/startup/hvb/libhvb/src/crypto/ |
D | hvb_hash_sha256.c | 160 int sha256_data_blk_update(uint32_t *iv, const void *msg, uint64_t len); 162 __attribute__((weak)) int sha256_data_blk_update(uint32_t *iv, const void *msg, uint64_t len) in sha256_data_blk_update() argument 171 regs[j] = iv[j]; in sha256_data_blk_update() 177 iv[j] += regs[j]; in sha256_data_blk_update() 183 static void hash_sha256_pad_update(uint32_t *iv, const void *left_msg, uint64_t left_len, uint64_t … in hash_sha256_pad_update() argument 211 sha256_data_blk_update(iv, sha256_pad, word2byte(pad_word_len)); in hash_sha256_pad_update() 214 static int hash_sha256_output_iv(uint32_t *iv, uint8_t *out, uint32_t out_len) in hash_sha256_output_iv() argument 221 iv[i] = htobe32(iv[i]); in hash_sha256_output_iv() 224 hvb_memcpy(out, iv, IV_BYTE_SIZE_SHA256); in hash_sha256_output_iv() 233 uint32_t iv[IV_WORD_SIZE_SHA256]; in hash_sha256_single() local [all …]
|
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/ |
D | cipher_aes_common.c | 29 uint8_t *iv = spec->iv.data; in GetIv() local 30 return (const unsigned char *)iv; in GetIv() 66 if ((*data)->iv != NULL) { in FreeCipherData() 67 HcfFree((*data)->iv); in FreeCipherData() 68 (*data)->iv = NULL; in FreeCipherData()
|
/base/security/crypto_framework/test/unittest/src/ |
D | crypto_aes_cipher_test.cpp | 704 uint8_t iv[16] = {0}; variable 712 ivSpec.iv.data = iv; 713 ivSpec.iv.len = 16; 755 uint8_t iv[16] = {0}; variable 763 ivSpec.iv.data = iv; 764 ivSpec.iv.len = 16; 806 uint8_t iv[16] = {0}; variable 814 ivSpec.iv.data = iv; 815 ivSpec.iv.len = 16; 857 uint8_t iv[16] = {0}; variable [all …]
|
D | crypto_3des_cipher_test.cpp | 379 uint8_t iv[8] = {0}; variable 381 ivSpec.iv.data = iv; 382 ivSpec.iv.len = 8; 430 uint8_t iv[8] = {0}; variable 432 ivSpec.iv.data = iv; 433 ivSpec.iv.len = 8; 480 uint8_t iv[8] = {0}; variable 482 ivSpec.iv.data = iv; 483 ivSpec.iv.len = 8; 530 uint8_t iv[8] = {0}; variable [all …]
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/ |
D | openssl_aes_helper.c | 134 struct HksParam *iv = NULL; in AesEncrypt() local 135 HksGetParam(paramSetIn, HKS_TAG_IV, &iv); in AesEncrypt() 148 if (EVP_EncryptInit_ex(ctx, NULL, NULL, randomKey->data, iv->blob.data) != 1) { in AesEncrypt() 188 struct HksParam *iv = NULL; in AesDecrypt() local 189 HksGetParam(paramSetIn, HKS_TAG_IV, &iv); in AesDecrypt() 202 if (EVP_DecryptInit_ex(ctx, NULL, NULL, randomKey->data, iv->blob.data) != 1) { in AesDecrypt() 240 struct HksParam *iv = NULL; in AesGcmEncrypt() local 241 HksGetParam(paramSetIn, HKS_TAG_NONCE, &iv); in AesGcmEncrypt() 256 if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv->blob.size, NULL) != 1) { in AesGcmEncrypt() 261 if (EVP_EncryptInit_ex(ctx, NULL, NULL, randomKey->data, iv->blob.data) != 1) { in AesGcmEncrypt() [all …]
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/include/ |
D | hks_chipset_platform_test.h | 30 std::vector<uint8_t> iv {}; 58 { .tag = HKS_TAG_IV, .blob = { .size = t.iv.size(), .data = t.iv.data() } }, in CipherMaterialsToDecryptInputParams()
|
/base/security/huks/frameworks/crypto_lite/cipher/include/ |
D | cipher.h | 61 AesIvMode iv; member 77 const AesIvMode *iv, AesCryptContext *aesCryptCxt);
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/src/ |
D | dlp_file.cpp | 61 cipher_.tagIv.iv.data = nullptr; in DlpFile() 62 cipher_.tagIv.iv.size = 0; in DlpFile() 78 if (cipher_.tagIv.iv.data != nullptr) { in ~DlpFile() 79 (void)memset_s(cipher_.tagIv.iv.data, cipher_.tagIv.iv.size, 0, cipher_.tagIv.iv.size); in ~DlpFile() 80 delete[] cipher_.tagIv.iv.data; in ~DlpFile() 81 cipher_.tagIv.iv.data = nullptr; in ~DlpFile() 115 struct DlpBlob& iv = spec.algParam->iv; in IsValidCipher() local 116 if (iv.size != IV_SIZE || iv.data == nullptr) { in IsValidCipher() 249 int32_t res = CopyBlobParam(spec.algParam->iv, cipher_.tagIv.iv); in SetCipher() 259 CleanBlobParam(cipher_.tagIv.iv); in SetCipher() [all …]
|
D | dlp_file_manager.cpp | 130 res = DlpOpensslGenerateRandomKey(IV_SIZE * BIT_NUM_OF_UINT8, &tagIv->iv); in PrepareDlpEncryptParms() 143 policy.SetIv(tagIv->iv.data, tagIv->iv.size); in PrepareDlpEncryptParms() 151 delete[] tagIv->iv.data; in PrepareDlpEncryptParms() 152 tagIv->iv.data = nullptr; in PrepareDlpEncryptParms() 196 .iv = {.size = policy.GetIvLen(), .data = policy.GetIv()}, in ParseDlpFileFormat() 232 if (usage.algParam->iv.data != nullptr) { in FreeChiperBlob() 233 delete[] usage.algParam->iv.data; in FreeChiperBlob() 234 usage.algParam->iv.data = nullptr; in FreeChiperBlob()
|
D | dlp_crypt.cpp | 147 … *ctx, nullptr, nullptr, key->data, (cipherParam == nullptr) ? nullptr : cipherParam->iv.data); in OpensslAesCipherInit() 150 … *ctx, nullptr, nullptr, key->data, (cipherParam == nullptr) ? nullptr : cipherParam->iv.data); in OpensslAesCipherInit() 197 … ctx, nullptr, nullptr, key->data, (cipherParam == nullptr) ? nullptr : cipherParam->iv.data); in OpensslAesCipherCryptInitParams() 200 … ctx, nullptr, nullptr, key->data, (cipherParam == nullptr) ? nullptr : cipherParam->iv.data); in OpensslAesCipherCryptInitParams() 912 static void IncIvCounterLitteEndian(struct DlpBlob& iv, uint32_t count) in IncIvCounterLitteEndian() argument 914 uint8_t* data = iv.data; in IncIvCounterLitteEndian() 915 int size = static_cast<int>(iv.size - 1); in IncIvCounterLitteEndian() 926 int32_t DlpCtrModeIncreaeIvCounter(struct DlpBlob& iv, uint32_t count) in DlpCtrModeIncreaeIvCounter() argument 928 if (iv.data == nullptr || iv.size == 0) { in DlpCtrModeIncreaeIvCounter() 933 IncIvCounterLitteEndian(iv, count); in DlpCtrModeIncreaeIvCounter()
|
/base/security/huks/frameworks/crypto_lite/js/builtin/src/ |
D | cipher_module.cpp | 119 AesIvMode iv = {NULL, NULL, 0, 0}; in Aes() local 130 iv.ivBuf = strIv; in Aes() 131 iv.ivLen = ivLen; in Aes() 132 iv.ivOffset = ivOffset; in Aes() 133 iv.transformation = strTransformation; in Aes() 134 ret = InitAesCryptData(strAction, strText, strKey, &iv, &aes); in Aes()
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
D | hks_chipset_platform_decrypt_test.cpp | 54 .iv = { 84 .iv = { 114 .iv = { 144 .iv = { 176 .iv = { 268 .iv = { 298 .iv = { 328 .iv = { 358 .iv = { 390 .iv = { [all …]
|
/base/security/dlp_permission_service/frameworks/test/mock/ |
D | openssl_mock.cpp | 36 const unsigned char *key, const unsigned char *iv); 38 const unsigned char *key, const unsigned char *iv); 163 const unsigned char *key, const unsigned char *iv) in EVP_EncryptInit_ex() argument 173 return (*func)(ctx, cipher, impl, key, iv); in EVP_EncryptInit_ex() 177 const unsigned char *key, const unsigned char *iv) in EVP_DecryptInit_ex() argument 187 return (*func)(ctx, cipher, impl, key, iv); in EVP_DecryptInit_ex()
|
/base/security/crypto_framework/interfaces/innerkits/algorithm_parameter/ |
D | detailed_iv_params.h | 26 HcfBlob iv; member
|
D | detailed_gcm_params.h | 27 HcfBlob iv; member
|
D | detailed_ccm_params.h | 27 HcfBlob iv; member
|
/base/security/dlp_permission_service/frameworks/dlp_permission/src/ |
D | dlp_policy_parcel.cpp | 105 const uint8_t* iv = in.ReadUnpadBuffer(len); in ReadAesParam() local 106 if (iv == nullptr) { in ReadAesParam() 110 policy.SetIv(iv, len); in ReadAesParam()
|
/base/security/crypto_framework/frameworks/js/napi/crypto/src/ |
D | napi_utils.cpp | 308 HcfBlob *iv = GetBlobFromParamsSpec(env, arg, IV_PARAMS); in GetIvParamsSpec() local 309 if (iv == nullptr) { in GetIvParamsSpec() 315 ivParamsSpec->iv = *iv; in GetIvParamsSpec() 317 HcfFree(iv); in GetIvParamsSpec() 321 static bool GetIvAndAadBlob(napi_env env, napi_value arg, HcfBlob **iv, HcfBlob **aad) in GetIvAndAadBlob() argument 323 *iv = GetBlobFromParamsSpec(env, arg, IV_PARAMS); in GetIvAndAadBlob() 324 if (*iv == nullptr) { in GetIvAndAadBlob() 332 HcfFree((*iv)->data); in GetIvAndAadBlob() 333 HcfFree(*iv); in GetIvAndAadBlob() 341 HcfBlob *iv = nullptr; in GetGcmParamsSpec() local [all …]
|
D | napi_cipher.cpp | 60 HcfIvParamsSpec *iv = reinterpret_cast<HcfIvParamsSpec *>(paramsSpec); in FreeParamsSpec() local 61 HcfFree(iv->iv.data); in FreeParamsSpec() 62 iv->iv.data = nullptr; in FreeParamsSpec() 63 iv->iv.len = 0; in FreeParamsSpec() 67 HcfFree(gcm->iv.data); in FreeParamsSpec() 70 gcm->iv.len = 0; in FreeParamsSpec() 73 gcm->iv.data = nullptr; in FreeParamsSpec() 79 HcfFree(ccm->iv.data); in FreeParamsSpec() 82 ccm->iv.len = 0; in FreeParamsSpec() 85 ccm->iv.data = nullptr; in FreeParamsSpec()
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/test/ |
D | dlp_file_test.cpp | 49 param.iv.data = ivData; in initDlpFileCiper() 50 param.iv.size = IV_SIZE; in initDlpFileCiper() 110 spec.algParam->iv.size = 1; 111 spec.algParam->iv.data = ivData; 117 spec.algParam->iv.size = 16; 118 spec.algParam->iv.data = nullptr; 124 spec.algParam->iv.size = 16; 125 spec.algParam->iv.data = ivData; 393 spec.algParam->iv.size = 16; 394 spec.algParam->iv.data = ivData; [all …]
|
/base/security/crypto_framework/plugin/openssl_plugin/common/inc/ |
D | aes_openssl_common.h | 32 unsigned char *iv; member
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/include/ |
D | dlp_crypt.h | 68 struct DlpBlob iv; member 131 int32_t DlpCtrModeIncreaeIvCounter(struct DlpBlob& iv, uint32_t count);
|
/base/update/updater/test/unittest/script/ |
D | script_interpreter_unittest.cpp | 57 std::unique_ptr<IntegerValue> iv = std::make_unique<IntegerValue>(intValue); in TestScriptInterpreterScriptValue() local 58 if (iv == nullptr) { in TestScriptInterpreterScriptValue() 61 iv->IsTrue(); in TestScriptInterpreterScriptValue() 62 iv.reset(); in TestScriptInterpreterScriptValue()
|
/base/security/huks/services/huks_standard/huks_engine/main/core/src/ |
D | hks_chipset_platform_decrypt.c | 157 struct HksBlob iv = ivParam->blob; in DoAesDecrypt() local 164 if (iv.size != PLATFORM_KEY_IV_SIZE) { in DoAesDecrypt() 165 HKS_LOG_E("invalid iv size %" LOG_PUBLIC "d", iv.size); in DoAesDecrypt() 174 .nonce = iv, in DoAesDecrypt()
|