/foundation/filemanagement/storage_service/services/storage_daemon/crypto/test/fscrypt_v2_test/ |
H A D | fscrypt_key_v2_test.cpp | 326 KeyBlob aad(aadVct); in HWTEST_F() 328 EXPECT_TRUE(g_testKeyV2.CombKeyCtx(nonce, rndEnc, aad, keyOut)); in HWTEST_F() 337 EXPECT_FALSE(g_testKeyV2.CombKeyCtx(nonce, rndEnc, aad, keyOut)); in HWTEST_F() 340 aad.Clear(); in HWTEST_F() 341 EXPECT_FALSE(g_testKeyV2.CombKeyCtx(nonce, rndEnc, aad, keyOut)); in HWTEST_F() 345 EXPECT_FALSE(g_testKeyV2.CombKeyCtx(nonce, rndEnc, aad, keyOut)); in HWTEST_F() 362 KeyBlob aad(aadVct); in HWTEST_F() 365 EXPECT_FALSE(g_testKeyV2.SplitKeyCtx(keyIn, nonce, rndEnc, aad)); in HWTEST_F() 369 EXPECT_TRUE(g_testKeyV2.SplitKeyCtx(keyIn2, nonce, rndEnc, aad)); in HWTEST_F() 437 g_testKeyV2.keyContext_.aad in HWTEST_F() [all...] |
/foundation/CastEngine/castengine_cast_plus_stream/src/utils/src/ |
H A D | encrypt_decrypt.cpp | 162 if ((inputData.length < 0) || (encryInfo.aad.length < 0) || (encryInfo.key.length != AES_KEY_LEN_128) || in AES128GCMCheckEncryPara() 169 if ((encryInfo.aad.data == nullptr) && (encryInfo.aad.length > 0)) { in AES128GCMCheckEncryPara() 221 if (EVP_EncryptUpdate(ctx, nullptr, &len, encryInfo.aad.data, encryInfo.aad.length) != 1) { in EnctyptProcess() 281 if ((inputData.length < 0) || (encryInfo.aad.length < 0) || (encryInfo.key.length != AES_KEY_LEN_128) || in AES128GCMCheckDecryptPara() 288 if ((encryInfo.aad.data == nullptr) && (encryInfo.aad.length > 0)) { in AES128GCMCheckDecryptPara() 340 if (!EVP_DecryptUpdate(ctx, nullptr, &len, encryInfo.aad.data, encryInfo.aad in DecryptProcess() [all...] |
/foundation/CastEngine/castengine_cast_framework/service/src/session/src/utils/src/ |
H A D | encrypt_decrypt.cpp | 162 if ((inputData.length < 0) || (encryInfo.aad.length < 0) || (encryInfo.key.length != AES_KEY_LEN_128) ||
in AES128GCMCheckEncryPara() 169 if ((encryInfo.aad.data == nullptr) && (encryInfo.aad.length > 0)) {
in AES128GCMCheckEncryPara() 221 if (EVP_EncryptUpdate(ctx, nullptr, &len, encryInfo.aad.data, encryInfo.aad.length) != 1) {
in EnctyptProcess() 281 if ((inputData.length < 0) || (encryInfo.aad.length < 0) || (encryInfo.key.length != AES_KEY_LEN_128) ||
in AES128GCMCheckDecryptPara() 288 if ((encryInfo.aad.data == nullptr) && (encryInfo.aad.length > 0)) {
in AES128GCMCheckDecryptPara() 340 if (!EVP_DecryptUpdate(ctx, nullptr, &len, encryInfo.aad.data, encryInfo.aad in DecryptProcess() [all...] |
/foundation/filemanagement/storage_service/services/storage_daemon/crypto/src/ |
H A D | huks_master.cpp | 458 ctx.aad = HashWithPrefix("AAD SHA512 prefix", ctx.secDiscard, CRYPTO_AES_AAD_LEN); in AppendNonceAad() 461 { .tag = HKS_TAG_ASSOCIATED_DATA, .blob = { ctx.aad.size, ctx.aad.data.get() } } in AppendNonceAad() 472 { .tag = HKS_TAG_ASSOCIATED_DATA, .blob = { ctx.aad.size, ctx.aad.data.get() } } in AppendNonceAadTokenEx() 479 { .tag = HKS_TAG_ASSOCIATED_DATA, .blob = { ctx.aad.size, ctx.aad.data.get() } }, in AppendNonceAadTokenEx() 492 ctx.aad = HashWithPrefix("AAD SHA512 prefix", ctx.secDiscard, CRYPTO_AES_AAD_LEN); in AppendNewNonceAadToken() 495 LOGI("token & secret is empty, Only append nonce & aad!"); in AppendNewNonceAadToken() 500 { .tag = HKS_TAG_ASSOCIATED_DATA, .blob = {ctx.aad in AppendNewNonceAadToken() [all...] |
H A D | base_key.cpp | 76 KeyBlob tempAad(sourceCtx.aad); in DoTempStore() 80 targetCtx.aad = std::move(tempAad); in DoTempStore() 260 // save key buff nonce+rndEnc+aad in StoreKey() 301 !GenerateKeyBlob(keyCtx.aad, GCM_MAC_BYTES)) { in StoreKey() 302 LOGE("Generate nonce and aad failed !"); in StoreKey() 310 KeyBlob storeKey(keyCtx.nonce.size + keyCtx.rndEnc.size + keyCtx.aad.size); in StoreKey() 311 if (!CombKeyCtx(keyCtx.nonce, keyCtx.rndEnc, keyCtx.aad, storeKey)) { in StoreKey() 636 ctxNone.aad.Alloc(GCM_MAC_BYTES); in StoreKey() 638 if (!SplitKeyCtx(ctxNone.rndEnc, ctxNone.nonce, ctxNone.rndEnc, ctxNone.aad)) { in StoreKey() 1026 keyContext_.aad in StoreKey() 1051 CombKeyCtx(const KeyBlob &nonce, const KeyBlob &rndEnc, const KeyBlob &aad, KeyBlob &keyOut) StoreKey() argument 1072 SplitKeyCtx(const KeyBlob &keyIn, KeyBlob &nonce, KeyBlob &rndEnc, KeyBlob &aad) StoreKey() argument [all...] |
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/core/ |
H A D | nstackx_mbedtls.c | 111 GCM_IV_LENGTH, cryptPara->aad, cryptPara->aadLen, inBuf, outBuf, GCM_TAG_LENGTH, tagBuf); in MbedAesGcmEncrypt() 144 cryptPara->aad, cryptPara->aadLen, inBuf, outBuf, tagBuf); in MbedChaChaEncrypt() 204 cryptPara->aad, cryptPara->aadLen, inBuf + actualPlainLen, GCM_TAG_LENGTH, inBuf, outBuf); in MbedAesGcmDecrypt() 229 cryptPara->aad, cryptPara->aadLen, inBuf, outBuf, inBuf + actualPlainLen); in MbedChaChaDecrypt()
|
H A D | nstackx_openssl.c | 115 if (EVP_EncryptUpdate(cryptPara->ctx, NULL, &length, cryptPara->aad, (int32_t)cryptPara->aadLen) == 0) { in InitEncryptCtx() 116 LOGE(TAG, "add aad error"); in InitEncryptCtx() 188 if (EVP_DecryptUpdate(cryptPara->ctx, NULL, &length, cryptPara->aad, (int32_t)cryptPara->aadLen) == 0) { in InitDecryptCtx()
|
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/interface/ |
H A D | nstackx_mbedtls.h | 49 uint8_t aad[GCM_MAX_AAD_LENGTH]; member
|
H A D | nstackx_openssl.h | 55 uint8_t aad[GCM_MAX_AAD_LENGTH]; member
|
/foundation/filemanagement/storage_service/services/storage_daemon/include/crypto/ |
H A D | base_key.h | 112 bool CombKeyCtx(const KeyBlob &nonce, const KeyBlob &rndEnc, const KeyBlob &aad, KeyBlob &keyOut); 113 bool SplitKeyCtx(const KeyBlob &keyIn, KeyBlob &nonce, KeyBlob &rndEnc, KeyBlob &aad);
|
H A D | key_blob.h | 162 KeyBlob aad; member
|
/foundation/communication/dsoftbus/adapter/common/include/ |
H A D | softbus_adapter_crypto.h | 45 unsigned char *aad; member
|
/foundation/CastEngine/castengine_cast_plus_stream/src/utils/include/ |
H A D | encrypt_decrypt.h | 35 PacketData aad; member
|
/foundation/CastEngine/castengine_cast_framework/service/src/session/src/utils/include/ |
H A D | encrypt_decrypt.h | 35 PacketData aad;
member
|
/foundation/filemanagement/storage_service/services/storage_daemon/mock/ |
H A D | base_key_mock.cpp | 126 keyContext_.aad.Clear(); in ClearMemoryKeyCtx()
|
/foundation/communication/dsoftbus/components/nstackx/nstackx_core/dfile/core/ |
H A D | nstackx_file_manager.c | 1051 aadLen = sizeof(fileList->cryptPara.aad); in SetCryptPara() 1052 if (memset_s(fileList->cryptPara.aad, aadLen, GCM_AAD_CHAR, aadLen) != EOK) { in SetCryptPara() 1053 DFILE_LOGE(TAG, "memset aad failed"); in SetCryptPara()
|