goto clean;
}
- public_key = TEE_Malloc(kem->length_public_key*sizeof(uint8_t), 0);
- private_key = TEE_Malloc(kem->length_secret_key*sizeof(uint8_t), 0);
+ public_key = TEE_Malloc(kem->length_public_key, 0);
+ private_key = TEE_Malloc(kem->length_secret_key, 0);
if (public_key == NULL || private_key == NULL) {
LOG("Failed to allocate key buffers");
ret = TEE_ERROR_OUT_OF_MEMORY;
goto clean;
}
- shared_secret = TEE_Malloc(kem->length_shared_secret*sizeof(uint8_t), 0);
- ciphertext = TEE_Malloc(kem->length_ciphertext*sizeof(uint8_t), 0);
+ shared_secret = TEE_Malloc(kem->length_shared_secret, 0);
+ ciphertext = TEE_Malloc(kem->length_ciphertext, 0);
if (shared_secret == NULL || ciphertext == NULL) {
LOG("Failed to allocate buffers");
ret = TEE_ERROR_OUT_OF_MEMORY;
goto clean;
}
- shared_secret = TEE_Malloc(kem->length_shared_secret*sizeof(uint8_t), 0);
+ shared_secret = TEE_Malloc(kem->length_shared_secret, 0);
if (shared_secret == NULL) {
LOG("Failed to allocate buffer");
ret = TEE_ERROR_OUT_OF_MEMORY;