Fix size_t overflow on While loop

Change-Id: I88d6b9eebe04283e86abcebbd5b38481c40866ff
diff --git a/secure_element/1.0/esehal/src/checksum.c b/secure_element/1.0/esehal/src/checksum.c
index d288b17..fe324e1 100644
--- a/secure_element/1.0/esehal/src/checksum.c
+++ b/secure_element/1.0/esehal/src/checksum.c
@@ -33,8 +33,10 @@
     uint8_t        c = 0;
 
     if (p)
-        while (n--)
+        while (n) {
             c ^= *p++;
+            n--;
+        }
     return c;
 }
 
@@ -87,7 +89,9 @@
     const uint8_t *p = s;
 
     if (s)
-        while(n--)
+        while(n) {
             crc = (uint8_t)(crc >> 8) ^ fast[(uint8_t)(crc ^ *p++)];
+            n--;
+        }
     return crc;
 }