psa_util: skip leading zeros in der format with "if" instead of "while"
This is possible because we know that DER format can have at most
1 leading zero.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
diff --git a/library/psa_util.c b/library/psa_util.c
index ad5c9fb..e69ff6b 100644
--- a/library/psa_util.c
+++ b/library/psa_util.c
@@ -494,8 +494,8 @@
return ret;
}
- /* Skip leading zeros */
- while (*p == 0x00) {
+ /* Skip possible leading zero */
+ if (*p == 0x00) {
p++;
unpadded_len--;
/* It should never happen that the input number is all zeros. */