Searched refs:GCM_IV_LEN (Results 1 - 3 of 3) sorted by relevance
/foundation/communication/dsoftbus/adapter/common/include/ |
H A D | softbus_adapter_crypto.h | 27 #define GCM_IV_LEN 12 macro 31 #define OVERHEAD_LEN (GCM_IV_LEN + TAG_LEN) 56 unsigned char iv[GCM_IV_LEN];
|
/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, GCM_IV_LEN, NULL, 0, in MbedAesGcmEncrypt() 99 plainText, cipherText + GCM_IV_LEN, TAG_LEN, tagBuf); in MbedAesGcmEncrypt() 105 if (memcpy_s(cipherText, cipherTextLen, cipherKey->iv, GCM_IV_LEN) != EOK) { in MbedAesGcmEncrypt() 110 if (memcpy_s(cipherText + GCM_IV_LEN + plainTextSize, cipherTextLen - GCM_IV_LEN - plainTextSize, tagBuf, in MbedAesGcmEncrypt() 140 ret = mbedtls_gcm_auth_decrypt(&aesContext, cipherTextSize - OVERHEAD_LEN, cipherKey->iv, GCM_IV_LEN, NULL, 0, in MbedAesGcmDecrypt() 141 cipherText + actualPlainLen + GCM_IV_LEN, TAG_LEN, cipherText + GCM_IV_LEN, plain); in MbedAesGcmDecrypt() 314 if (cipherKey == NULL || input == NULL || inLen < GCM_IV_LEN || decryptData == NULL || decryptLen == NULL) { in SoftBusDecryptData() 318 if (memcpy_s(cipherKey->iv, sizeof(cipherKey->iv), input, GCM_IV_LEN) ! in SoftBusDecryptData() [all...] |
/foundation/communication/dsoftbus/adapter/common/openssl/ |
H A D | softbus_adapter_crypto.c | 94 ret = EVP_CIPHER_CTX_ctrl(*ctx, EVP_CTRL_GCM_SET_IVLEN, GCM_IV_LEN, NULL); in OpensslEvpInit() 110 if (memcpy_s(cipherText, cipherTextLen - dataLen, cipherkey->iv, GCM_IV_LEN) != EOK) { in PackIvAndTag() 120 if (memcpy_s(cipherText + dataLen + GCM_IV_LEN, cipherTextLen - dataLen - GCM_IV_LEN, tagbuf, TAG_LEN) != EOK) { in PackIvAndTag() 150 ret = EVP_EncryptUpdate(ctx, cipherText + GCM_IV_LEN, (int32_t *)&outbufLen, plainText, plainTextSize); in SslAesGcmEncrypt() 157 ret = EVP_EncryptFinal_ex(ctx, cipherText + GCM_IV_LEN + outbufLen, (int32_t *)&outbufLen); in SslAesGcmEncrypt() 200 ret = EVP_DecryptUpdate(ctx, plain, (int32_t *)&plainLen, cipherText + GCM_IV_LEN, cipherTextSize - OVERHEAD_LEN); in SslAesGcmDecrypt() 442 if (cipherKey == NULL || input == NULL || inLen < GCM_IV_LEN || decryptData == NULL || decryptLen == NULL) { in SoftBusDecryptData() 446 if (memcpy_s(cipherKey->iv, sizeof(cipherKey->iv), input, GCM_IV_LEN) != EOK) { in SoftBusDecryptData()
|
Completed in 2 milliseconds