X-Git-Url: https://git.cryptolib.org/?p=arm-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fshavs.c;fp=test_src%2Fshavs.c;h=5d2641366905ac2be9b66439d68cc696a5f4e830;hp=7ac8ec79f4c2460b179f8c2a4f01f196edb44042;hb=498cf95d73faff93a848d2c0ffec3987769670bb;hpb=85aee632b0799ce567b9df7a6d16f59ab1564b34 diff --git a/test_src/shavs.c b/test_src/shavs.c index 7ac8ec7..5d26413 100644 --- a/test_src/shavs.c +++ b/test_src/shavs.c @@ -157,7 +157,7 @@ int32_t getLength(void){ if(*len2=='='){ do{ len2++; - }while(*len2 && !isdigit(*len2)); + }while(*len2 && !isdigit((uint8_t)*len2)); len=(uint32_t)strtoul(len2, NULL, 10); return len; } @@ -229,7 +229,7 @@ void shavs_test1(void){ /* KAT tests */ cli_putstr("\r\n"); #endif while((c=cli_getc_cecho())!='M' && c!='m'){ - if(!isblank(c)){ + if(!isblank((uint8_t)c)){ cli_putstr("\r\nERROR: wrong input (1) [0x"); cli_hexdump(&c, 1); cli_putstr("]!\r\n"); @@ -248,7 +248,7 @@ void shavs_test1(void){ /* KAT tests */ return; } while((c=cli_getc_cecho())!='='){ - if(!isblank(c)){ + if(!isblank((uint8_t)c)){ cli_putstr("\r\nERROR: wrong input (4)!\r\n"); hfal_hash_free(&(shavs_ctx.ctx)); return; @@ -336,7 +336,7 @@ void shavs_test2(void){ /* Monte Carlo tests for SHA-1 & SHA-2 */ uint8_t m[ml*4+8]; for(;;){ while((c=cli_getc_cecho())!='S' && c!='s'){ - if(!isblank(c)){ + if(!isblank((uint8_t)c)){ cli_putstr("\r\nERROR: wrong input (1) [0x"); cli_hexdump(&c, 1); cli_putstr("]!\r\n"); @@ -356,7 +356,7 @@ void shavs_test2(void){ /* Monte Carlo tests for SHA-1 & SHA-2 */ return; } while((c=cli_getc_cecho())!='='){ - if(!isblank(c)){ + if(!isblank((uint8_t)c)){ cli_putstr("\r\nERROR: wrong input (5)!\r\n"); return; } @@ -421,7 +421,7 @@ void shavs_test3(void){ /* Monte Carlo tests for SHA-3 */ uint8_t m[ml+128]; for(;;){ while((c=cli_getc_cecho())!='S' && c!='s'){ - if(!isblank(c)){ + if(!isblank((uint8_t)c)){ cli_putstr("\r\nERROR: wrong input (1) [0x"); cli_hexdump(&c, 1); cli_putstr("]!\r\n"); @@ -441,7 +441,7 @@ void shavs_test3(void){ /* Monte Carlo tests for SHA-3 */ return; } while((c=cli_getc_cecho())!='='){ - if(!isblank(c)){ + if(!isblank((uint8_t)c)){ cli_putstr("\r\nERROR: wrong input (5)!\r\n"); return; }