Extend uuid component for tf-a compatibility

Adds a public function to change a binary encoded uuid in standard
big-endian byte order to the little-endian structure used by tf-a.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: Iee393c32f2a5a8472b3ac4dc1f4ab6e137756f1a
diff --git a/components/common/uuid/uuid.h b/components/common/uuid/uuid.h
index e45e37a..1bc4e67 100644
--- a/components/common/uuid/uuid.h
+++ b/components/common/uuid/uuid.h
@@ -35,25 +35,34 @@
 };
 
 /*
- * Check if uuid string in canonical form is valid.  Returns the number of
- * valid characters.  This will either be UUID_CANONICAL_FORM_LEN or zero
+ * Check if uuid string in canonical form is valid. Returns the number of
+ * valid characters. This will either be UUID_CANONICAL_FORM_LEN or zero
  * if the string is invalid in some way.
  */
 size_t uuid_is_valid(const char *canonical_form);
 
 /*
- * Parses a uuid string in canonical string form, outputing as an array of bytes.
- * Returns the number of characters parsed from the input string.  Returns zero
- * if there is a parsing error.
+ * Parses a uuid string in canonical string form, outputting as an array of bytes
+ * in the standard big endian byte order. Returns the number of characters parsed
+ * from the input string. Returns zero if there is a parsing error.
  */
-size_t uuid_parse_to_octets(const char *canonical_form, uint8_t *buf, size_t buf_size);
+size_t uuid_parse_to_octets(const char *canonical_form,
+    uint8_t *buf, size_t buf_size);
 
 /*
  * Parses a uuid string in canonical string form but instead of outputting octets
  * in standard byte order, octets from each section of the canonical uuid are
  * reversed.
  */
-size_t uuid_parse_to_octets_reversed(const char *canonical_form, uint8_t *buf, size_t buf_size);
+size_t uuid_parse_to_octets_reversed(const char *canonical_form,
+    uint8_t *buf, size_t buf_size);
+
+/*
+ * Reverses bytes from the normal big endian binary encoding to the reversed encoding used
+ * by tf-a and optee (same byte order as uuid_parse_to_octets_reversed()).
+ */
+void uuid_reverse_octets(const struct uuid_octets *standard_encoding,
+    uint8_t *buf, size_t buf_size);
 
 
 #ifdef __cplusplus