Interface: Fix veneer function naming

Some veneer functions are named with "tfm_tfm_" prefix. It is confusing
and unfriendly to NS integration.

This patch unifies the prefix of all the veneer function as "tfm_"
- Fix the duplicated "tfm_" prefixes by checking secure function prefix
  in tfm_veneer template.
- Replace all the "tfm_tfm_" prefixes with "tfm_".

Change-Id: Id658486f49f4a6f1f22fd3897be27865889474ae
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/interface/include/tfm_veneers.h.template b/interface/include/tfm_veneers.h.template
index 502dee2..ee17d3f 100644
--- a/interface/include/tfm_veneers.h.template
+++ b/interface/include/tfm_veneers.h.template
@@ -22,7 +22,14 @@
     {% endif %}
 /******** {{partition.manifest.name}} ********/
     {% for function in partition.manifest.secure_functions%}
+        {% if function.signal.lower().startswith('tfm_') %}
+        {# If signal already contains tfm_ prefix, avoid adding a duplicated one
+           in veneer function name.
+        #}
+psa_status_t {{function.signal.lower()}}_veneer(psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len);
+        {% else %}
 psa_status_t tfm_{{function.signal.lower()}}_veneer(psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len);
+        {% endif %}
     {% endfor %}
     {% if partition.attr.conditional %}
 #endif /* {{partition.attr.conditional}} */