/ohos5.0/base/security/crypto_framework/test/unittest/src/aes_cipher/ |
H A D | crypto_aes_cfb_cipher_test.cpp | 56 ivSpec.iv.data = iv; 107 ivSpec.iv.data = iv; 158 ivSpec.iv.data = iv; 210 ivSpec.iv.data = iv; 261 ivSpec.iv.data = iv; 312 ivSpec.iv.data = iv; 362 ivSpec.iv.data = iv; 412 ivSpec.iv.data = iv; 462 ivSpec.iv.data = iv; 512 ivSpec.iv.data = iv; [all …]
|
H A D | crypto_aes_gcm_cipher_test.cpp | 62 spec.iv.data = iv; 63 spec.iv.len = sizeof(iv); 116 spec.iv.data = iv; 170 spec.iv.data = iv; 224 spec.iv.data = iv; 278 spec.iv.data = iv; 332 spec.iv.data = iv; 386 spec.iv.data = iv; 439 spec.iv.data = iv; 560 spec.iv.data = iv; [all …]
|
H A D | crypto_aes_ccm_cipher_test.cpp | 61 spec.iv.data = iv; 62 spec.iv.len = sizeof(iv); 114 spec.iv.data = iv; 167 spec.iv.data = iv; 220 spec.iv.data = iv; 273 spec.iv.data = iv; 327 spec.iv.data = iv; 380 spec.iv.data = iv; 432 spec.iv.data = iv; 516 spec.iv.data = iv; [all …]
|
H A D | crypto_aes_cbc_cipher_test.cpp | 56 ivSpec.iv.data = iv; 57 ivSpec.iv.len = 16; 107 ivSpec.iv.data = iv; 108 ivSpec.iv.len = 16; 158 ivSpec.iv.data = iv; 209 ivSpec.iv.data = iv; 260 ivSpec.iv.data = iv; 311 ivSpec.iv.data = iv; 356 ivSpec.iv.data = iv; 413 ivSpec.iv.data = iv; [all …]
|
H A D | crypto_aes_ctr_cipher_test.cpp | 56 ivSpec.iv.data = iv; 57 ivSpec.iv.len = 16; 107 ivSpec.iv.data = iv; 108 ivSpec.iv.len = 16; 158 ivSpec.iv.data = iv; 209 ivSpec.iv.data = iv; 260 ivSpec.iv.data = iv; 311 ivSpec.iv.data = iv; 359 ivSpec.iv.data = iv; 412 ivSpec.iv.data = iv; [all …]
|
H A D | crypto_aes_ofb_cipher_test.cpp | 56 ivSpec.iv.data = iv; 57 ivSpec.iv.len = 16; 107 ivSpec.iv.data = iv; 108 ivSpec.iv.len = 16; 158 ivSpec.iv.data = iv; 208 ivSpec.iv.data = iv; 259 ivSpec.iv.data = iv; 310 ivSpec.iv.data = iv; 357 ivSpec.iv.data = iv; 410 ivSpec.iv.data = iv; [all …]
|
/ohos5.0/base/security/crypto_framework/test/unittest/src/ |
H A D | crypto_sm4_gcm_cipher_test.cpp | 64 spec.iv.data = iv; 118 spec.iv.data = iv; 172 spec.iv.data = iv; 226 spec.iv.data = iv; 280 spec.iv.data = iv; 334 spec.iv.data = iv; 456 spec.iv.data = iv; 543 spec.iv.data = iv; 585 spec.iv.data = iv; 639 spec.iv.data = iv; [all …]
|
H A D | crypto_3des_cipher_test.cpp | 381 ivSpec.iv.data = iv; 432 ivSpec.iv.data = iv; 482 ivSpec.iv.data = iv; 532 ivSpec.iv.data = iv; 584 ivSpec.iv.data = iv; 634 ivSpec.iv.data = iv; 686 ivSpec.iv.data = iv; 737 ivSpec.iv.data = iv; 788 ivSpec.iv.data = iv; 982 ivSpec.iv.data = iv; [all …]
|
/ohos5.0/base/security/huks/frameworks/crypto_lite/cipher/src/ |
H A 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() 146 if ((iv->transformation != NULL) && (strcmp(iv->transformation, "AES/CBC/PKCS5Padding"))) { in InitAesCryptContext() 151 ctx->iv.ivOffset = iv->ivOffset; in InitAesCryptContext() 153 if ((iv->ivLen < 0) || (iv->ivLen != AES_BLOCK_SIZE)) { in InitAesCryptContext() 158 ctx->iv.ivLen = AES_BLOCK_SIZE; in InitAesCryptContext() [all …]
|
/ohos5.0/base/startup/hvb/libhvb/src/crypto/ |
H A D | hvb_hash_sha256.c | 171 regs[j] = iv[j]; in sha256_data_blk_update() 177 iv[j] += regs[j]; in sha256_data_blk_update() 211 sha256_data_blk_update(iv, sha256_pad, word2byte(pad_word_len)); in hash_sha256_pad_update() 224 iv[i] = htobe32(iv[i]); in hash_sha256_output_iv() 227 hvb_memcpy(out, iv, IV_BYTE_SIZE_SHA256); in hash_sha256_output_iv() 236 uint32_t iv[IV_WORD_SIZE_SHA256]; in hash_sha256_single() local 251 hvb_memcpy(iv, sha256_iv_init, sizeof(sha256_iv_init)); in hash_sha256_single() 256 sha256_data_blk_update(iv, msg, data_size); in hash_sha256_single() 261 return hash_sha256_output_iv(iv, out, out_len); in hash_sha256_single() 334 sha256_data_blk_update(hash_ctx->iv, msg, calc_len); in hash_calc_update() [all …]
|
/ohos5.0/drivers/peripheral/user_auth/hdi_service/common/src/ |
H A D | user_sign_centre.c | 78 DestoryBuffer(aesGcmParam->iv); in DeinitAesGcmParam() 88 .iv = CreateBufferByData(userAuthToken->iv, sizeof(userAuthToken->iv)), in DecryptTokenCipher() 93 …if (!IsBufferValid(aesGcmParam.key) || !IsBufferValid(aesGcmParam.iv) || !IsBufferValid(aesGcmPara… in DecryptTokenCipher() 181 aesGcmParam->iv = CreateBufferBySize(AES_GCM_IV_SIZE); in InitAesGcmParam() 183 …if (!IsBufferValid(aesGcmParam->key) || !IsBufferValid(aesGcmParam->iv) || !IsBufferValid(aesGcmPa… in InitAesGcmParam() 187 ret = SecureRandom(aesGcmParam->iv->buf, aesGcmParam->iv->maxSize); in InitAesGcmParam() 192 aesGcmParam->iv->contentSize = aesGcmParam->iv->maxSize; in InitAesGcmParam() 199 …ATIC ResultCode CopyTokenCipherParam(const Buffer *ciphertext, const Buffer *tag, const Buffer *iv, in CopyTokenCipherParam() argument 219 if (!CheckBufferWithSize(iv, sizeof(authToken->iv))) { in CopyTokenCipherParam() 223 if (memcpy_s(authToken->iv, sizeof(authToken->iv), iv->buf, iv->contentSize) != EOK) { in CopyTokenCipherParam() [all …]
|
/ohos5.0/foundation/ai/ai_engine/test/common/queuepool/ |
H A D | queuepool_test.cpp | 219 queue->PushBack(iv); 278 queue->PushBack(iv); 298 int result = queue->PushBack(iv); 324 result = queue->PushBack(iv); 343 int iv; variable 364 queue->PushBack(iv); 391 int iv = 0; variable 395 ASSERT_EQ(iv, i); 464 int iv; variable 468 queue->PopFront(iv); [all …]
|
/ohos5.0/docs/zh-cn/application-dev/reference/apis-avcodec-kit/ |
H A D | _multimedia___drm.md | 48 …drmcencinfomode) [DrmCencInfoMode](#drmcencinfomode) | 枚举类型,表示cencInfo中keyId/iv/subsample信息是否设置。 | 67 …cencInfo, uint8_t \*keyId, uint32_t keyIdLen, uint8_t \*iv, uint32_t ivLen) | 设置cencInfo的keyId和iv。… 139 枚举类型,表示cencInfo中keyId/iv/subsample信息是否设置。 216 枚举类型,表示cencInfo中keyId/iv/subsample信息是否设置。 222 | DRM_CENC_INFO_KEY_IV_SUBSAMPLES_SET | keyId/iv/subsample信息已设置。 | 223 | DRM_CENC_INFO_KEY_IV_SUBSAMPLES_NOT_SET | keyId/iv/subsample信息未设置。 | 344 …AndIv (OH_AVCencInfo * cencInfo, uint8_t * keyId, uint32_t keyIdLen, uint8_t * iv, uint32_t ivLen ) 349 设置cencInfo的keyId和iv。 362 | iv | 初始化向量。 | 371 …encInfo为空,或者keyId为空,或者keyIdLen != DRM_KEY_ID_SIZE,或者iv是空,或者ivLen != DRM_KEY_IV_SIZE,或者keyId拷贝失败,或者… [all …]
|
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/crypto/src/ |
H A D | fbex.cpp | 64 uint8_t iv[OHOS::StorageDaemon::FBEX_IV_SIZE] = {0}; 128 return (iv != nullptr) && (size == FBEX_IV_SIZE); in CheckIvValid() 186 if (!CheckIvValid(iv, size)) { in InstallKeyToKernel() 198 auto err = memcpy_s(ops.iv, sizeof(ops.iv), iv, size); in InstallKeyToKernel() 214 auto errops = memcpy_s(iv, size, ops.iv, sizeof(ops.iv)); in InstallKeyToKernel() 227 if (!CheckIvValid(iv, size)) { in InstallDoubleDeKeyToKernel() 273 if (!CheckIvValid(iv, size)) { in UninstallOrLockUserKeyToKernel() 285 auto err = memcpy_s(ops.iv, sizeof(ops.iv), iv, size); in UninstallOrLockUserKeyToKernel() 443 if (!CheckIvValid(iv, size)) { in UnlockScreenToKernel() 456 auto err = memcpy_s(ops.iv, sizeof(ops.iv), iv, size); in UnlockScreenToKernel() [all …]
|
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/ |
H A D | cipher_aes_common.c | 29 uint8_t *iv = spec->iv.data; in GetIv() local 30 return (const unsigned char *)iv; in GetIv() 39 return spec->iv.len; in GetIvLen() 75 if ((*data)->iv != NULL) { in FreeCipherData() 76 HcfFree((*data)->iv); in FreeCipherData() 77 (*data)->iv = NULL; in FreeCipherData()
|
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/mock/ |
H A D | fbex_mock.cpp | 34 int FBEX::InstallKeyToKernel(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size, uint8_t fl… in InstallKeyToKernel() argument 36 return IFbexMoc::fbexMoc->InstallKeyToKernel(userId, type, iv, size, flag); in InstallKeyToKernel() 39 int FBEX::UninstallOrLockUserKeyToKernel(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size… in UninstallOrLockUserKeyToKernel() argument 41 return IFbexMoc::fbexMoc->UninstallOrLockUserKeyToKernel(userId, type, iv, size, destroy); in UninstallOrLockUserKeyToKernel() 44 int FBEX::InstallDoubleDeKeyToKernel(UserIdToFbeStr &userIdToFbe, uint8_t *iv, uint32_t size, uint8… in InstallDoubleDeKeyToKernel() argument 46 return IFbexMoc::fbexMoc->InstallDoubleDeKeyToKernel(userIdToFbe, iv, size, flag); in InstallDoubleDeKeyToKernel() 77 int FBEX::UnlockScreenToKernel(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size) in UnlockScreenToKernel() argument 79 return IFbexMoc::fbexMoc->UnlockScreenToKernel(userId, type, iv, size); in UnlockScreenToKernel()
|
/ohos5.0/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/ |
H A 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() 261 if (EVP_EncryptInit_ex(ctx, NULL, NULL, randomKey->data, iv->blob.data) != 1) { in AesGcmEncrypt() 295 struct HksParam *iv = NULL; in AesGcmDecrypt() local [all …]
|
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/include/mock/ |
H A D | fbex_mock.h | 30 …virtual int InstallKeyToKernel(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size, uint8_t… 32 …virtual int InstallDoubleDeKeyToKernel(UserIdToFbeStr &userIdToFbe, uint8_t *iv, uint32_t size, ui… 34 … virtual int UnlockScreenToKernel(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size) = 0; 51 …MOCK_METHOD5(InstallKeyToKernel, int(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size, u… 53 …MOCK_METHOD4(InstallDoubleDeKeyToKernel, int(UserIdToFbeStr &, uint8_t *iv, uint32_t size, uint8_t… 55 …MOCK_METHOD4(UnlockScreenToKernel, int(uint32_t userId, uint32_t type, uint8_t *iv, uint32_t size)…
|
/ohos5.0/foundation/filemanagement/storage_service/services/storage_daemon/crypto/test/fbex_test/ |
H A D | fbex_test.cpp | 124 uint8_t *iv = new uint8_t[PARAMS_SIZE_1]; variable 133 delete[] iv; 134 iv = nullptr; 154 uint8_t *iv = new uint8_t[FBEX_IV_SIZE]; variable 159 delete[] iv; 160 iv = nullptr; 326 uint8_t *iv = new uint8_t[FBEX_IV_SIZE]; variable 328 ret = fbex.UnlockScreenToKernel(userId, type, iv, size); 332 ret = fbex.UnlockScreenToKernel(userId, type, iv, size); 335 delete[] iv; [all …]
|
/ohos5.0/docs/zh-cn/device-dev/reference/hdi-apis/drm/ |
H A D | _crypto_info.md | 22 | unsigned char[] [iv](#iv) | 秘钥配套的IV。 | 30 ### iv subsection 33 unsigned char [] CryptoInfo::iv
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/openssl/ |
H A D | softbus_aes_encrypt.c | 138 if (memcpy_s(cipherKey->iv, cipherKey->ivLen, result + AES_SESSION_KEY_LENGTH, in RootKeyGenerateIvAndSessionKey() 160 cipherKey->iv = (uint8_t *)SoftBusCalloc(cipherKey->ivLen); in GenerateIvAndSessionKey() 161 if (cipherKey->iv == NULL) { in GenerateIvAndSessionKey() 168 (void)memset_s(cipherKey->iv, cipherKey->ivLen, 0, cipherKey->ivLen); in GenerateIvAndSessionKey() 170 SoftBusFree(cipherKey->iv); in GenerateIvAndSessionKey() 198 (void)memset_s(cipherKey.iv, cipherKey.ivLen, 0, cipherKey.ivLen); in SoftBusAesCfbRootEncrypt() 200 SoftBusFree(cipherKey.iv); in SoftBusAesCfbRootEncrypt() 206 (void)memset_s(cipherKey.iv, cipherKey.ivLen, 0, cipherKey.ivLen); in SoftBusAesCfbRootEncrypt() 208 SoftBusFree(cipherKey.iv); in SoftBusAesCfbRootEncrypt() 225 if (memcpy_s(random, sizeof(random), cipherKey->iv, sizeof(random)) != EOK) { in SoftBusAesCfbEncrypt() [all …]
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/mbedtls/ |
H A D | softbus_adapter_crypto.c | 98 …ret = mbedtls_gcm_crypt_and_tag(&aesContext, MBEDTLS_GCM_ENCRYPT, plainTextSize, cipherKey->iv, GC… in MbedAesGcmEncrypt() 105 if (memcpy_s(cipherText, cipherTextLen, cipherKey->iv, GCM_IV_LEN) != EOK) { in MbedAesGcmEncrypt() 140 …ret = mbedtls_gcm_auth_decrypt(&aesContext, cipherTextSize - OVERHEAD_LEN, cipherKey->iv, GCM_IV_L… in MbedAesGcmDecrypt() 276 if (SoftBusGenerateRandomArray(cipherKey->iv, sizeof(cipherKey->iv)) != SOFTBUS_OK) { in SoftBusEncryptData() 295 if (SoftBusGenerateRandomArray(cipherKey->iv, sizeof(cipherKey->iv)) != SOFTBUS_OK) { in SoftBusEncryptDataWithSeq() 299 if (memcpy_s(cipherKey->iv, sizeof(int32_t), &seqNum, sizeof(int32_t)) != EOK) { in SoftBusEncryptDataWithSeq() 318 if (memcpy_s(cipherKey->iv, sizeof(cipherKey->iv), input, GCM_IV_LEN) != EOK) { in SoftBusDecryptData() 381 if (mbedtls_cipher_set_iv(&ctx, key->iv, BLE_BROADCAST_IV_LEN) != 0) { in SoftBusEncryptDataByCtr()
|
/ohos5.0/base/notification/distributed_notification_service/services/ans/src/common/ |
H A D | aes_gcm_helper.cpp | 176 std::vector<unsigned char> iv(G_AES_GCM_IV_LEN); in EncryptAesGcm() local 185 if (!RAND_bytes(iv.data(), G_AES_GCM_IV_LEN)) { in EncryptAesGcm() 191 reinterpret_cast<const unsigned char *>(key.data()), iv.data())) { in EncryptAesGcm() 213 cipherText = std::string(iv.begin(), iv.end()); in EncryptAesGcm() 226 std::vector<unsigned char> iv(G_AES_GCM_IV_LEN); in DecryptAesGcm() local 230 iv.assign(cipherBytes.begin(), cipherBytes.begin() + G_AES_GCM_IV_LEN); in DecryptAesGcm() 241 reinterpret_cast<const unsigned char *>(key.data()), iv.data())) { in DecryptAesGcm()
|
/ohos5.0/foundation/multimedia/av_codec/test/unittest/avcenc_info_test/ |
H A D | cenc_info_capi_unit_test.cpp | 134 uint8_t iv[] = { variable 140 errNo = OH_AVCencInfo_SetKeyIdAndIv(cencInfo, keyId, keyIdLen, iv, ivLen); 158 uint8_t iv[] = { variable 161 errNo = OH_AVCencInfo_SetKeyIdAndIv(nullptr, keyId, keyIdLen, iv, ivLen); 174 uint8_t iv[] = { variable 180 errNo = OH_AVCencInfo_SetKeyIdAndIv(cencInfo, nullptr, keyIdLen, iv, ivLen); 198 uint8_t iv[] = { variable 204 errNo = OH_AVCencInfo_SetKeyIdAndIv(cencInfo, keyId, keyIdLen + 1, iv, ivLen); 243 uint8_t iv[] = { variable 386 uint8_t iv[] = { variable [all …]
|
/ohos5.0/drivers/peripheral/clearplay/hdi_service/src/ |
H A D | media_decrypt_module_service.cpp | 102 ret = DecryptByAesCbc(key, cryptoInfo.iv, srcData, destData, cryptoInfo.subSamples); in DecryptMediaData() 105 ret = DecryptByAesCbc(key, cryptoInfo.iv, srcData, destData, cryptoInfo.subSamples); in DecryptMediaData() 109 ret = DecryptBySM4Cbc(key, cryptoInfo.iv, srcData, destData, cryptoInfo.subSamples); in DecryptMediaData() 136 …ryptModuleService::DecryptBySM4Cbc(const std::vector<uint8_t> &key, const std::vector<uint8_t> &iv, in DecryptBySM4Cbc() argument 144 if (key.size() != BLOCK_SIZE || iv.size() != BLOCK_SIZE) { in DecryptBySM4Cbc() 150 EVP_DecryptInit_ex(ctx, EVP_sm4_cbc(), nullptr, key.data(), iv.data()); in DecryptBySM4Cbc() 183 …ryptModuleService::DecryptByAesCbc(const std::vector<uint8_t> &key, const std::vector<uint8_t> &iv, in DecryptByAesCbc() argument 190 if (key.size() != BLOCK_SIZE || iv.size() != BLOCK_SIZE) { in DecryptByAesCbc() 213 &opensslKey, (unsigned char *)iv.data(), AES_DECRYPT); in DecryptByAesCbc()
|