Home
last modified time | relevance | path

Searched refs:cipherKey (Results 1 – 25 of 35) sorted by relevance

12

/ohos5.0/foundation/communication/dsoftbus/adapter/common/openssl/
H A Dsoftbus_aes_encrypt.c138 if (memcpy_s(cipherKey->iv, cipherKey->ivLen, result + AES_SESSION_KEY_LENGTH, in RootKeyGenerateIvAndSessionKey()
156 cipherKey->key = (uint8_t *)SoftBusCalloc(cipherKey->keyLen); in GenerateIvAndSessionKey()
160 cipherKey->iv = (uint8_t *)SoftBusCalloc(cipherKey->ivLen); in GenerateIvAndSessionKey()
167 (void)memset_s(cipherKey->key, cipherKey->keyLen, 0, cipherKey->keyLen); in GenerateIvAndSessionKey()
168 (void)memset_s(cipherKey->iv, cipherKey->ivLen, 0, cipherKey->ivLen); in GenerateIvAndSessionKey()
197 (void)memset_s(cipherKey.key, cipherKey.keyLen, 0, cipherKey.keyLen); in SoftBusAesCfbRootEncrypt()
198 (void)memset_s(cipherKey.iv, cipherKey.ivLen, 0, cipherKey.ivLen); in SoftBusAesCfbRootEncrypt()
205 (void)memset_s(cipherKey.key, cipherKey.keyLen, 0, cipherKey.keyLen); in SoftBusAesCfbRootEncrypt()
206 (void)memset_s(cipherKey.iv, cipherKey.ivLen, 0, cipherKey.ivLen); in SoftBusAesCfbRootEncrypt()
229 EncryptKey key = { cipherKey->key, cipherKey->keyLen }; in SoftBusAesCfbEncrypt()
[all …]
H A Dsoftbus_adapter_crypto.c393 int32_t SoftBusEncryptData(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t inLen, in SoftBusEncryptData() argument
396 …if (cipherKey == NULL || input == NULL || inLen == 0 || encryptData == NULL || encryptLen == NULL)… in SoftBusEncryptData()
400 if (SoftBusGenerateRandomArray(cipherKey->iv, sizeof(cipherKey->iv)) != SOFTBUS_OK) { in SoftBusEncryptData()
405 int32_t result = SslAesGcmEncrypt(cipherKey, input, inLen, encryptData, outLen); in SoftBusEncryptData()
419 if (SoftBusGenerateRandomArray(cipherKey->iv, sizeof(cipherKey->iv)) != SOFTBUS_OK) { in SoftBusEncryptDataWithSeq()
423 if (memcpy_s(cipherKey->iv, sizeof(int32_t), &seqNum, sizeof(int32_t)) != EOK) { in SoftBusEncryptDataWithSeq()
427 int32_t result = SslAesGcmEncrypt(cipherKey, input, inLen, encryptData, outLen); in SoftBusEncryptDataWithSeq()
435 int32_t SoftBusDecryptData(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t inLen, in SoftBusDecryptData() argument
442 if (memcpy_s(cipherKey->iv, sizeof(cipherKey->iv), input, GCM_IV_LEN) != EOK) { in SoftBusDecryptData()
447 int32_t result = SslAesGcmDecrypt(cipherKey, input, inLen, decryptData, outLen); in SoftBusDecryptData()
[all …]
/ohos5.0/foundation/communication/dsoftbus/tests/adapter/unittest/
H A Ddsoftbus_crypto_test.cpp280 AesGcmCipherKey cipherKey; variable
302 AesGcmCipherKey cipherKey; variable
303 cipherKey.keyLen = 32;
325 AesGcmCipherKey cipherKey; variable
326 cipherKey.keyLen = 32;
345 AesGcmCipherKey cipherKey; variable
368 AesGcmCipherKey cipherKey; variable
369 cipherKey.keyLen = 32;
390 AesGcmCipherKey cipherKey; variable
391 cipherKey.keyLen = 32;
[all …]
H A Ddsoftbus_aes_crypto_test.cpp326 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
363 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
365 ret = SoftBusAesGcmEncrypt(nullptr, &cipherKey, ENCRYPT_MODE, &encryptOutData);
375 ret = SoftBusAesGcmEncrypt(&encryptInData, &cipherKey, ENCRYPT_MODE, nullptr);
405 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
445 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
484 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
527 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
545 ret = SoftBusAesCfbEncrypt(&encryptInData, &cipherKey, ENCRYPT_MODE, nullptr);
575 AesCipherKey cipherKey = { randSession, randKeyLen, randIv, randIvLen }; variable
[all …]
/ohos5.0/foundation/communication/dsoftbus/adapter/common/mbedtls/
H A Dsoftbus_adapter_crypto.c92 …ret = mbedtls_gcm_setkey(&aesContext, MBEDTLS_CIPHER_ID_AES, cipherKey->key, cipherKey->keyLen * K… in MbedAesGcmEncrypt()
105 if (memcpy_s(cipherText, cipherTextLen, cipherKey->iv, GCM_IV_LEN) != EOK) { in MbedAesGcmEncrypt()
132 …mbedtls_gcm_setkey(&aesContext, MBEDTLS_CIPHER_ID_AES, cipherKey->key, cipherKey->keyLen * KEY_BIT… in MbedAesGcmDecrypt()
276 if (SoftBusGenerateRandomArray(cipherKey->iv, sizeof(cipherKey->iv)) != SOFTBUS_OK) { in SoftBusEncryptData()
281 int32_t result = MbedAesGcmEncrypt(cipherKey, input, inLen, encryptData, outLen); 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()
303 int32_t result = MbedAesGcmEncrypt(cipherKey, input, inLen, encryptData, outLen); in SoftBusEncryptDataWithSeq()
318 if (memcpy_s(cipherKey->iv, sizeof(cipherKey->iv), input, GCM_IV_LEN) != EOK) { in SoftBusDecryptData()
323 int32_t result = MbedAesGcmDecrypt(cipherKey, input, inLen, decryptData, outLen); in SoftBusDecryptData()
[all …]
H A Dsoftbus_aes_encrypt_virtual.c42 const AesInputData *inData, AesCipherKey *cipherKey, int32_t encMode, AesOutputData *outData) in SoftBusAesCfbEncrypt() argument
45 (void)cipherKey; in SoftBusAesCfbEncrypt()
52 const AesInputData *inData, AesCipherKey *cipherKey, int32_t encMode, AesOutputData *outData) in SoftBusAesGcmEncrypt() argument
55 (void)cipherKey; in SoftBusAesGcmEncrypt()
/ohos5.0/foundation/communication/dsoftbus/core/bus_center/utils/src/
H A Dlnn_common_utils.c65 AesGcmCipherKey cipherKey = {.keyLen = in->keyLen}; in LnnEncryptAesGcm() local
66 if (memcpy_s(cipherKey.key, sizeof(cipherKey.key), in->key, in->keyLen) != EOK) { in LnnEncryptAesGcm()
71 int32_t ret = SoftBusEncryptData(&cipherKey, in->data, in->dataLen, encData, &encDataLen); in LnnEncryptAesGcm()
72 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in LnnEncryptAesGcm()
98 AesGcmCipherKey cipherKey = {.keyLen = in->keyLen}; in LnnDecryptAesGcm() local
99 if (memcpy_s(cipherKey.key, sizeof(cipherKey.key), in->key, in->keyLen) != EOK) { in LnnDecryptAesGcm()
104 int32_t ret = SoftBusDecryptData(&cipherKey, in->data, in->dataLen, decData, &decDataLen); in LnnDecryptAesGcm()
105 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in LnnDecryptAesGcm()
/ohos5.0/foundation/communication/dsoftbus/sdk/transmission/trans_channel/udp/stream/adaptor/src/
H A Dstream_adaptor.cpp119 AesGcmCipherKey cipherKey = {0}; in Encrypt() local
126 cipherKey.keyLen = SESSION_KEY_LENGTH; in Encrypt()
127 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey.first, sessionKey.second) != EOK) { in Encrypt()
132 int ret = SoftBusEncryptData(&cipherKey, reinterpret_cast<const unsigned char *>(in), inLen, in Encrypt()
134 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in Encrypt()
146 AesGcmCipherKey cipherKey = {0}; in Decrypt() local
153 cipherKey.keyLen = SESSION_KEY_LENGTH; // 256 bit encryption in Decrypt()
154 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey.first, sessionKey.second) != EOK) { in Decrypt()
158 int ret = SoftBusDecryptData(&cipherKey, reinterpret_cast<const unsigned char *>(in), inLen, in Decrypt()
160 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in Decrypt()
/ohos5.0/foundation/communication/dsoftbus/tests/core/transmission/common/mock/src/
H A Dtrans_common_mock.cpp61 int32_t SoftBusEncryptDataWithSeq(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t … in SoftBusEncryptDataWithSeq() argument
64 …return GetCommonInterface()->SoftBusEncryptDataWithSeq(cipherKey, input, inLen, encryptData, encry… in SoftBusEncryptDataWithSeq()
67 int32_t SoftBusDecryptDataWithSeq(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t … in SoftBusDecryptDataWithSeq() argument
70 …return GetCommonInterface()->SoftBusDecryptDataWithSeq(cipherKey, input, inLen, decryptData, decry… in SoftBusDecryptDataWithSeq()
/ohos5.0/base/security/huks/services/huks_standard/huks_engine/main/core/src/
H A Dhks_keyblob_lite.c97 static int32_t BuildKeyBlobUsageSpec(const struct HksBlob *cipherKey, const struct HksBlob *random, in BuildKeyBlobUsageSpec() argument
105 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)cipherKey->data; in BuildKeyBlobUsageSpec()
122 .data = cipherKey->data + sizeof(keyInfo->keyInfoLen) in BuildKeyBlobUsageSpec()
139 static int32_t EncryptAndDecryptKeyBlob(struct HksBlob *rawKey, struct HksBlob *cipherKey, bool isE… in EncryptAndDecryptKeyBlob() argument
141 struct HksStoreKeyInfo *keyInfo = (struct HksStoreKeyInfo *)cipherKey->data; in EncryptAndDecryptKeyBlob()
160 ret = BuildKeyBlobUsageSpec(cipherKey, &random, isEncrypt, &usageSpec); in EncryptAndDecryptKeyBlob()
169 … struct HksBlob tag = { HKS_AE_TAG_LEN, cipherKey->data + keyInfo->keyInfoLen - HKS_AE_TAG_LEN }; in EncryptAndDecryptKeyBlob()
183 static int32_t EncryptKeyBlob(const struct HksBlob *rawKey, struct HksBlob *cipherKey) in EncryptKeyBlob() argument
185 return EncryptAndDecryptKeyBlob((struct HksBlob *)rawKey, cipherKey, true); in EncryptKeyBlob()
188 static int32_t DecryptKeyBlob(const struct HksBlob *cipherKey, struct HksBlob *rawKey) in DecryptKeyBlob() argument
[all …]
H A Dhks_keyblob.c511 struct HksBlob cipherKeyBlob = { HKS_KEY_BLOB_AT_KEY_BYTES, authTokenKey.cipherKey }; in HksDecryptAuthToken()
623 (void)memcpy_s(g_cachedAuthTokenKey.cipherKey, HKS_KEY_BLOB_AT_KEY_BYTES, in GenerateAuthTokenKey()
638 struct HksBlob cipherKey = { 0, NULL }; in GenerateAuthTokenKey() local
639 ret = HksCryptoHalGenerateKey(&cipherSpec, &cipherKey); in GenerateAuthTokenKey()
647 …(void)memcpy_s(g_cachedAuthTokenKey.cipherKey, HKS_KEY_BLOB_AT_KEY_BYTES, cipherKey.data, cipherKe… in GenerateAuthTokenKey()
649 HKS_MEMSET_FREE_BLOB(cipherKey); in GenerateAuthTokenKey()
/ohos5.0/foundation/communication/dsoftbus/tests/adapter/fuzztest/softbusaescrypto_fuzzer/
H A Dsoftbusaescrypto_fuzzer.cpp71 AesCipherKey cipherKey = { (uint8_t *)data, size, (uint8_t *)data, size }; in SoftBusAesGcmEncryptFuzzTest() local
73 …if (SoftBusAesGcmEncrypt(&encryptInData, &cipherKey, ENCRYPT_MODE, &encryptOutData) != SOFTBUS_OK)… in SoftBusAesGcmEncryptFuzzTest()
77 …if (SoftBusAesGcmEncrypt((const AesInputData *)&encryptOutData, &cipherKey, DECRYPT_MODE, &decrypt… in SoftBusAesGcmEncryptFuzzTest()
121 AesCipherKey cipherKey = { randomSession, size, randomIv, size }; in SoftBusAesCfbEncryptFuzzTest() local
124 …if (SoftBusAesCfbEncrypt(&encryptInData, &cipherKey, ENCRYPT_MODE, &encryptOutData) != SOFTBUS_OK)… in SoftBusAesCfbEncryptFuzzTest()
/ohos5.0/foundation/communication/dsoftbus/tests/adapter/fuzztest/softbusdecryptdata_fuzzer/
H A Dsoftbusdecryptdata_fuzzer.cpp27 AesGcmCipherKey cipherKey; in SoftBusDecryptDataTest() local
30 SoftBusDecryptData(&cipherKey, reinterpret_cast<const unsigned char*>(data), size, in SoftBusDecryptDataTest()
/ohos5.0/foundation/communication/dsoftbus/sdk/transmission/trans_channel/tcp_direct/src/
H A Dclient_trans_tcp_direct_message.c75 AesGcmCipherKey cipherKey = {0}; in TransTdcDecrypt() local
76 cipherKey.keyLen = SESSION_KEY_LENGTH; // 256 bit encryption in TransTdcDecrypt()
77 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey, SESSION_KEY_LENGTH) != EOK) { in TransTdcDecrypt()
81 …int32_t ret = SoftBusDecryptData(&cipherKey, (unsigned char*)in, inLen, (unsigned char*)out, outLe… in TransTdcDecrypt()
82 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in TransTdcDecrypt()
93 AesGcmCipherKey cipherKey = {0}; in TransTdcEncryptWithSeq() local
94 cipherKey.keyLen = SESSION_KEY_LENGTH; in TransTdcEncryptWithSeq()
95 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey, SESSION_KEY_LENGTH) != EOK) { in TransTdcEncryptWithSeq()
99 …int ret = SoftBusEncryptDataWithSeq(&cipherKey, (unsigned char*)in, inLen, (unsigned char*)out, ou… in TransTdcEncryptWithSeq()
100 if (memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)) != EOK) { in TransTdcEncryptWithSeq()
/ohos5.0/foundation/communication/dsoftbus/adapter/common/include/
H A Dsoftbus_aes_encrypt.h63 const AesInputData *inData, AesCipherKey *cipherKey, int32_t encMode, AesOutputData *outData);
66 const AesInputData *inData, AesCipherKey *cipherKey, int32_t encMode, AesOutputData *outData);
H A Dsoftbus_adapter_crypto.h80 int32_t SoftBusEncryptDataWithSeq(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t …
86 int32_t SoftBusDecryptDataWithSeq(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t …
/ohos5.0/foundation/communication/dsoftbus/core/authentication/src/
H A Dauth_session_key.c434 AesGcmCipherKey cipherKey = {.keyLen = sessionKey.len}; in EncryptData() local
435 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey.value, sessionKey.len) != EOK) { in EncryptData()
441 int32_t ret = SoftBusEncryptDataWithSeq(&cipherKey, inDataInfo->inData, inDataInfo->inLen, in EncryptData()
443 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in EncryptData()
467 AesGcmCipherKey cipherKey = {.keyLen = sessionKey.len}; in DecryptData() local
468 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey.value, sessionKey.len) != EOK) { in DecryptData()
474 int32_t ret = SoftBusDecryptDataWithSeq(&cipherKey, inDataInfo->inData + ENCRYPT_INDEX_LEN, in DecryptData()
476 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in DecryptData()
/ohos5.0/foundation/communication/dsoftbus/tests/core/transmission/common/mock/include/
H A Dtrans_common_mock.h38 virtual int32_t SoftBusEncryptDataWithSeq(AesGcmCipherKey *cipherKey,
42 virtual int32_t SoftBusDecryptDataWithSeq(AesGcmCipherKey *cipherKey,
/ohos5.0/drivers/peripheral/user_auth/hdi_service/common/src/
H A Duser_sign_centre.c87 .key = CreateBufferByData(tokenKey->cipherKey, sizeof(tokenKey->cipherKey)), in DecryptTokenCipher()
180 aesGcmParam->key = CreateBufferByData(tokenKey->cipherKey, sizeof(tokenKey->cipherKey)); in InitAesGcmParam()
/ohos5.0/foundation/communication/dsoftbus/sdk/transmission/trans_channel/proxy/src/
H A Dclient_trans_proxy_manager.c409 AesGcmCipherKey cipherKey = { 0 }; in ClientTransProxyDecryptPacketData() local
410 cipherKey.keyLen = SESSION_KEY_LENGTH; in ClientTransProxyDecryptPacketData()
411 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, info.sessionKey, SESSION_KEY_LENGTH) != EOK) { in ClientTransProxyDecryptPacketData()
416 &cipherKey, dataInfo->inData, dataInfo->inLen, dataInfo->outData, &(dataInfo->outLen), seq); in ClientTransProxyDecryptPacketData()
417 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in ClientTransProxyDecryptPacketData()
927 AesGcmCipherKey cipherKey = { 0 }; in ClientTransProxyPackBytes() local
928 cipherKey.keyLen = SESSION_KEY_LENGTH; in ClientTransProxyPackBytes()
929 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey, SESSION_KEY_LENGTH) != EOK) { in ClientTransProxyPackBytes()
935 int32_t ret = SoftBusEncryptDataWithSeq(&cipherKey, (const unsigned char *)dataInfo->inData, in ClientTransProxyPackBytes()
937 (void)memset_s(cipherKey.key, SESSION_KEY_LENGTH, 0, SESSION_KEY_LENGTH); in ClientTransProxyPackBytes()
/ohos5.0/foundation/communication/dsoftbus/core/transmission/common/src/
H A Dsoftbus_message_open_channel.c418 AesGcmCipherKey cipherKey = {0}; in TransTdcEncrypt() local
419 cipherKey.keyLen = SESSION_KEY_LENGTH; in TransTdcEncrypt()
420 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey, SESSION_KEY_LENGTH) != EOK) { in TransTdcEncrypt()
424 …int32_t ret = SoftBusEncryptData(&cipherKey, (unsigned char *)in, inLen, (unsigned char *)out, out… in TransTdcEncrypt()
425 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in TransTdcEncrypt()
/ohos5.0/drivers/peripheral/user_auth/hdi_service/key_mgr/inc/
H A Dtoken_key.h28 uint8_t cipherKey[HKS_DEFAULT_USER_AT_KEY_LEN]; member
/ohos5.0/drivers/peripheral/user_auth/hdi_service/key_mgr/src/
H A Dtoken_key.c34 if (memcpy_s(key->cipherKey, HKS_DEFAULT_USER_AT_KEY_LEN, HKS_DEFAULT_USER_AT_CIPHER_KEY, in GetTokenKey()
/ohos5.0/foundation/communication/dsoftbus/sdk/transmission/trans_channel/udp/stream/libsoftbus_stream/
H A Dvtp_stream_socket.cpp1543 AesGcmCipherKey cipherKey = {0}; in Encrypt() local
1550 cipherKey.keyLen = SESSION_KEY_LENGTH; in Encrypt()
1551 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey_.first, sessionKey_.second) != EOK) { in Encrypt()
1556 …int ret = SoftBusEncryptData(&cipherKey, (unsigned char *)in, inLen, (unsigned char *)out, (unsign… in Encrypt()
1557 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in Encrypt()
1571 AesGcmCipherKey cipherKey = {0}; in Decrypt() local
1578 cipherKey.keyLen = SESSION_KEY_LENGTH; // 256 bit encryption in Decrypt()
1579 if (memcpy_s(cipherKey.key, SESSION_KEY_LENGTH, sessionKey_.first, sessionKey_.second) != EOK) { in Decrypt()
1583 …int ret = SoftBusDecryptData(&cipherKey, (unsigned char *)in, inLen, (unsigned char *)out, (unsign… in Decrypt()
1584 (void)memset_s(&cipherKey, sizeof(AesGcmCipherKey), 0, sizeof(AesGcmCipherKey)); in Decrypt()
/ohos5.0/foundation/communication/dsoftbus/tests/core/transmission/trans_channel/tcp_direct/unittest/mock/
H A Dtrans_tcp_direct_message_test_mock.cpp201 int32_t SoftBusEncryptData(AesGcmCipherKey *cipherKey, const unsigned char *input, uint32_t inLen, in SoftBusEncryptData() argument
204 …return GetTransTcpDirectMessageInterface()->SoftBusEncryptData(cipherKey, input, inLen, encryptDat… in SoftBusEncryptData()

12