psa_util: invert check order for leading zeros in convert_der_to_raw_single_int()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
diff --git a/library/psa_util.c b/library/psa_util.c
index dfea36b..be257e7 100644
--- a/library/psa_util.c
+++ b/library/psa_util.c
@@ -489,7 +489,7 @@
}
/* Skip possible leading zero */
- if ((*p == 0x00) && (unpadded_len > 0)) {
+ if ((unpadded_len > 0) && (*p == 0x00)) {
p++;
unpadded_len--;
/* It should never happen that the input number is all zeros. */